From a025a700b60df64e16f6aed0ea2fa8b011313fea Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 16 Sep 2011 18:22:38 +0200 Subject: Do not abuse String.indexOf() --- main/src/cgeo/geocaching/files/GPXParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main/src/cgeo/geocaching/files') 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; } } -- cgit v1.1