diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2011-09-16 18:22:38 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2011-09-16 18:37:23 +0200 |
commit | a025a700b60df64e16f6aed0ea2fa8b011313fea (patch) | |
tree | f70020db2927bffa87dae5d07b1a33210d0d39a7 /main/src/cgeo/geocaching/files | |
parent | f571eb3981c710907e8110e7c185e2d5a9fc8fa3 (diff) | |
download | cgeo-a025a700b60df64e16f6aed0ea2fa8b011313fea.zip cgeo-a025a700b60df64e16f6aed0ea2fa8b011313fea.tar.gz cgeo-a025a700b60df64e16f6aed0ea2fa8b011313fea.tar.bz2 |
Do not abuse String.indexOf()
Diffstat (limited to 'main/src/cgeo/geocaching/files')
-rw-r--r-- | main/src/cgeo/geocaching/files/GPXParser.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java index a0da184..6412564 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -254,8 +254,8 @@ public abstract class GPXParser extends FileParser { if (StringUtils.isNotBlank(cache.geocode) && cache.coords != null && ((type == null && sym == null) - || (type != null && type.indexOf("geocache") > -1) - || (sym != null && sym.indexOf("geocache") > -1))) { + || StringUtils.contains(type, "geocache") + || StringUtils.contains(sym, "geocache"))) { fixCache(cache); cache.reason = listId; cache.detailed = true; @@ -351,7 +351,7 @@ public abstract class GPXParser extends FileParser { public void end(String body) { body = body.toLowerCase(); sym = body; - if (body.indexOf("geocache") != -1 && body.indexOf("found") != -1) { + if (body.contains("geocache") && body.contains("found")) { cache.found = true; } } |