aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-01 17:49:45 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-01 17:49:45 +0200
commit9244830294b8566ba59477041aa7da9ff55bf509 (patch)
tree90a0e0dd24ed4e658d18fee289e4826e82301e4a /main/src
parent5697f37e68eaded949a4fa55b3866092249f480e (diff)
downloadcgeo-9244830294b8566ba59477041aa7da9ff55bf509.zip
cgeo-9244830294b8566ba59477041aa7da9ff55bf509.tar.gz
cgeo-9244830294b8566ba59477041aa7da9ff55bf509.tar.bz2
Fix #1332: uppercase geocode built from name when importing GPX
When importing a GPX file, if no geocode is found matching the expected format, one is built from the cache name. In several places, the geocode is transformed into upper case, which is supposed to be a no-op. Use uppercase when building a geocode from the cache name to ensure it is indeed a no-op.
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/files/GPXParser.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java
index 46cb481..e4e4e3a 100644
--- a/main/src/cgeo/geocaching/files/GPXParser.java
+++ b/main/src/cgeo/geocaching/files/GPXParser.java
@@ -278,7 +278,7 @@ public abstract class GPXParser extends FileParser {
// take the name as code, if nothing else is available
if (StringUtils.isBlank(cache.getGeocode())) {
if (StringUtils.isNotBlank(name)) {
- cache.setGeocode(name.trim());
+ cache.setGeocode(name.trim().toUpperCase());
}
}
@@ -312,7 +312,7 @@ public abstract class GPXParser extends FileParser {
fixCache(cache);
if (cache.getName().length() > 2) {
- final String cacheGeocodeForWaypoint = "GC" + cache.getName().substring(2);
+ final String cacheGeocodeForWaypoint = "GC" + cache.getName().substring(2).toUpperCase();
// lookup cache for waypoint in already parsed caches
final cgCache cacheForWaypoint = result.get(cacheGeocodeForWaypoint);