Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 14208)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 14209)
@@ -62,8 +62,8 @@
                 segs.sort(new Comparator<List<WayPoint>>() {
                     @Override
-                    public int compare(List<WayPoint> arg0, List<WayPoint> arg1) {
-                        if (arg0.isEmpty() || arg1.isEmpty() || arg0.get(0).time == arg1.get(0).time)
+                    public int compare(List<WayPoint> o1, List<WayPoint> o2) {
+                        if (o1.isEmpty() || o2.isEmpty())
                             return 0;
-                        return arg0.get(0).time < arg1.get(0).time ? -1 : 1;
+                        return Double.compare(o1.get(0).time, o2.get(0).time);
                     }
                 });
@@ -74,10 +74,9 @@
         trks.sort(new Comparator<List<List<WayPoint>>>() {
             @Override
-            public int compare(List<List<WayPoint>> arg0, List<List<WayPoint>> arg1) {
-                if (arg0.isEmpty() || arg0.get(0).isEmpty()
-                        || arg1.isEmpty() || arg1.get(0).isEmpty()
-                        || arg0.get(0).get(0).time == arg1.get(0).get(0).time)
+            public int compare(List<List<WayPoint>> o1, List<List<WayPoint>> o2) {
+                if (o1.isEmpty() || o1.get(0).isEmpty()
+                 || o2.isEmpty() || o2.get(0).isEmpty())
                     return 0;
-                return arg0.get(0).get(0).time < arg1.get(0).get(0).time ? -1 : 1;
+                return Double.compare(o1.get(0).get(0).time, o2.get(0).get(0).time);
             }
         });
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14208)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14209)
@@ -5,4 +5,5 @@
 import java.io.IOException;
 import java.util.Date;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.CachedLatLon;
@@ -332,4 +333,34 @@
     }
 
+    @Override
+    public int hashCode() {
+        return Objects.hash(height, width, isNewGpsData,
+            elevation, exifCoor, exifGpsTime, exifImgDir, exifOrientation, exifTime,
+            file, gpsTime, pos, speed, tmp);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null || getClass() != obj.getClass())
+            return false;
+        GpxImageEntry other = (GpxImageEntry) obj;
+        return height == other.height
+            && width == other.width
+            && isNewGpsData == other.isNewGpsData
+            && Objects.equals(elevation, other.elevation)
+            && Objects.equals(exifCoor, other.exifCoor)
+            && Objects.equals(exifGpsTime, other.exifGpsTime)
+            && Objects.equals(exifImgDir, other.exifImgDir)
+            && Objects.equals(exifOrientation, other.exifOrientation)
+            && Objects.equals(exifTime, other.exifTime)
+            && Objects.equals(file, other.file)
+            && Objects.equals(gpsTime, other.gpsTime)
+            && Objects.equals(pos, other.pos)
+            && Objects.equals(speed, other.speed)
+            && Objects.equals(tmp, other.tmp);
+    }
+
     /**
      * Make a fresh copy and save it in the temporary variable. Use
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14208)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14209)
@@ -111,10 +111,10 @@
 public class CorrelateGpxWithImages extends AbstractAction {
 
-    private static List<GpxData> loadedGpxData = new ArrayList<>();
+    private static final List<GpxData> loadedGpxData = new ArrayList<>();
 
     private final transient GeoImageLayer yLayer;
     private transient GpxTimezone timezone;
     private transient GpxTimeOffset delta;
-    private static boolean forceTags = false;
+    private static boolean forceTags;
 
     /**
