diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-07-09 20:00:20 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-07-09 20:00:20 +0200 |
| commit | 39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b (patch) | |
| tree | c16fb9a6910842b6d77f45a241e70bc9076bd239 /main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java | |
| parent | d958893efe7f492ebe909ba74f6e27ea2cb1532c (diff) | |
| download | cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.zip cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.tar.gz cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.tar.bz2 | |
remove some findbugs issues
* unused code
* convert explicit type casts to generic method invocations
Diffstat (limited to 'main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java')
| -rw-r--r-- | main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java b/main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java index 97c5c29..74f568f 100644 --- a/main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java +++ b/main/src/cgeo/geocaching/ui/dialog/CustomProgressDialog.java @@ -10,7 +10,6 @@ import android.view.View; import android.widget.TextView; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** @@ -19,31 +18,27 @@ import java.lang.reflect.Method; */ public class CustomProgressDialog extends ProgressDialog { - public CustomProgressDialog(Context context) { + public CustomProgressDialog(final Context context) { super(context, ActivityMixin.getDialogTheme()); } @Override - protected void onCreate(Bundle savedInstanceState) { + protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { - Method method = TextView.class.getMethod("setVisibility", Integer.TYPE); + final Method method = TextView.class.getMethod("setVisibility", Integer.TYPE); - Field[] fields = this.getClass().getSuperclass().getDeclaredFields(); + final Field[] fields = this.getClass().getSuperclass().getDeclaredFields(); - for (Field field : fields) { + for (final Field field : fields) { if (field.getName().equalsIgnoreCase("mProgressNumber")) { field.setAccessible(true); - TextView textView = (TextView) field.get(this); + final TextView textView = (TextView) field.get(this); method.invoke(textView, View.GONE); } } - } catch (NoSuchMethodException e) { - Log.e("Failed to invoke the progressDialog method 'setVisibility' and set 'mProgressNumber' to GONE.", e); - } catch (IllegalAccessException e) { - Log.e("Failed to invoke the progressDialog method 'setVisibility' and set 'mProgressNumber' to GONE.", e); - } catch (InvocationTargetException e) { + } catch (final ReflectiveOperationException e) { Log.e("Failed to invoke the progressDialog method 'setVisibility' and set 'mProgressNumber' to GONE.", e); } } |
