Index: .classpath
===================================================================
--- .classpath	(revision 36011)
+++ .classpath	(working copy)
@@ -10,7 +10,7 @@
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-GeoTools"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-jts"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-log4j"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-ejml"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: build.xml
===================================================================
--- build.xml	(revision 36011)
+++ build.xml	(working copy)
@@ -11,13 +11,12 @@
     <property name="plugin.description" value="Plugin for importing spatial referenced images"/>
     <property name="plugin.icon" value="images/layericon.png"/>
     <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/ImportImagePlugin"/>
-    <property name="plugin.requires" value="log4j;jts;ejml;geotools"/>
+    <property name="plugin.requires" value="jts;ejml;geotools"/>
     
     <!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
 
     <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
-        <include name="log4j.jar"/>
         <include name="jts.jar"/>
         <include name="ejml.jar"/>
         <include name="geotools.jar"/>
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(working copy)
@@ -18,7 +18,6 @@
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 
-import org.apache.log4j.Logger;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.geometry.Envelope2D;
 import org.geotools.image.ImageWorker;
@@ -48,8 +47,6 @@
  */
 public class ImageLayer extends Layer {
 
-    private Logger logger = Logger.getLogger(ImageLayer.class);
-
     private File imageFile;
 
     private BufferedImage image = null;
@@ -98,7 +95,8 @@
             coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(ProjectionRegistry.getProjection().toCode()));
 
         } catch (FactoryException e) {
-            logger.error("Error while creating GridCoverage:", e);
+            Logging.error("ImportImagePlugin ImageLayer: Error while creating GridCoverage: {0}", e);
+            Logging.error(e);
             throw new IOException(e.getMessage());
         } catch (Exception e) {
             if (e.getMessage().contains("No projection file found")) {
@@ -114,7 +112,7 @@
                     // CHECKSTYLE.ON: LineLength
                     val = ex.showDialog().getValue();
                     if (val == 3) {
-                        logger.debug("No projection and user declined un-projected use");
+                        Logging.debug("ImportImagePlugin ImageLayer: No projection and user declined un-projected use");
                         throw new LayerCreationCanceledException();
                     }
                 }
@@ -123,7 +121,7 @@
                     if (val == 1) {
                         src = PluginOperations.defaultSourceCRS;
                     } else {
-                        logger.debug("Passing through image un-projected.");
+                        Logging.debug("ImportImagePlugin ImageLayer: Passing through image un-projected.");
                         src = CRS.decode(ProjectionRegistry.getProjection().toCode());
                     }
                     // create a grid coverage from the image
@@ -133,16 +131,18 @@
                         coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(ProjectionRegistry.getProjection().toCode()));
                     }
                 } catch (Exception e1) {
-                    logger.error("Error while creating GridCoverage:", e1);
+                    Logging.error("ImportImagePlugin ImageLayer: Error while creating GridCoverage:");
+                    Logging.error(e1);
                     throw new IOException(e1);
                 }
             } else {
-                logger.error("Error while creating GridCoverage:", e);
+                Logging.error("ImportImagePlugin ImageLayer: Error while creating GridCoverage:");
+                Logging.error(e);
                 throw new IOException(e);
             }
 
         }
-        logger.debug("Coverage created: " + coverage);
+        Logging.debug("ImportImagePlugin ImageLayer: Coverage created: {0}", coverage);
 
         upperLeft = new EastNorth(coverage.getEnvelope2D().x,
                 coverage.getEnvelope2D().y + coverage.getEnvelope2D().height);
@@ -212,7 +212,7 @@
             double scaley = pixels4bbox_height / image.getHeight();
 
             if ((scalex > 10) || (scaley > 10)) {
-                logger.warn("Not drawing image - scale too big");
+                Logging.warn("ImportImagePlugin ImageLayer: Not drawing image - scale too big");
                 return;
             }
             g.scale(scalex, scaley);
@@ -226,7 +226,7 @@
             }
 
         } else {
-            logger.error("Error while dawing image: image == null or Graphics == null");
+            Logging.error("ImportImagePlugin ImageLayer: Error while drawing image: image == null or Graphics == null");
         }
     }
 
@@ -295,7 +295,7 @@
      * calculated by the new reference system.
      */
     void resample(CoordinateReferenceSystem refSys) throws IOException, NoSuchAuthorityCodeException, FactoryException {
-        logger.debug("resample");
+        Logging.debug("ImportImagePlugin ImageLayer: resample");
         GridCoverage2D coverage = PluginOperations.createGridFromFile(this.imageFile, refSys, true);
         coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(ProjectionRegistry.getProjection().toCode()));
         this.bbox = coverage.getEnvelope2D();
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(working copy)
@@ -9,7 +9,6 @@
 
 import javax.swing.JOptionPane;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.io.importexport.FileImporter;
@@ -24,8 +23,6 @@
  */
 public class ImportImageFileImporter extends FileImporter {
     
-    private Logger logger = Logger.getLogger(LoadImageAction.class);
-
     public ImportImageFileImporter() {
         super(new ExtensionFileFilter("tiff,tif,jpg,jpeg,bmp,png", "jpg", 
                 "Georeferenced image file [by ImportImage plugin] (*.jpg, *.jpeg, *.tif, *.tiff, *.png, *.bmp)"));
@@ -47,16 +44,17 @@
 
         for (File file: files) {
             if (file.isDirectory()) continue;
-            ImageLayer layer = null;
-            logger.info("File choosen:" + file);
+            ImageLayer layer;
+            Logging.info("ImportImageFileImporter: File chosen: {0}", file);
             try {
                 layer = new ImageLayer(file);
             } catch (LayerCreationCanceledException e) {
+                Logging.trace(e);
                 // if user decides that layer should not be created just return.
                 continue;
             } catch (Exception e) {
+                Logging.error("ImportImageFileImporter: Error while creating image layer: \n{0}", e.getMessage());
                 Logging.error(e);
-                logger.error("Error while creating image layer: \n" + e.getMessage());
                 GuiHelper.runInEDT(() ->
                     JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error while creating image layer: {0}", e.getCause())));
                 continue;
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(working copy)
@@ -1,16 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.swing.JMenu;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.Preferences;
@@ -18,23 +8,30 @@
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+
 /**
  * Plugin class.
  * Provides basic routines for plugin installation and provides the plugin properties.
  *
- *
  * @author Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny
  *
  */
 public class ImportImagePlugin extends Plugin {
 
-    private static Logger logger;
+    JosmAction loadFileAction;
 
-    JMenu mainmenu = null;
-    JosmAction loadFileAction = null;
-
     // plugin properties
     static Properties pluginProps;
 
@@ -43,7 +40,6 @@
     static final String PLUGINPROPERTIES_FILENAME = "pluginProperties.properties";
     static final String PLUGINPROPERTIES_PATH = PLUGIN_DIR + PLUGINPROPERTIES_FILENAME;
     static final String PLUGINLIBRARIES_DIR = PLUGIN_DIR + "lib/";
-    static final String LOGGING_PROPERTIES_FILEPATH = PLUGIN_DIR + "log4j.properties/";
 
     /**
      * Returns Import image plugin properties.
@@ -63,18 +59,11 @@
         super(info);
 
         try {
-            // Initialize logger
-            initializeLogger();
-
             // Check whether plugin has already been installed. Otherwise install
             checkInstallation();
 
             // If resources are available load properties from plugin directory
-            if (pluginProps == null || pluginProps.isEmpty()) {
-                pluginProps = new Properties();
-                pluginProps.load(new File(PLUGINPROPERTIES_PATH).toURI().toURL().openStream());
-                logger.debug("Plugin properties loaded");
-            }
+            loadPluginProps();
 
             // load information about supported reference systems
             PluginOperations.loadCRSData(pluginProps);
@@ -87,22 +76,46 @@
             ExtensionFileFilter.addImporter(new ImportImageFileImporter());
 
         } catch (IOException e) {
-            logger.fatal("Error while loading plugin", e);
-            throw e;
+            throw new JosmRuntimeException(e);
         }
     }
 
+    private static void loadPluginProps() throws IOException {
+        if (pluginProps == null || pluginProps.isEmpty()) {
+            pluginProps = new Properties();
+            try (InputStream stream = Files.newInputStream(Paths.get(PLUGINPROPERTIES_PATH))) {
+                pluginProps.load(stream);
+            }
+            Logging.debug("ImportImagePlugin: Plugin properties loaded");
+        }
+    }
+
+    private static void writePluginPropsToFileAndLoad() throws IOException {
+        if (pluginProps == null || pluginProps.isEmpty()) {
+            try (BufferedWriter fw = Files.newBufferedWriter(Paths.get(PLUGINPROPERTIES_PATH))) {
+                URL propertiesURL = ImportImagePlugin.class.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
+                if (propertiesURL != null) {
+                    pluginProps = new Properties();
+                    try (InputStream stream = propertiesURL.openStream()) {
+                        pluginProps.load(stream);
+                    }
+                    pluginProps.store(fw, null);
+                }
+
+            }
+            Logging.debug("ImportImagePlugin: Plugin properties loaded");
+        }
+    }
+
     /**
      * Checks whether plugin resources are available.
      * If not, start install procedure.
      */
-    private void checkInstallation() throws IOException {
+    private static void checkInstallation() throws IOException {
         // check plugin resource state
-        boolean isInstalled = true;
-        if (!new File(PLUGINPROPERTIES_PATH).exists()
-                || !new File(PLUGIN_DIR).exists()
-                || !new File(PLUGINLIBRARIES_DIR).exists())
-            isInstalled = false;
+        boolean isInstalled = new File(PLUGINPROPERTIES_PATH).exists()
+                && new File(PLUGIN_DIR).exists()
+                && new File(PLUGINLIBRARIES_DIR).exists();
 
 
         // if properties file doesn't exist, install plugin
@@ -123,74 +136,9 @@
             }
 
             // create local properties file
-            if (pluginProps == null || pluginProps.isEmpty()) {
-                try (FileWriter fw = new FileWriter(new File(PLUGINPROPERTIES_PATH))) {
-                    URL propertiesURL = getClass().getResource("resources/" + PLUGINPROPERTIES_FILENAME);
-                    if (propertiesURL != null) {
-                        pluginProps = new Properties();
-                        pluginProps.load(propertiesURL.openStream());
-                        pluginProps.store(fw, null);
-                    }
-                }
-                logger.debug("Plugin properties loaded");
-            }
+            writePluginPropsToFileAndLoad();
 
-            if (!new File(LOGGING_PROPERTIES_FILEPATH).exists()) {
-                try (FileWriter fw = new FileWriter(new File(LOGGING_PROPERTIES_FILEPATH))) {
-                    URL propertiesURL = getClass().getResource("resources/log4j.properties");
-                    if (propertiesURL != null) {
-                        Properties loggingProps = new Properties();
-                        loggingProps.load(propertiesURL.openStream());
-                        loggingProps.store(fw, null);
-                    }
-                }
-                logger.debug("Logging properties created");
-            }
-
-            logger.debug("Plugin successfully installed");
+            Logging.debug("ImportImagePlugin: Plugin successfully installed");
         }
     }
-
-    /**
-     * Initialize logger.
-     */
-    private void initializeLogger() {
-
-        Properties props = new Properties();
-        try {
-            props.load(new File(LOGGING_PROPERTIES_FILEPATH).toURI().toURL().openStream());
-
-            // Set file for logging here:
-            props.setProperty("log4j.appender.MyRoFiAppender.file",
-                    (Preferences.main().getPluginsDirectory().getAbsolutePath() + "/ImportImagePlugin/" + "log.log"));
-
-            PropertyConfigurator.configure(props);
-
-            logger = Logger.getLogger(ImportImagePlugin.class);
-
-            logger.info("Logger successfully initialized.");
-
-            return;
-
-        } catch (IOException e) {
-            System.out.println("Logging properties file not found. Using standard settings.");
-        }
-
-        // if no log4j.properties file can be found, initialize manually:
-
-        props.setProperty("log4j.rootLogger", "INFO, A");
-        props.setProperty("log4j.appender.A", "org.apache.log4j.FileAppender");
-
-        props.setProperty("log4j.appender.A.layout",
-                "org.apache.log4j.PatternLayout ");
-        props.setProperty("log4j.appender.A.layout.ConversionPattern",
-                "%d{ISO8601} %-5p [%t] %c: %m%n");
-
-        // Set file for logging here:
-        props.setProperty("log4j.appender.A.file",
-                (Preferences.main().getPluginsDirectory().getAbsolutePath() + "/ImportImagePlugin/" + "log.log"));
-
-        PropertyConfigurator.configure(props);
-        logger = Logger.getLogger(ImportImagePlugin.class);
-    }
 }
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(working copy)
@@ -1,19 +1,10 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Rectangle;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Vector;
+import org.geotools.referencing.CRS;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.openstreetmap.josm.tools.Logging;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -28,70 +19,54 @@
 import javax.swing.SwingConstants;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Rectangle;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
 
-import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.openstreetmap.josm.tools.Logging;
-
 /**
  * UI-Dialog which provides:
  * - general and spatial information about the georeferenced image
- * - a possiblitly to change the source reference system of the image
+ * - a possibility to change the source reference system of the image
  *
- *
  * @author Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny
  *
  */
 public class LayerPropertiesDialog extends JFrame {
 
-    private Vector<String> supportedCRS;
+    private final List<String> supportedCRS;
     private ImageLayer imageLayer;
 
-    private JPanel mainPanel = null;
-    private JPanel jPanel = null;
-    private JPanel buttonPanel = null;
-    private JTabbedPane jTabbedPane = null;
-    private JPanel infoPanel = null;
-    private JPanel crsPanel = null;
-    private JButton okButton = null;
-    private JLabel layerNameLabel = null;
-    private JLabel layerNameValueLabel = null;
-    private JLabel imageFileLabel = null;
-    private JLabel imageFileValueLabel = null;
-    private JLabel sizeLabel = null;
-    private JLabel sizeValueLabel = null;
-    private JLabel crsLabel = null;
-    private JLabel crsValueLabel = null;
-    private JLabel extentLabel = null;
-    private JLabel defaultCRSDescriptorLabel = null;
-    private JLabel defaultCRSLabel = null;
-    private JTextField searchField = null;
-    private JScrollPane crsListScrollPane = null;
-    private JList<String> crsJList = null;
-    private JButton useDefaultCRSButton = null;
-    private JButton applySelectedCRSButton = null;
-    private JButton setSelectedCRSAsDefaultButton = null;
-    private JLabel searchFieldLabel = null;
-    private JCheckBox eastingFirstCheckBox = null;
-    private JLabel eastingFirstLabel = null;
-    private JLabel tabDescriptionLabel = null;
-    private JLabel upperLeftLabel = null;
-    private JLabel lowerLeftLabel = null;
-    private JLabel upperRightLabel = null;
-    private JLabel lowerRightLabel = null;
-    private JLabel upperLeftValueLabel = null;
-    private JLabel upperRightValueLabel = null;
-    private JLabel lowerLeftValueLabel = null;
-    private JLabel lowerRightValueLabel = null;
-    private JLabel currentCRSLabel = null;
-    private JLabel currentCRSValueLabel = null;
+    private JPanel mainPanel;
+    private JPanel jPanel;
+    private JPanel buttonPanel;
+    private JTabbedPane jTabbedPane;
+    private JPanel infoPanel;
+    private JPanel crsPanel;
+    private JButton okButton;
+    private JLabel defaultCRSLabel;
+    private JTextField searchField;
+    private JScrollPane crsListScrollPane;
+    private JList<String> crsJList;
+    private JButton useDefaultCRSButton;
+    private JButton applySelectedCRSButton;
+    private JButton setSelectedCRSAsDefaultButton;
+    private JCheckBox eastingFirstCheckBox;
 
     /**
      * This method initializes
      *
      */
-    public LayerPropertiesDialog(ImageLayer imageLayer, Vector<String> supportedCRS) {
+    public LayerPropertiesDialog(ImageLayer imageLayer, List<String> supportedCRS) {
         super(imageLayer.getName());
         this.supportedCRS = supportedCRS;
         this.imageLayer = imageLayer;
@@ -102,7 +77,7 @@
      * This method initializes
      *
      */
-    public LayerPropertiesDialog(Vector<String> supportedCRS) {
+    public LayerPropertiesDialog(List<String> supportedCRS) {
         super();
         this.supportedCRS = supportedCRS;
         initialize();
@@ -190,41 +165,41 @@
      */
     private JPanel getInfoPanel() {
         if (infoPanel == null) {
-            lowerRightValueLabel = new JLabel();
+            JLabel lowerRightValueLabel = new JLabel();
             lowerRightValueLabel.setBounds(new Rectangle(210, 315, 134, 16));
             lowerRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
             lowerRightValueLabel.setText((float) imageLayer.getBbox().getMinX() + ", " + (float) imageLayer.getBbox().getMaxY());
-            lowerLeftValueLabel = new JLabel();
+            JLabel lowerLeftValueLabel = new JLabel();
             lowerLeftValueLabel.setBounds(new Rectangle(30, 315, 133, 16));
             lowerLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
             lowerLeftValueLabel.setText((float) imageLayer.getBbox().getMinX() + ", " + (float) imageLayer.getBbox().getMinY());
-            upperRightValueLabel = new JLabel();
+            JLabel upperRightValueLabel = new JLabel();
             upperRightValueLabel.setBounds(new Rectangle(210, 255, 138, 16));
             upperRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
             upperRightValueLabel.setText((float) imageLayer.getBbox().getMaxX() + ", " + (float) imageLayer.getBbox().getMaxY());
-            upperLeftValueLabel = new JLabel();
+            JLabel upperLeftValueLabel = new JLabel();
             upperLeftValueLabel.setBounds(new Rectangle(30, 255, 133, 16));
             upperLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
             upperLeftValueLabel.setText((float) imageLayer.getBbox().getMaxX() + ", " + (float) imageLayer.getBbox().getMinY());
-            lowerRightLabel = new JLabel();
+            JLabel lowerRightLabel = new JLabel();
             lowerRightLabel.setBounds(new Rectangle(287, 344, 74, 16));
             lowerRightLabel.setText("Lower Right");
-            upperRightLabel = new JLabel();
+            JLabel upperRightLabel = new JLabel();
             upperRightLabel.setBounds(new Rectangle(285, 225, 91, 16));
             upperRightLabel.setText("Upper Right");
-            lowerLeftLabel = new JLabel();
+            JLabel lowerLeftLabel = new JLabel();
             lowerLeftLabel.setBounds(new Rectangle(15, 345, 92, 16));
             lowerLeftLabel.setText("Lower Left");
-            upperLeftLabel = new JLabel();
+            JLabel upperLeftLabel = new JLabel();
             upperLeftLabel.setBounds(new Rectangle(15, 224, 91, 16));
             upperLeftLabel.setText("Upper Left");
-            extentLabel = new JLabel();
+            JLabel extentLabel = new JLabel();
             extentLabel.setBounds(new Rectangle(120, 195, 136, 16));
             extentLabel.setEnabled(false);
             extentLabel.setHorizontalAlignment(SwingConstants.CENTER);
             extentLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
             extentLabel.setText("Extent");
-            crsValueLabel = new JLabel();
+            JLabel crsValueLabel = new JLabel();
             crsValueLabel.setBounds(new Rectangle(150, 150, 226, 16));
 
             String crsDescription = "";
@@ -235,26 +210,26 @@
             }
             crsValueLabel.setText(crsDescription + "(" + imageLayer.getBbox().getCoordinateReferenceSystem().getName().toString() + ")");
 
-            crsLabel = new JLabel();
+            JLabel crsLabel = new JLabel();
             crsLabel.setBounds(new Rectangle(15, 150, 118, 16));
             crsLabel.setText("Reference System");
-            sizeValueLabel = new JLabel();
+            JLabel sizeValueLabel = new JLabel();
             sizeValueLabel.setBounds(new Rectangle(150, 105, 226, 16));
             sizeValueLabel.setText(imageLayer.getImage().getHeight() + " x " + imageLayer.getImage().getWidth());
-            sizeLabel = new JLabel();
+            JLabel sizeLabel = new JLabel();
             sizeLabel.setBounds(new Rectangle(15, 105, 121, 16));
             sizeLabel.setText("Image size");
-            imageFileValueLabel = new JLabel();
+            JLabel imageFileValueLabel = new JLabel();
             imageFileValueLabel.setBounds(new Rectangle(150, 60, 226, 16));
             imageFileValueLabel.setText(imageLayer.getImageFile().getAbsolutePath());
             imageFileValueLabel.setToolTipText(imageLayer.getImageFile().getAbsolutePath());
-            imageFileLabel = new JLabel();
+            JLabel imageFileLabel = new JLabel();
             imageFileLabel.setBounds(new Rectangle(15, 60, 121, 16));
             imageFileLabel.setText("Image file");
-            layerNameValueLabel = new JLabel();
+            JLabel layerNameValueLabel = new JLabel();
             layerNameValueLabel.setBounds(new Rectangle(150, 15, 226, 16));
             layerNameValueLabel.setText(imageLayer.getName());
-            layerNameLabel = new JLabel();
+            JLabel layerNameLabel = new JLabel();
             layerNameLabel.setBounds(new Rectangle(15, 15, 121, 16));
             layerNameLabel.setText("Layer name");
             infoPanel = new JPanel();
@@ -288,7 +263,7 @@
      */
     private JPanel getCrsPanel() {
         if (crsPanel == null) {
-            currentCRSValueLabel = new JLabel();
+            JLabel currentCRSValueLabel = new JLabel();
             currentCRSValueLabel.setBounds(new Rectangle(78, 33, 297, 16));
             String crsDescription = "unknown";
             try {
@@ -298,18 +273,18 @@
             }
             currentCRSValueLabel.setText(crsDescription);
 
-            currentCRSLabel = new JLabel();
+            JLabel currentCRSLabel = new JLabel();
             currentCRSLabel.setBounds(new Rectangle(15, 33, 52, 16));
             currentCRSLabel.setText("Current:");
-            tabDescriptionLabel = new JLabel();
+            JLabel tabDescriptionLabel = new JLabel();
             tabDescriptionLabel.setBounds(new Rectangle(15, 9, 361, 16));
             tabDescriptionLabel.setText("Set here the source reference system of the image");
-            eastingFirstLabel = new JLabel();
+            JLabel eastingFirstLabel = new JLabel();
             eastingFirstLabel.setBounds(new Rectangle(315, 210, 76, 46));
             eastingFirstLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
             eastingFirstLabel.setHorizontalAlignment(SwingConstants.CENTER);
             eastingFirstLabel.setText("<html>Easting<br>first</html>");
-            searchFieldLabel = new JLabel();
+            JLabel searchFieldLabel = new JLabel();
             searchFieldLabel.setBounds(new Rectangle(298, 114, 84, 16));
             searchFieldLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
             searchFieldLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
@@ -318,7 +293,7 @@
             defaultCRSLabel = new JLabel();
             defaultCRSLabel.setBounds(new Rectangle(15, 89, 361, 16));
             defaultCRSLabel.setText(PluginOperations.defaultSourceCRSDescription);
-            defaultCRSDescriptorLabel = new JLabel();
+            JLabel defaultCRSDescriptorLabel = new JLabel();
             defaultCRSDescriptorLabel.setBounds(new Rectangle(15, 63, 226, 16));
             defaultCRSDescriptorLabel.setText("Default Reference System:");
             crsPanel = new JPanel();
@@ -372,8 +347,7 @@
                 @Override
                 public void keyTyped(KeyEvent e) {
 
-                    for (Iterator<String> iterator = supportedCRS.iterator(); iterator.hasNext();) {
-                        String type = iterator.next();
+                    for (String type : supportedCRS) {
                         if (type.contains(searchField.getText())) {
                             crsJList.setSelectedIndex(supportedCRS.indexOf(type));
                             crsJList.ensureIndexIsVisible(supportedCRS.indexOf(type));
@@ -408,7 +382,7 @@
      */
     private JList<String> getCrsJList() {
         if (crsJList == null) {
-            crsJList = new JList<>(supportedCRS);
+            crsJList = new JList<>(supportedCRS.toArray(new String[0]));
             crsJList.addListSelectionListener(new ListSelectionHandler());
         }
         return crsJList;
@@ -496,7 +470,7 @@
                                 ImportImagePlugin.pluginProps.setProperty("default_crs_eastingfirst", 
                                         "" + eastingFirstCheckBox.isSelected());
                                 ImportImagePlugin.pluginProps.setProperty("default_crs_srid", code);
-                                try (FileWriter fileWriter = new FileWriter(new File(ImportImagePlugin.PLUGINPROPERTIES_PATH))) {
+                                try (BufferedWriter fileWriter = Files.newBufferedWriter(Paths.get(ImportImagePlugin.PLUGINPROPERTIES_PATH))) {
                                     ImportImagePlugin.pluginProps.store(fileWriter, null);
                                 }
 
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(working copy)
@@ -9,12 +9,12 @@
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
  * Class extends JosmAction and creates a new image layer.
@@ -24,8 +24,6 @@
  */
 public class LoadImageAction extends JosmAction {
 
-    private Logger logger = Logger.getLogger(LoadImageAction.class);
-
     /**
      * Constructor...
      */
@@ -41,17 +39,18 @@
         fc.setAcceptAllFileFilterUsed(false);
         int result = fc.showOpenDialog(MainApplication.getMainFrame());
 
-        ImageLayer layer = null;
+        ImageLayer layer;
         if (result == JFileChooser.APPROVE_OPTION) {
             Config.getPref().put("plugins.importimage.importpath", fc.getCurrentDirectory().getAbsolutePath());
-            logger.info("File chosen:" + fc.getSelectedFile());
+            Logging.info("ImportImagePlugin LoadImageAction: File chosen: {0}", fc.getSelectedFile());
             try {
                 layer = new ImageLayer(fc.getSelectedFile());
             } catch (LayerCreationCanceledException e) {
+                Logging.trace(e);
                 // if user decides that layer should not be created just return.
                 return;
             } catch (Exception e) {
-                logger.error("Error while creating image layer: \n" + e.getMessage());
+                Logging.error("ImportImagePlugin LoadImageAction: Error while creating image layer: \n{0}", e.getMessage());
                 JOptionPane.showMessageDialog(null, marktr("Error while creating image layer: " + e.getCause()));
                 return;
             }
Index: src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
===================================================================
--- src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 36011)
+++ src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(working copy)
@@ -1,22 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.imageio.ImageIO;
-
-import org.apache.log4j.Logger;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridCoverageFactory;
 import org.geotools.coverage.processing.CoverageProcessor;
@@ -28,11 +12,25 @@
 import org.geotools.util.factory.Hints;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.util.InternationalString;
+import org.openstreetmap.josm.tools.Logging;
 
+import javax.imageio.ImageIO;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Vector;
+
 /**
  * Class provides methods for resampling operations, IO and stores important data.
  *
@@ -41,10 +39,8 @@
  */
 public final class PluginOperations {
 
-    private static final Logger logger = Logger.getLogger(PluginOperations.class);
-
     // contains descriptions of all available CRS
-    static Vector<String> crsDescriptions;
+    static List<String> crsDescriptions;
 
     // the standard native CRS of user images
     static CoordinateReferenceSystem defaultSourceCRS;
@@ -67,11 +63,11 @@
      * Reprojects a GridCoverage to a given CRS.
      */
     public static GridCoverage2D reprojectCoverage(GridCoverage2D coverage,
-            CoordinateReferenceSystem targetCrs) throws NoSuchAuthorityCodeException, FactoryException {
+            CoordinateReferenceSystem targetCrs) {
 
         // TODO: add category for NO_DATA values in coverage (transparency in image)
 
-        GridCoverage2D destination = null;
+        GridCoverage2D destination;
 
         CoverageProcessor processor = new CoverageProcessor();
         ParameterValueGroup resampleParams = processor.getOperation("Resample").getParameters();
@@ -87,22 +83,27 @@
     }
 
     /**
-     * Creates a org.geotools.coverage.grid.GridCoverage2D from a given file.
+     * Creates a {@link GridCoverage2D} from a given file.
+     * @param file The file to read from
+     * @param refSys The reference system to use
+     * @param failIfNoPrjFile {@code true} if we need to fail if no projection file is found
+     * @throws IOException if the file could not be read
+     * @return The 2d grid coverage of the file
      */
     public static GridCoverage2D createGridFromFile(File file, CoordinateReferenceSystem refSys, boolean failIfNoPrjFile) throws IOException {
 
-        GridCoverage2D coverage = null;
+        GridCoverage2D coverage;
 
         if (!file.exists()) throw new FileNotFoundException("File not found.");
 
-        String extension = null;
-        String fileNameWithoutExt = null;
+        String extension;
+        String fileNameWithoutExt;
         int dotPos = file.getAbsolutePath().lastIndexOf(".");
         extension = file.getAbsolutePath().substring(dotPos);
         fileNameWithoutExt = file.getAbsolutePath().substring(0, dotPos);
 
         /*------- switch for file type -----------*/
-        if (extension.equalsIgnoreCase(".tif") || extension.equalsIgnoreCase(".tiff")) {
+        if (".tif".equalsIgnoreCase(extension) || ".tiff".equalsIgnoreCase(extension)) {
 
             // try to read GeoTIFF:
             try {
@@ -110,11 +111,10 @@
                 return coverage;
             } catch (DataSourceException dse) {
                 if (!dse.getMessage().contains("Coordinate Reference System is not available")) {
-                    dse.printStackTrace();
+                    Logging.error(dse);
+                } else {
+                    Logging.trace(dse);
                 }
-            } catch (FactoryException facte) {
-                logger.fatal("Error while reading from GeoTIFF:", facte);
-                throw new IOException(facte);
             }
 
             // file is no GeoTiff, searching for Worldfile and projection file:
@@ -121,8 +121,8 @@
             String[] postfixes = {"wld", "tfw", "tifw"};
             // try to read Worldfile:
             WorldFileReader tfwReader = null;
-            for (int i = 0; i < postfixes.length; i++) {
-                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+            for (String postfix : postfixes) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfix);
                 if (prjFile.exists()) {
                     tfwReader = new WorldFileReader(prjFile);
                 }
@@ -137,7 +137,7 @@
                 refSys = readPrjFile(file);
                 if (refSys == null) {
                     if (failIfNoPrjFile) throw new IOException("No projection file found.");
-                    logger.debug("no projection given, no projection file found; using unprojected file.");
+                    Logging.debug("no projection given, no projection file found; using unprojected file.");
                 }
             }
 
@@ -154,13 +154,13 @@
             Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
             coverage = createGridCoverage(img, bbox, refSys);
 
-        } else if (extension.equalsIgnoreCase(".jpg")
-                || extension.equalsIgnoreCase(".jpeg")) {
+        } else if (".jpg".equalsIgnoreCase(extension)
+                || ".jpeg".equalsIgnoreCase(extension)) {
             String[] postfixes = {"wld", "jgw", "jpgw"};
             // try to read Worldfile:
             WorldFileReader tfwReader = null;
-            for (int i = 0; i < postfixes.length; i++) {
-                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+            for (String postfix : postfixes) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfix);
                 if (prjFile.exists()) {
                     tfwReader = new WorldFileReader(prjFile);
                 }
@@ -172,7 +172,7 @@
                 refSys = readPrjFile(file);
                 if (refSys == null) {
                     if (failIfNoPrjFile) throw new IOException("No projection file found.");
-                    logger.debug("no projection given, no projection file found; using unprojected file.");
+                    Logging.debug("no projection given, no projection file found; using unprojected file.");
                 }
             }
 
@@ -186,12 +186,12 @@
             Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
             coverage = createGridCoverage(img, bbox, refSys);
 
-        } else if (extension.equalsIgnoreCase(".bmp")) {
+        } else if (".bmp".equalsIgnoreCase(extension)) {
             String[] postfixes = {"wld", "bmpw", "bpw"};
             // try to read Worldfile:
             WorldFileReader tfwReader = null;
-            for (int i = 0; i < postfixes.length; i++) {
-                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+            for (String postfix : postfixes) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfix);
                 if (prjFile.exists()) {
                     tfwReader = new WorldFileReader(prjFile);
                 }
@@ -203,7 +203,7 @@
                 refSys = readPrjFile(file);
                 if (refSys == null) {
                     if (failIfNoPrjFile) throw new IOException("No projection file found.");
-                    logger.debug("no projection given, no projection file found; using unprojected file.");
+                    Logging.debug("no projection given, no projection file found; using unprojected file.");
                 }
             }
 
@@ -217,13 +217,13 @@
             Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
             coverage = createGridCoverage(img, bbox, refSys);
 
-        } else if (extension.equalsIgnoreCase(".png")) {
+        } else if (".png".equalsIgnoreCase(extension)) {
 
             String[] postfixes = {"wld", "pgw", "pngw"};
             // try to read Worldfile:
             WorldFileReader tfwReader = null;
-            for (int i = 0; i < postfixes.length; i++) {
-                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+            for (String postfix : postfixes) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfix);
                 if (prjFile.exists()) {
                     tfwReader = new WorldFileReader(prjFile);
                 }
@@ -235,7 +235,7 @@
                 refSys = readPrjFile(file);
                 if (refSys == null) {
                     if (failIfNoPrjFile) throw new IOException("No projection file found.");
-                    logger.debug("no projection given, no projection file found; using unprojected file.");
+                    Logging.debug("no projection given, no projection file found; using unprojected file.");
                 }
             }
 
@@ -264,25 +264,25 @@
      * @param file image file, not the real world file (will be searched)
      */
     public static CoordinateReferenceSystem readPrjFile(File file) throws IOException {
-        CoordinateReferenceSystem refSys = null;
+        CoordinateReferenceSystem refSys;
 
-        String prjFilename = null;
+        String prjFilename;
         int dotPos = file.getAbsolutePath().lastIndexOf(".");
         prjFilename = file.getAbsolutePath().substring(0, dotPos) + ".prj";
 
         File prjFile = new File(prjFilename);
         if (!prjFile.exists()) return null;
-        logger.debug("Loading .prj file: " + prjFile.getAbsolutePath());
+        Logging.debug("Loading .prj file: " + prjFile.getAbsolutePath());
 
-        try (BufferedReader br = new BufferedReader(new FileReader(prjFile))) {
+        try (BufferedReader br = Files.newBufferedReader(prjFile.toPath())) {
             StringBuilder sb = new StringBuilder();
-            String content = null;
+            String content;
             while ((content = br.readLine()) != null) {
                 sb.append(content);
             }
             refSys = CRS.parseWKT(sb.toString().trim());
         } catch (FactoryException e) {
-            throw new IOException("Unable to parse prj-file: '" + prjFile.getName() + "'");
+            throw new IOException("Unable to parse prj-file: '" + prjFile.getName() + "'", e);
         }
 
         return refSys;
@@ -301,8 +301,8 @@
      *
      * @param refSys if delivered, the coverage will be forced to use this crs
      */
-    public static GridCoverage2D readGeoTiff(File file, CoordinateReferenceSystem refSys) throws IOException, FactoryException {
-        GridCoverage2D coverage = null;
+    public static GridCoverage2D readGeoTiff(File file, CoordinateReferenceSystem refSys) throws IOException {
+        GridCoverage2D coverage;
         Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, true);
         if (refSys != null) {
             hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys);
@@ -327,8 +327,7 @@
         Set<String> supportedCodes = CRS.getSupportedCodes("EPSG");
         CRSAuthorityFactory fac = CRS.getAuthorityFactory(false);
 
-        for (Iterator<String> iterator = supportedCodes.iterator(); iterator.hasNext();) {
-            String string = iterator.next();
+        for (String string : supportedCodes) {
             try {
                 if ("WGS84(DD)".equals(string)) {
                     continue;
@@ -337,13 +336,14 @@
                 String description = desc.toString() + " [-EPSG:" + string + "-]";
                 crsDescriptions.add(description);
                 if (defaultcrsString != null && defaultcrsString.equalsIgnoreCase("EPSG:" + string)) {
-                    boolean isEastingFirst = Boolean.valueOf(pluginProps.getProperty("default_crs_eastingfirst"));
+                    boolean isEastingFirst = Boolean.parseBoolean(pluginProps.getProperty("default_crs_eastingfirst"));
                     defaultSourceCRS = CRS.decode("EPSG:" + string, isEastingFirst);
                     defaultSourceCRSDescription = description;
                 }
 
             } catch (FactoryException e) {
-                logger.error("Error while loading EPSG data: " + e.getMessage());
+                Logging.error("Error while loading EPSG data: " + e.getMessage());
+                Logging.error(e);
             }
         }
     }
Index: test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(revision 36011)
+++ test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(working copy)
@@ -1,8 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import static org.junit.Assert.assertNotNull;
-
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.DirectoryIteratorException;
@@ -14,26 +12,23 @@
 import java.util.Collection;
 
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.TestUtils;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.Logging;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 /**
  * Test that some geotiff sample files can be read.
  * Data downloaded from <a href="ftp://ftp.remotesensing.org/pub/geotiff/samples">remotesensing.org</a>.
  */
-public class GeoTiffReaderTest {
-
-    /**
-     * Setup test.
-     */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(20000);
-
+@BasicPreferences
+@Timeout(20)
+class GeoTiffReaderTest {
     @Test
-    public void testReadGeoTiffFiles() throws IOException {
+    void testReadGeoTiffFiles() throws IOException {
         for (Path p : listDataFiles("tif")) {
             File file = p.toFile();
             Logging.info("Testing reading file "+file.getPath());
@@ -45,7 +40,7 @@
     /**
      * Lists all datasets files matching given extension.
      * @param ext file extension to search for
-     * @returns List of all datasets files matching given extension
+     * @return List of all datasets files matching given extension
      * @throws IOException in case of I/O error
      */
     public static Collection<Path> listDataFiles(String ext) throws IOException {
Index: test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java	(revision 36011)
+++ test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java	(working copy)
@@ -1,31 +1,33 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.File;
 import java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.OsmReader;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 /**
  * Test that some geotiff sample files can be read.
  * Data downloaded from <a href="ftp://ftp.remotesensing.org/pub/geotiff/samples">remotesensing.org</a>.
  */
-public class ImageLayerTest {
+@BasicPreferences
+class ImageLayerTest {
 
     /**
      * Setup test.
      */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
+    @RegisterExtension
+    static JOSMTestRules rules = new JOSMTestRules().projection();
 
     /**
      * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/14894">#14894</a>
@@ -32,7 +34,7 @@
      * @throws Exception if an error occurs during reading
      */
     @Test
-    public void testTicket14894() throws Exception {
+    void testTicket14894() throws Exception {
         assertTrue(MainApplication.getLayerManager().getLayers().isEmpty());
         // Step 1: add .osm layer
         try (InputStream in = TestUtils.getRegressionDataStream(14894, "14894.osm")) {
