diff options
Diffstat (limited to 'main/src/cgeo/geocaching/files/GPXParser.java')
| -rw-r--r-- | main/src/cgeo/geocaching/files/GPXParser.java | 10 |
1 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 76e3713..3358759 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -54,7 +54,7 @@ public abstract class GPXParser extends FileParser { /** * Attention: case sensitive geocode pattern to avoid matching normal words in the name or description of the cache. */ - private static final Pattern PATTERN_GEOCODE = Pattern.compile("([A-Z][0-9A-Z]+)"); + private static final Pattern PATTERN_GEOCODE = Pattern.compile("([0-9A-Z]{2,})"); private static final Pattern PATTERN_GUID = Pattern.compile(".*" + Pattern.quote("guid=") + "([0-9a-z\\-]+)", Pattern.CASE_INSENSITIVE); private static final Pattern PATTERN_URL_GEOCODE = Pattern.compile(".*" + Pattern.quote("wp=") + "([A-Z][0-9A-Z]+)", Pattern.CASE_INSENSITIVE); /** @@ -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 } } |
