diff options
Diffstat (limited to 'main/src/cgeo/geocaching/export/GpxExport.java')
-rw-r--r-- | main/src/cgeo/geocaching/export/GpxExport.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java index 61d03bc..af564da 100644 --- a/main/src/cgeo/geocaching/export/GpxExport.java +++ b/main/src/cgeo/geocaching/export/GpxExport.java @@ -98,11 +98,7 @@ public class GpxExport extends AbstractExport { } private static String[] getGeocodes(final List<Geocache> caches) { - final ArrayList<String> allGeocodes = new ArrayList<>(caches.size()); - for (final Geocache geocache : caches) { - allGeocodes.add(geocache.getGeocode()); - } - return allGeocodes.toArray(new String[allGeocodes.size()]); + return Geocache.getGeocodes(caches).toArray(new String[caches.size()]); } protected class ExportTask extends AsyncTaskWithProgress<String, File> { @@ -121,8 +117,7 @@ public class GpxExport extends AbstractExport { private File getExportFile() { final SimpleDateFormat fileNameDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US); - final Date now = new Date(); - return FileUtils.getUniqueNamedFile(Settings.getGpxExportDir() + File.separatorChar + "export_" + fileNameDateFormat.format(now) + ".gpx"); + return FileUtils.getUniqueNamedFile(new File(Settings.getGpxExportDir(), "export_" + fileNameDateFormat.format(new Date()) + ".gpx")); } @Override @@ -156,7 +151,7 @@ public class GpxExport extends AbstractExport { if (writer != null) { try { writer.close(); - } catch (final IOException e1) { + } catch (final IOException ignored) { // Ignore double error } } |