Index: applications/editors/josm/plugins/photo_geotagging/build.xml
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/build.xml	(revision 35932)
+++ applications/editors/josm/plugins/photo_geotagging/build.xml	(revision 35933)
@@ -5,5 +5,5 @@
     <property name="commit.message" value=""/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="14153"/>
+    <property name="plugin.main.version" value="17715"/>
 
     <property name="plugin.author" value="Paul Hartmann"/>
Index: applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(revision 35932)
+++ applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(revision 35933)
@@ -9,4 +9,5 @@
 import java.io.IOException;
 import java.text.DecimalFormat;
+import java.time.Instant;
 import java.util.Calendar;
 import java.util.Date;
@@ -43,5 +44,5 @@
      * @throws IOException in case of I/O error
      */
-    public static void setExifGPSTag(File imageFile, File dst, double lat, double lon, Date gpsTime, Double speed, Double ele, Double imgDir, boolean lossy) throws IOException {
+    public static void setExifGPSTag(File imageFile, File dst, double lat, double lon, Instant gpsTime, Double speed, Double ele, Double imgDir, boolean lossy) throws IOException {
         try {
             setExifGPSTagWorker(imageFile, dst, lat, lon, gpsTime, speed, ele, imgDir, lossy);
@@ -53,5 +54,5 @@
     }
 
-    public static void setExifGPSTagWorker(File imageFile, File dst, double lat, double lon, Date gpsTime, Double speed, Double ele, Double imgDir, boolean lossy)
+    public static void setExifGPSTagWorker(File imageFile, File dst, double lat, double lon, Instant gpsTime, Double speed, Double ele, Double imgDir, boolean lossy)
             throws IOException, ImageReadException, ImageWriteException {
 
@@ -78,5 +79,5 @@
         if (gpsTime != null) {
             Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
-            calendar.setTime(gpsTime);
+            calendar.setTimeInMillis(gpsTime.toEpochMilli());
 
             final int year =   calendar.get(Calendar.YEAR);
Index: applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 35932)
+++ applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 35933)
@@ -15,4 +15,5 @@
 import java.nio.file.NoSuchFileException;
 import java.text.DecimalFormat;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Date;
@@ -56,5 +57,4 @@
 class GeotaggingAction extends AbstractAction implements LayerAction {
 
-    final static boolean debug = false;
     final static String KEEP_BACKUP = "plugins.photo_geotagging.keep_backup";
     final static String CHANGE_MTIME = "plugins.photo_geotagging.change-mtime";
@@ -169,7 +169,6 @@
         int result = new ExtendedDialog(
                 MainApplication.getMainFrame(),
-                tr("Photo Geotagging Plugin"),
-                new String[] {tr("OK"), tr("Cancel")})
-            .setButtonIcons(new String[] {"ok", "cancel"})
+                tr("Photo Geotagging Plugin"), tr("OK"), tr("Cancel"))
+            .setButtonIcons("ok", "cancel")
             .setContent(cont)
             .setCancelButton(2)
@@ -285,7 +284,5 @@
                     return exifFailedEntries;
                 ImageEntry e = entries.get(currentIndex);
-                if (debug) {
-                    System.err.print("i:" + currentIndex + " " + e.getFile().getName() + " ");
-                }
+                Logging.trace("photo_geotagging: GeotaggingAction: i: {0} {1} ", currentIndex, e.getFile().getName());
                 try {
                     processEntry(e, lossy);
@@ -336,7 +333,5 @@
                 progressMonitor.subTask(tr("Writing position information to image files... Estimated time left: {0}", timeLeft));
 
-                if (debug) {
-                    System.err.println("finished " + e.getFile());
-                }
+                Logging.trace("photo_geotagging: GeotaggingAction: finished {0}", e.getFile());
                 currentIndex++;
             }
@@ -353,15 +348,11 @@
             }
 
-            Long mTime = null;
+            Instant mTime = null;
             if (mTimeMode == MTIME_MODE_GPS) {
                 // check GPS time fields, do nothing if all fails
-                Date time;
                 if (e.hasGpsTime()) {
-                    time = e.getGpsTime();
-                } else {
-                    time = e.getExifGpsTime();
-                }
-                if (time != null) {
-                    mTime = time.getTime();
+                    mTime = e.getGpsInstant();
+                } else if (e.hasExifGpsTime()) {
+                    mTime = e.getExifGpsInstant();
                 }
             }
@@ -370,6 +361,6 @@
                  // modes failed to determine the modification time
                  || (mTimeMode != 0 && mTime == null)) {
-                mTime = e.getFile().lastModified();
-                if (mTime.equals(0L))
+                mTime = Instant.ofEpochMilli(e.getFile().lastModified());
+                if (Instant.EPOCH.equals(mTime))
                     throw new IOException(tr("Could not read mtime."));
             }
@@ -378,8 +369,8 @@
             if (canceled) return;
             ExifGPSTagger.setExifGPSTag(fileFrom, fileTo, e.getPos().lat(), e.getPos().lon(),
-                    e.getGpsTime(), e.getSpeed(), e.getElevation(), e.getExifImgDir(), lossy);
+                    e.getGpsInstant(), e.getSpeed(), e.getElevation(), e.getExifImgDir(), lossy);
 
             if (mTime != null) {
-                if (!fileTo.setLastModified(mTime))
+                if (!fileTo.setLastModified(mTime.toEpochMilli()))
                     throw new IOException(tr("Could not write mtime."));
             }
@@ -390,7 +381,5 @@
 
         private void chooseFiles(File file) throws IOException {
-            if (debug) {
-                System.err.println("f: "+file.getAbsolutePath());
-            }
+            Logging.trace("photo_geotagging: GeotaggingAction: f: "+file.getAbsolutePath());
 
             if (!keep_backup) {
@@ -432,7 +421,5 @@
                 fileTmp = new File(file.getParentFile(), "img" + UUID.randomUUID() + ".tmp");
             } while (fileTmp.exists());
-            if (debug) {
-                System.err.println("TMP: "+fileTmp.getAbsolutePath());
-            }
+            Logging.trace("photo_geotagging: GeotaggingAction: TMP: {0}", fileTmp.getAbsolutePath());
             try {
                 Files.move(file.toPath(), fileTmp.toPath());
@@ -455,7 +442,7 @@
                     int override = new ExtendedDialog(
                             progressMonitor.getWindowParent(),
-                            tr("Override old backup files?"),
-                            new String[] {tr("Cancel"), tr("Keep old backups and continue"), tr("Override")})
-                        .setButtonIcons(new String[] {"cancel", "ok", "dialogs/delete"})
+                            tr("Override old backup files?"), tr("Cancel"), tr("Keep old backups and continue"),
+                            tr("Override"))
+                        .setButtonIcons("cancel", "ok", "dialogs/delete")
                         .setContent(l)
                         .setCancelButton(1)
@@ -472,5 +459,5 @@
                 });
             } catch (Exception e) {
-                System.err.println(e);
+                Logging.error(e);
                 canceled = true;
             }
Index: applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(revision 35932)
+++ applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(revision 35933)
@@ -1,9 +1,11 @@
 package org.openstreetmap.josm.plugins.photo_geotagging;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.util.Date;
+import java.time.Instant;
 import java.util.Scanner;
 
@@ -13,35 +15,37 @@
 import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
 import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 import org.openstreetmap.josm.TestUtils;
 
-public class ExifGPSTaggerTest {
+class ExifGPSTaggerTest {
 
-    @Rule
-    public final TemporaryFolder tempFolder = new TemporaryFolder();
+    @TempDir
+    File tempFolder;
 
     @Test
-    public void testTicket11757() throws Exception {
+    void testTicket11757() {
         final File in = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg");
-        ExifGPSTagger.setExifGPSTag(in, tempFolder.newFile(), 12, 34, new Date(), 12.34, Math.E, Math.PI, true);
+        final File out = new File(tempFolder, in.getName());
+        assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, 12, 34, Instant.now(), 12.34, Math.E, Math.PI, true));
     }
 
     @Test
-    public void testTicket11757WriteWithoutChange() throws Exception {
+    void testTicket11757WriteWithoutChange() throws Exception {
         final File in = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg");
+        final long lastModified = in.lastModified();
         final TiffImageMetadata exif = ((JpegImageMetadata) Imaging.getMetadata(in)).getExif();
         final TiffOutputSet outputSet = exif.getOutputSet();
         new ExifRewriter().updateExifMetadataLossless(in, new ByteArrayOutputStream(), outputSet);
+        assertEquals(lastModified, in.lastModified());
     }
 
     @Test
-    @Ignore("To enable after https://josm.openstreetmap.de/ticket/11902 is fixed")
-    public void testTicket11902() throws Exception {
+    @Disabled("To enable after https://josm.openstreetmap.de/ticket/11902 is fixed")
+    void testTicket11902() throws Exception {
         final File in = new File(TestUtils.getTestDataRoot(), "IMG_7250_small.JPG");
-        final File out = tempFolder.newFile();
-        ExifGPSTagger.setExifGPSTag(in, out, 12, 34, new Date(), 12.34, Math.E, Math.PI, false);
+        final File out = new File(tempFolder, in.getName());
+        ExifGPSTagger.setExifGPSTag(in, out, 12, 34, Instant.now(), 12.34, Math.E, Math.PI, false);
         final Process jhead = Runtime.getRuntime().exec(new String[]{"jhead", out.getAbsolutePath()});
         final String stdout = new Scanner(jhead.getErrorStream()).useDelimiter("\\A").next();
Index: applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java
===================================================================
--- applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(revision 35932)
+++ applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(revision 35933)
@@ -1,6 +1,4 @@
 package org.openstreetmap.josm.plugins.photo_geotagging;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -11,5 +9,5 @@
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -17,8 +15,11 @@
 import org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingAction.GeoTaggingRunnable;
 
-public class GeotaggingActionTest {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class GeotaggingActionTest {
 
     @Test
-    public void testProcessEntries() throws IOException {
+    void testProcessEntries() throws IOException {
         File original = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg");
         assertTrue(original.exists());
