Index: trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 14624)
@@ -237,4 +237,13 @@
         oldMapMode = map.mapMode;
         super.actionPerformed(e);
+    }
+
+    private static final class ConfirmOverwriteBookmarkDialog extends ExtendedDialog {
+        ConfirmOverwriteBookmarkDialog() {
+            super(MainApplication.getMainFrame(), tr("Overwrite"), new String[] {tr("Overwrite"), tr("Cancel")});
+            contentInsets = new Insets(10, 15, 10, 15);
+            setContent(tr("Offset bookmark already exists. Overwrite?"));
+            setButtonIcons("ok", "cancel");
+        }
     }
 
@@ -326,16 +335,5 @@
 
         private boolean confirmOverwriteBookmark() {
-            ExtendedDialog dialog = new ExtendedDialog(
-                    MainApplication.getMainFrame(),
-                    tr("Overwrite"),
-                    tr("Overwrite"), tr("Cancel")
-            ) { {
-                contentInsets = new Insets(10, 15, 10, 15);
-            } };
-            dialog.setContent(tr("Offset bookmark already exists. Overwrite?"));
-            dialog.setButtonIcons("ok", "cancel");
-            dialog.setupDialog();
-            dialog.setVisible(true);
-            return dialog.getValue() == 1;
+            return new ConfirmOverwriteBookmarkDialog().showDialog().getValue() == 1;
         }
 
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 14624)
@@ -327,23 +327,4 @@
         }
 
-        /**
-         * @param layerName the name of the new layer
-         * @deprecated Use {@link #createNewLayer(DataSet, Optional)}
-         * @return a newly constructed layer
-         */
-        @Deprecated
-        protected OsmDataLayer createNewLayer(final String layerName) {
-            return createNewLayer(Optional.ofNullable(layerName).filter(it -> !Utils.isStripEmpty(it)));
-        }
-
-        /**
-         * @deprecated Use {@link #createNewLayer(Optional)}
-         * @return a newly constructed layer
-         */
-        @Deprecated
-        protected OsmDataLayer createNewLayer() {
-            return createNewLayer(Optional.empty());
-        }
-
         protected Optional<ProjectionBounds> computeBbox(Bounds bounds) {
             BoundingXYVisitor v = new BoundingXYVisitor();
@@ -361,5 +342,5 @@
                 // the user explicitly wants a new layer, we don't have any layer at all
                 // or it is not clear which layer to merge to
-                final OsmDataLayer layer = createNewLayer(newLayerName);
+                final OsmDataLayer layer = createNewLayer(Optional.ofNullable(newLayerName).filter(it -> !Utils.isStripEmpty(it)));
                 MainApplication.getLayerManager().addLayer(layer, zoomAfterDownload);
                 return layer;
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 14624)
@@ -489,5 +489,6 @@
                 GpxData d = new GpxData();
                 d.addTrack(trk);
-                return new GpxLayer(d, ensureUniqueName(attrs, counts)); })
+                return new GpxLayer(d, ensureUniqueName(attrs, counts));
+            })
             .forEachOrdered(layer -> MainApplication.getLayerManager().addLayer(layer));
     }
@@ -509,5 +510,5 @@
      */
     public synchronized int getTrackSegsCount() {
-        return privateTracks.stream().collect(Collectors.summingInt(t -> t.getSegments().size()));
+        return privateTracks.stream().mapToInt(t -> t.getSegments().size()).sum();
     }
 
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14624)
@@ -27,5 +27,5 @@
  * @since 14205 (extracted from gui.layer.geoimage.ImageEntry)
  */
-public class GpxImageEntry implements Comparable<GpxImageEntry>, Cloneable {
+public class GpxImageEntry implements Comparable<GpxImageEntry> {
     private File file;
     private Integer exifOrientation;
@@ -73,4 +73,26 @@
 
     /**
+     * Constructs a new {@code GpxImageEntry} from an existing instance.
+     * @param other existing instance
+     * @since 14624
+     */
+    public GpxImageEntry(GpxImageEntry other) {
+        file = other.file;
+        exifOrientation = other.exifOrientation;
+        exifCoor = other.exifCoor;
+        exifImgDir = other.exifImgDir;
+        exifTime = other.exifTime;
+        isNewGpsData = other.isNewGpsData;
+        exifGpsTime = other.exifGpsTime;
+        pos = other.pos;
+        speed = other.speed;
+        elevation = other.elevation;
+        gpsTime = other.gpsTime;
+        width = other.width;
+        height = other.height;
+        tmp = other.tmp;
+    }
+
+    /**
      * Constructs a new {@code GpxImageEntry}.
      * @param file Path to image file on disk
@@ -311,13 +333,4 @@
     public void setExifImgDir(Double exifDir) {
         this.exifImgDir = exifDir;
-    }
-
-    @Override
-    public GpxImageEntry clone() {
-        try {
-            return (GpxImageEntry) super.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new IllegalStateException(e);
-        }
     }
 
@@ -370,5 +383,5 @@
      */
     public void createTmp() {
-        tmp = clone();
+        tmp = new GpxImageEntry(this);
         tmp.tmp = null;
     }
Index: trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java	(revision 14624)
@@ -78,5 +78,5 @@
      */
     public static ThreadPoolExecutor getNewThreadPoolExecutor(String nameFormat, int workers, int hostLimit) {
-        ThreadPoolExecutor executor = new ThreadPoolExecutor(
+        return new ThreadPoolExecutor(
                 workers, // keep core pool the same size as max, as we use unbounded queue so there will
                 workers, // be never more threads than corePoolSize
@@ -86,5 +86,4 @@
                 Utils.newThreadFactory(nameFormat, Thread.NORM_PRIORITY)
                 );
-        return executor;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java	(revision 14624)
@@ -10,5 +10,7 @@
 import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Platform;
@@ -74,12 +76,17 @@
     }
 
+    private static List<File> visit(String prefSuffix, String... defaults) {
+        return Config.getPref().getList("ntv2.proj4.grid.dir." + prefSuffix, Arrays.asList(defaults))
+                               .stream().map(File::new).collect(Collectors.toList());
+    }
+
     @Override
     public List<File> visitUnixoid() {
-        return Arrays.asList(new File("/usr/local/share/proj"), new File("/usr/share/proj"));
+        return visit("unix", "/usr/local/share/proj", "/usr/share/proj");
     }
 
     @Override
     public List<File> visitWindows() {
-        return Arrays.asList(new File("C:\\PROJ\\NAD"));
+        return visit("windows", "C:\\PROJ\\NAD");
     }
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 14624)
@@ -230,7 +230,5 @@
                     continue;
                 }
-                if (!s.highway && endnodesHighway.contains(en) && !s.w.concernsArea()) {
-                    map.put(en, s.w);
-                } else if (endnodes.contains(en) && !s.w.concernsArea()) {
+                if (((!s.highway && endnodesHighway.contains(en)) || endnodes.contains(en)) && !s.w.concernsArea()) {
                     map.put(en, s.w);
                 }
Index: trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java	(revision 14624)
@@ -358,5 +358,5 @@
                     for (PluginInformation pi4: toDeletePlugins) {
                         pls.remove(pi4.name);
-                        new File(Preferences.main().getPluginsDirectory(), pi4.name+".jar").deleteOnExit();
+                        Utils.deleteFile(new File(Preferences.main().getPluginsDirectory(), pi4.name+".jar"));
                     }
                     Config.getPref().putList("plugins", pls);
Index: trunk/src/org/openstreetmap/josm/io/OnlineResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OnlineResource.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/io/OnlineResource.java	(revision 14624)
@@ -41,6 +41,6 @@
      */
     public final void checkOfflineAccess(String downloadString, String resourceString) {
-        if (NetworkManager.isOffline(this) && downloadString.substring(downloadString.indexOf("://"))
-                .startsWith(resourceString.substring(resourceString.indexOf("://")))) {
+        if (NetworkManager.isOffline(this) && downloadString
+                .startsWith(resourceString.substring(resourceString.indexOf("://")), downloadString.indexOf("://"))) {
             throw new OfflineAccessException(tr("Unable to access ''{0}'': {1} not available (offline mode)", downloadString, getLocName()));
         }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 14623)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 14624)
@@ -10,5 +10,4 @@
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Locale;
 import java.util.Set;
 import java.util.concurrent.Future;
@@ -318,5 +317,5 @@
             for (String item : args.get("select").split(",")) {
                 if (!item.isEmpty()) {
-                    if (CURRENT_SELECTION.equals(item.toLowerCase(Locale.ENGLISH))) {
+                    if (CURRENT_SELECTION.equalsIgnoreCase(item)) {
                         isKeepingCurrentSelection = true;
                         continue;
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14623)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14624)
@@ -32,7 +32,7 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
@@ -128,6 +128,5 @@
             });
         } catch (Throwable e) {
-            // need to turn this *back* into an AssertionFailedError
-            fail(String.format("Failed to find menu item with label %s: %s", label, e));
+            throw new RuntimeException(String.format("Failed to find menu item with label %s: %s", label, e), e);
         }
     }
