Index: /applications/editors/josm/plugins/ImportImagePlugin/.classpath
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/.classpath	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/.classpath	(revision 36013)
@@ -11,6 +11,6 @@
 	<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: /applications/editors/josm/plugins/ImportImagePlugin/build.xml
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/build.xml	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/build.xml	(revision 36013)
@@ -12,5 +12,5 @@
     <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 ** -->
@@ -18,5 +18,4 @@
 
     <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
-        <include name="log4j.jar"/>
         <include name="jts.jar"/>
         <include name="ejml.jar"/>
Index: plications/editors/josm/plugins/ImportImagePlugin/resources/log4j.properties
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/resources/log4j.properties	(revision 36012)
+++ 	(revision )
@@ -1,5 +1,0 @@
-log4j.rootLogger=ALL, MyRoFiAppender
-
-log4j.appender.MyRoFiAppender=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.MyRoFiAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.MyRoFiAppender.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c: %m%n
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 36013)
@@ -19,5 +19,4 @@
 import javax.swing.ImageIcon;
 
-import org.apache.log4j.Logger;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.geometry.Envelope2D;
@@ -25,5 +24,4 @@
 import org.geotools.referencing.CRS;
 import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.openstreetmap.josm.actions.RenameLayerAction;
@@ -49,14 +47,12 @@
 public class ImageLayer extends Layer {
 
-    private Logger logger = Logger.getLogger(ImageLayer.class);
-
-    private File imageFile;
-
-    private BufferedImage image = null;
+    private final File imageFile;
+
+    private BufferedImage image;
 
     // coordinates of upper left corner
     private EastNorth upperLeft;
     // Angle of rotation of the image
-    private double angle = 0.0;
+    private double angle;
 
     // current bbox
@@ -64,7 +60,7 @@
 
     // Layer icon
-    private Icon layericon = null;
-
-    // reference system of the oringinal image
+    private Icon layericon;
+
+    // reference system of the original image
     private CoordinateReferenceSystem sourceRefSys;
 
@@ -89,5 +85,5 @@
 
         // geotools type for images and value coverages
-        GridCoverage2D coverage = null;
+        GridCoverage2D coverage;
         try {
             // create a grid coverage from the image
@@ -99,5 +95,6 @@
 
         } 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) {
@@ -105,6 +102,6 @@
                 int val = 2;
                 if (!GraphicsEnvironment.isHeadless()) {
-                    ExtendedDialog ex = new ExtendedDialog(MainApplication.getMainFrame(), tr("Warning"), 
-                        new String[] {tr("Default image projection"), tr("JOSM''s current projection"), tr("Cancel")});
+                    ExtendedDialog ex = new ExtendedDialog(MainApplication.getMainFrame(), tr("Warning"),
+                            tr("Default image projection"), tr("JOSM''s current projection"), tr("Cancel"));
                     // CHECKSTYLE.OFF: LineLength
                     ex.setContent(tr("No projection file (.prj) found.<br>"
@@ -115,14 +112,14 @@
                     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();
                     }
                 }
-                CoordinateReferenceSystem src = null;
+                CoordinateReferenceSystem src;
                 try {
                     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());
                     }
@@ -134,14 +131,16 @@
                     }
                 } 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,
@@ -213,5 +212,5 @@
 
             if ((scalex > 10) || (scaley > 10)) {
-                logger.warn("Not drawing image - scale too big");
+                Logging.warn("ImportImagePlugin ImageLayer: Not drawing image - scale too big");
                 return;
             }
@@ -227,5 +226,5 @@
 
         } 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,6 +294,6 @@
      * calculated by the new reference system.
      */
-    void resample(CoordinateReferenceSystem refSys) throws IOException, NoSuchAuthorityCodeException, FactoryException {
-        logger.debug("resample");
+    void resample(CoordinateReferenceSystem refSys) throws IOException, FactoryException {
+        Logging.debug("ImportImagePlugin ImageLayer: resample");
         GridCoverage2D coverage = PluginOperations.createGridFromFile(this.imageFile, refSys, true);
         coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(ProjectionRegistry.getProjection().toCode()));
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(revision 36013)
@@ -5,10 +5,8 @@
 
 import java.io.File;
-import java.io.IOException;
 import java.util.List;
 
 import javax.swing.JOptionPane;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -16,5 +14,4 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException;
 import org.openstreetmap.josm.tools.Logging;
@@ -25,6 +22,4 @@
 public class ImportImageFileImporter extends FileImporter {
     
-    private Logger logger = Logger.getLogger(LoadImageAction.class);
-
     public ImportImageFileImporter() {
         super(new ExtensionFileFilter("tiff,tif,jpg,jpeg,bmp,png", "jpg", 
@@ -43,19 +38,20 @@
 
     @Override
-    public void importData(List<File> files, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
+    public void importData(List<File> files, ProgressMonitor progressMonitor) {
         if (null == files) return;
 
         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())));
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 36013)
@@ -2,14 +2,13 @@
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
+import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
 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;
 
-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;
@@ -19,4 +18,6 @@
 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;
 
@@ -25,5 +26,4 @@
  * Provides basic routines for plugin installation and provides the plugin properties.
  *
- *
  * @author Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny
  *
@@ -31,8 +31,5 @@
 public class ImportImagePlugin extends Plugin {
 
-    private static Logger logger;
-
-    JMenu mainmenu = null;
-    JosmAction loadFileAction = null;
+    JosmAction loadFileAction;
 
     // plugin properties
@@ -44,5 +41,4 @@
     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/";
 
     /**
@@ -64,16 +60,9 @@
 
         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
@@ -88,6 +77,15 @@
 
         } 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");
         }
     }
@@ -97,11 +95,9 @@
      * 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();
 
 
@@ -125,72 +121,20 @@
             // 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);
+                try (BufferedWriter fw = Files.newBufferedWriter(Paths.get(PLUGINPROPERTIES_PATH))) {
+                    URL propertiesURL = ImportImagePlugin.class.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
                     if (propertiesURL != null) {
                         pluginProps = new Properties();
-                        pluginProps.load(propertiesURL.openStream());
+                        try (InputStream stream = propertiesURL.openStream()) {
+                            pluginProps.load(stream);
+                        }
                         pluginProps.store(fw, null);
                     }
+
                 }
-                logger.debug("Plugin properties loaded");
+                Logging.debug("ImportImagePlugin: Plugin properties loaded");
             }
 
-            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: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 36013)
@@ -10,9 +10,9 @@
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
-import java.io.File;
-import java.io.FileWriter;
+import java.io.BufferedWriter;
 import java.io.IOException;
-import java.util.Iterator;
-import java.util.Vector;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
 
 import javax.swing.JButton;
@@ -38,6 +38,5 @@
  * 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
@@ -46,45 +45,22 @@
 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;
 
     /**
@@ -92,5 +68,5 @@
      *
      */
-    public LayerPropertiesDialog(ImageLayer imageLayer, Vector<String> supportedCRS) {
+    public LayerPropertiesDialog(ImageLayer imageLayer, List<String> supportedCRS) {
         super(imageLayer.getName());
         this.supportedCRS = supportedCRS;
@@ -103,5 +79,5 @@
      *
      */
-    public LayerPropertiesDialog(Vector<String> supportedCRS) {
+    public LayerPropertiesDialog(List<String> supportedCRS) {
         super();
         this.supportedCRS = supportedCRS;
@@ -191,33 +167,33 @@
     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);
@@ -225,5 +201,5 @@
             extentLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
             extentLabel.setText("Extent");
-            crsValueLabel = new JLabel();
+            JLabel crsValueLabel = new JLabel();
             crsValueLabel.setBounds(new Rectangle(150, 150, 226, 16));
 
@@ -236,24 +212,24 @@
             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");
@@ -289,5 +265,5 @@
     private JPanel getCrsPanel() {
         if (crsPanel == null) {
-            currentCRSValueLabel = new JLabel();
+            JLabel currentCRSValueLabel = new JLabel();
             currentCRSValueLabel.setBounds(new Rectangle(78, 33, 297, 16));
             String crsDescription = "unknown";
@@ -299,16 +275,16 @@
             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);
@@ -319,5 +295,5 @@
             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:");
@@ -373,6 +349,5 @@
                 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));
@@ -409,5 +384,5 @@
     private JList<String> getCrsJList() {
         if (crsJList == null) {
-            crsJList = new JList<>(supportedCRS);
+            crsJList = new JList<>(supportedCRS.toArray(new String[0]));
             crsJList.addListSelectionListener(new ListSelectionHandler());
         }
@@ -497,5 +472,5 @@
                                         "" + 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: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 36013)
@@ -10,5 +10,4 @@
 import javax.swing.JOptionPane;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
@@ -16,4 +15,5 @@
 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -24,6 +24,4 @@
  */
 public class LoadImageAction extends JosmAction {
-
-    private Logger logger = Logger.getLogger(LoadImageAction.class);
 
     /**
@@ -42,15 +40,16 @@
         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: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 36013)
@@ -7,8 +7,8 @@
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.FileReader;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.util.Arrays;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -17,5 +17,4 @@
 import javax.imageio.ImageIO;
 
-import org.apache.log4j.Logger;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridCoverageFactory;
@@ -29,8 +28,8 @@
 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;
 
 /**
@@ -42,8 +41,6 @@
 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
@@ -68,9 +65,9 @@
      */
     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();
@@ -88,14 +85,19 @@
 
     /**
-     * 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);
@@ -103,5 +105,5 @@
 
         /*------- switch for file type -----------*/
-        if (extension.equalsIgnoreCase(".tif") || extension.equalsIgnoreCase(".tiff")) {
+        if (".tif".equalsIgnoreCase(extension) || ".tiff".equalsIgnoreCase(extension)) {
 
             // try to read GeoTIFF:
@@ -111,9 +113,8 @@
             } catch (DataSourceException dse) {
                 if (!dse.getMessage().contains("Coordinate Reference System is not available")) {
-                    dse.printStackTrace();
-                }
-            } catch (FactoryException facte) {
-                logger.fatal("Error while reading from GeoTIFF:", facte);
-                throw new IOException(facte);
+                    Logging.error(dse);
+                } else {
+                    Logging.trace(dse);
+                }
             }
 
@@ -122,6 +123,6 @@
             // 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);
@@ -138,5 +139,5 @@
                 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.");
                 }
             }
@@ -155,11 +156,11 @@
             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);
@@ -173,5 +174,5 @@
                 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.");
                 }
             }
@@ -187,10 +188,10 @@
             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);
@@ -204,5 +205,5 @@
                 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.");
                 }
             }
@@ -218,11 +219,11 @@
             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);
@@ -236,5 +237,5 @@
                 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.");
                 }
             }
@@ -265,7 +266,7 @@
      */
     public static CoordinateReferenceSystem readPrjFile(File file) throws IOException {
-        CoordinateReferenceSystem refSys = null;
-
-        String prjFilename = null;
+        CoordinateReferenceSystem refSys;
+
+        String prjFilename;
         int dotPos = file.getAbsolutePath().lastIndexOf(".");
         prjFilename = file.getAbsolutePath().substring(0, dotPos) + ".prj";
@@ -273,9 +274,9 @@
         File prjFile = new File(prjFilename);
         if (!prjFile.exists()) return null;
-        logger.debug("Loading .prj file: " + prjFile.getAbsolutePath());
-
-        try (BufferedReader br = new BufferedReader(new FileReader(prjFile))) {
+        Logging.debug("Loading .prj file: " + prjFile.getAbsolutePath());
+
+        try (BufferedReader br = Files.newBufferedReader(prjFile.toPath())) {
             StringBuilder sb = new StringBuilder();
-            String content = null;
+            String content;
             while ((content = br.readLine()) != null) {
                 sb.append(content);
@@ -283,5 +284,5 @@
             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);
         }
 
@@ -302,6 +303,6 @@
      * @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) {
@@ -328,6 +329,5 @@
         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)) {
@@ -338,5 +338,5 @@
                 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;
@@ -344,5 +344,6 @@
 
             } 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: /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(revision 36013)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
@@ -15,8 +15,8 @@
 
 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;
 
@@ -25,14 +25,9 @@
  * 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();
@@ -46,5 +41,5 @@
      * 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
      */
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java	(revision 36012)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java	(revision 36013)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.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;
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.io.OsmReader;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
@@ -20,11 +21,12 @@
  * 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();
 
     /**
@@ -33,5 +35,5 @@
      */
     @Test
-    public void testTicket14894() throws Exception {
+    void testTicket14894() throws Exception {
         assertTrue(MainApplication.getLayerManager().getLayers().isEmpty());
         // Step 1: add .osm layer
