diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-08-26 18:56:59 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-08-26 18:56:59 +0200 |
| commit | c373effbc49b5b1d9443a84f9fa234be371cdf4a (patch) | |
| tree | ccac5d2564d16e48054a0b79f5defe67ae4a5dd1 /main/src/cgeo/geocaching/files | |
| parent | 1bdbb52841f11559fe8d4ab69c27ef6ed3521d43 (diff) | |
| download | cgeo-c373effbc49b5b1d9443a84f9fa234be371cdf4a.zip cgeo-c373effbc49b5b1d9443a84f9fa234be371cdf4a.tar.gz cgeo-c373effbc49b5b1d9443a84f9fa234be371cdf4a.tar.bz2 | |
refactoring: findbugs cleanup
* don't catch raw exceptions
Diffstat (limited to 'main/src/cgeo/geocaching/files')
| -rw-r--r-- | main/src/cgeo/geocaching/files/GPXParser.java | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/files/SimpleDirChooser.java | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java index 7ea0a39..3358759 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -272,7 +272,7 @@ public abstract class GPXParser extends FileParser { Double.valueOf(longitude))); } } - } catch (final Exception e) { + } catch (final NumberFormatException e) { Log.w("Failed to parse waypoint's latitude and/or longitude."); } } @@ -501,7 +501,7 @@ public abstract class GPXParser extends FileParser { if (attrs.getIndex("available") > -1) { cache.setDisabled(!attrs.getValue("available").equalsIgnoreCase("true")); } - } catch (final Exception e) { + } catch (final RuntimeException e) { Log.w("Failed to parse cache attributes."); } } @@ -680,7 +680,7 @@ public abstract class GPXParser extends FileParser { if (attrs.getIndex("ref") > -1) { trackable.setGeocode(attrs.getValue("ref")); } - } catch (final Exception e) { + } catch (final RuntimeException e) { // nothing } } @@ -724,7 +724,7 @@ public abstract class GPXParser extends FileParser { if (attrs.getIndex("id") > -1) { log.id = Integer.parseInt(attrs.getValue("id")); } - } catch (final Exception e) { + } catch (final NumberFormatException e) { // nothing } } diff --git a/main/src/cgeo/geocaching/files/SimpleDirChooser.java b/main/src/cgeo/geocaching/files/SimpleDirChooser.java index 6b2366c..8f69b88 100644 --- a/main/src/cgeo/geocaching/files/SimpleDirChooser.java +++ b/main/src/cgeo/geocaching/files/SimpleDirChooser.java @@ -93,7 +93,7 @@ public class SimpleDirChooser extends AbstractListActivity { for (File currentDir : dirs) { listDirs.add(new Option(currentDir.getName(), currentDir.getAbsolutePath())); } - } catch (Exception e) { + } catch (RuntimeException e) { } Collections.sort(listDirs); if (dir.getParent() != null) { |
