diff options
Diffstat (limited to 'main/src/cgeo/geocaching/export/GpxSerializer.java')
-rw-r--r-- | main/src/cgeo/geocaching/export/GpxSerializer.java | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/main/src/cgeo/geocaching/export/GpxSerializer.java b/main/src/cgeo/geocaching/export/GpxSerializer.java index b24eb4c..8139c76 100644 --- a/main/src/cgeo/geocaching/export/GpxSerializer.java +++ b/main/src/cgeo/geocaching/export/GpxSerializer.java @@ -7,7 +7,7 @@ import cgeo.geocaching.Trackable; import cgeo.geocaching.Waypoint; import cgeo.geocaching.enumerations.CacheAttribute; import cgeo.geocaching.enumerations.LoadFlags; -import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.location.Geopoint; import cgeo.geocaching.utils.Log; import cgeo.geocaching.utils.SynchronizedDateFormat; import cgeo.geocaching.utils.TextUtils; @@ -55,7 +55,7 @@ public final class GpxSerializer { } - public void writeGPX(List<String> allGeocodesIn, Writer writer, final ProgressListener progressListener) throws IOException { + public void writeGPX(final List<String> allGeocodesIn, final Writer writer, final ProgressListener progressListener) throws IOException { // create a copy of the geocode list, as we need to modify it, but it might be immutable final ArrayList<String> allGeocodes = new ArrayList<>(allGeocodesIn); @@ -88,7 +88,7 @@ public final class GpxSerializer { gpx.endDocument(); } - private void exportBatch(final XmlSerializer gpx, Collection<String> geocodesOfBatch) throws IOException { + private void exportBatch(final XmlSerializer gpx, final Collection<String> geocodesOfBatch) throws IOException { final Set<Geocache> caches = DataStore.loadCaches(geocodesOfBatch, LoadFlags.LOAD_ALL_DB_ONLY); for (final Geocache cache : caches) { if (cache == null) { @@ -174,11 +174,10 @@ public final class GpxSerializer { } /** - * @param boolFlag * @return XML schema compliant boolean representation of the boolean flag. This must be either true, false, 0 or 1, * but no other value (also not upper case True/False). */ - private static String gpxBoolean(boolean boolFlag) { + private static String gpxBoolean(final boolean boolFlag) { return boolFlag ? "true" : "false"; } @@ -195,7 +194,7 @@ public final class GpxSerializer { try { final int numericPrefix = Integer.parseInt(prefix); maxPrefix = Math.max(numericPrefix, maxPrefix); - } catch (final NumberFormatException ex) { + } catch (final NumberFormatException ignored) { // ignore non numeric prefix, as it should be unique in the list of non-own waypoints already } } @@ -220,12 +219,6 @@ public final class GpxSerializer { /** * Writes one waypoint entry for cache waypoint. - * - * @param cache - * The - * @param wp - * @param prefix - * @throws IOException */ private void writeCacheWaypoint(final Waypoint wp) throws IOException { final Geopoint coords = wp.getCoords(); @@ -261,7 +254,7 @@ public final class GpxSerializer { } private void writeLogs(final Geocache cache) throws IOException { - List<LogEntry> logs = cache.getLogs(); + final List<LogEntry> logs = cache.getLogs(); if (logs.isEmpty()) { return; } @@ -297,7 +290,7 @@ public final class GpxSerializer { } private void writeTravelBugs(final Geocache cache) throws IOException { - List<Trackable> inventory = cache.getInventory(); + final List<Trackable> inventory = cache.getInventory(); if (CollectionUtils.isEmpty(inventory)) { return; } @@ -344,7 +337,7 @@ public final class GpxSerializer { return getLocationPart(cache, 0); } - private static String getLocationPart(final Geocache cache, int partIndex) { + private static String getLocationPart(final Geocache cache, final int partIndex) { final String location = cache.getLocation(); if (StringUtils.contains(location, ", ")) { final String[] parts = StringUtils.split(location, ','); @@ -356,7 +349,7 @@ public final class GpxSerializer { } public static String getCountry(final Geocache cache) { - String country = getLocationPart(cache, 1); + final String country = getLocationPart(cache, 1); if (StringUtils.isNotEmpty(country)) { return country; } |