Project

General

Profile

Anomalie #2117

PMD : EmptyFinallyBlock ListLoader

Added by Mickael G. almost 7 years ago. Updated almost 7 years ago.

Status:
Fermé
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
04/25/2013
Due date:
% Done:

100%

Estimated time:

Description

   @Override 
   public List<Alert> loadInBackground() {
     List<Alert> result = new ArrayList<Alert>();

     // TODO Query of data

     AlertSQLiteAdapter adapter = new AlertSQLiteAdapter(context);
     try {
       ContentResolver provider = this.context.getContentResolver();
       String selection = null;
       if (criterias != null && !criterias.isEmpty()) {
         selection = criterias.toSQLiteString();
       }
       Cursor c = provider.query(EpackhygieneProvider.ALERT_URI, adapter.getCols(), selection, null, null);
       result = adapter.cursorToItems(c);
       c.close();
     } catch (Exception e) {
       e.printStackTrace();
     } finally {

     }

replace by

   @Override 
   public List<Alert> loadInBackground() {
     List<Alert> result = new ArrayList<Alert>();

     // TODO Query of data

     AlertSQLiteAdapter adapter = new AlertSQLiteAdapter(context);
     try {
       ContentResolver provider = this.context.getContentResolver();
       String selection = null;
       if (criterias != null && !criterias.isEmpty()) {
         selection = criterias.toSQLiteString();
       }
       Cursor c = provider.query(EpackhygieneProvider.ALERT_URI, adapter.getCols(), selection, null, null);
       result = adapter.cursorToItems(c);
       c.close();
     } catch (Exception e) {
       e.printStackTrace();
     }

Recurrences


Related issues

Related to Harmony - Evolution #2131: Clean CheckstyleFermé2013-04-292013-05-06

Copied from Harmony - Anomalie #2116: PMD : CollapsibleIfStatements ListLoaderFermé2013-04-25

Copied to Harmony - Anomalie #2118: PMD : UselessParentheses ApplicationBaseFermé2013-04-25

History

Also available in: Atom PDF

Go to top
Add picture from clipboard (Maximum size: 200 MB)