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 30737)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 30738)
@@ -95,7 +95,7 @@
             // add menu entries
             //Main.main.menu.fileMenu.insert(loadFileAction, 8);
-            
+
             //Main.main.menu.fileMenu.insertSeparator(9);
-            
+
             ExtensionFileFilter.importers.add(new ImportImageFileImporter());
 
@@ -129,6 +129,5 @@
 
         // if properties file doesn't exist, install plugin
-        if(!isInstalled)
-        {
+        if (!isInstalled) {
 
             /*----------- Begin installation ---------------*/
@@ -147,23 +146,21 @@
 
             // create local properties file
-            if(pluginProps == null || pluginProps.isEmpty()){
-
-                FileWriter fw = new FileWriter(new File(PLUGINPROPERTIES_PATH));
-                URL propertiesURL = pluginClassLoader.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
-                pluginProps = new Properties();
-                pluginProps.load(propertiesURL.openStream());
-                pluginProps.store(fw, null);
-                fw.close();
+            if (pluginProps == null || pluginProps.isEmpty()) {
+                try (FileWriter fw = new FileWriter(new File(PLUGINPROPERTIES_PATH))) {
+	                URL propertiesURL = pluginClassLoader.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
+	                pluginProps = new Properties();
+	                pluginProps.load(propertiesURL.openStream());
+	                pluginProps.store(fw, null);
+                }
                 logger.debug("Plugin properties loaded");
             }
 
-            if(!new File(LOGGING_PROPERTIES_FILEPATH).exists())
-            {
-                FileWriter fw = new FileWriter(new File(LOGGING_PROPERTIES_FILEPATH));
-                URL propertiesURL = pluginClassLoader.getResource("resources/log4j.properties");
-                Properties loggingProps = new Properties();
-                loggingProps.load(propertiesURL.openStream());
-                loggingProps.store(fw, null);
-                fw.close();
+            if (!new File(LOGGING_PROPERTIES_FILEPATH).exists()) {
+                try (FileWriter fw = new FileWriter(new File(LOGGING_PROPERTIES_FILEPATH))) {
+	                URL propertiesURL = pluginClassLoader.getResource("resources/log4j.properties");
+	                Properties loggingProps = new Properties();
+	                loggingProps.load(propertiesURL.openStream());
+	                loggingProps.store(fw, null);
+                }
                 logger.debug("Logging properties created");
             }
@@ -172,5 +169,4 @@
         }
     }
-
 
     /**
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 30737)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 30738)
@@ -31,4 +31,5 @@
 import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.openstreetmap.josm.Main;
 
 /**
@@ -36,11 +37,11 @@
  * - general and spatial information about the georeferenced image
  * - a possiblitly 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 ImageLayer imageLayer;
@@ -86,6 +87,6 @@
 
     /**
-     * This method initializes 
-     * 
+     * This method initializes
+     *
      */
     public LayerPropertiesDialog(ImageLayer imageLayer, Vector<String> supportedCRS) {
@@ -95,8 +96,8 @@
         initialize();
     }
-    
-    /**
-     * This method initializes 
-     * 
+
+    /**
+     * This method initializes
+     *
      */
     public LayerPropertiesDialog(Vector<String> supportedCRS) {
@@ -105,9 +106,9 @@
         initialize();
     }
-    
+
 
     /**
      * This method initializes this
-     * 
+     *
      */
     private void initialize() {
@@ -115,11 +116,11 @@
         this.setContentPane(getMainPanel());
         this.setPreferredSize(new Dimension(404, 485));
-            
-    }
-
-    /**
-     * This method initializes mainPanel    
-     *  
-     * @return javax.swing.JPanel   
+
+    }
+
+    /**
+     * This method initializes mainPanel
+     *
+     * @return javax.swing.JPanel
      */
     private JPanel getMainPanel() {
@@ -134,7 +135,7 @@
 
     /**
-     * This method initializes jPanel   
-     *  
-     * @return javax.swing.JPanel   
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
      */
     private JPanel getJPanel() {
@@ -155,7 +156,7 @@
 
     /**
-     * This method initializes buttonPanel  
-     *  
-     * @return javax.swing.JPanel   
+     * This method initializes buttonPanel
+     *
+     * @return javax.swing.JPanel
      */
     private JPanel getButtonPanel() {
@@ -170,7 +171,7 @@
 
     /**
-     * This method initializes jTabbedPane  
-     *  
-     * @return javax.swing.JTabbedPane  
+     * This method initializes jTabbedPane
+     *
+     * @return javax.swing.JTabbedPane
      */
     private JTabbedPane getJTabbedPane() {
@@ -184,7 +185,7 @@
 
     /**
-     * This method initializes infoPanel    
-     *  
-     * @return javax.swing.JPanel   
+     * This method initializes infoPanel
+     *
+     * @return javax.swing.JPanel
      */
     private JPanel getInfoPanel() {
@@ -226,5 +227,5 @@
             crsValueLabel = new JLabel();
             crsValueLabel.setBounds(new Rectangle(150, 150, 226, 16));
-            
+
             String crsDescription = "";
             try {
@@ -233,5 +234,5 @@
             }
             crsValueLabel.setText(crsDescription + "(" + imageLayer.getBbox().getCoordinateReferenceSystem().getName().toString() + ")");
-            
+
             crsLabel = new JLabel();
             crsLabel.setBounds(new Rectangle(15, 150, 118, 16));
@@ -281,7 +282,7 @@
 
     /**
-     * This method initializes crsPanel 
-     *  
-     * @return javax.swing.JPanel   
+     * This method initializes crsPanel
+     *
+     * @return javax.swing.JPanel
      */
     private JPanel getCrsPanel() {
@@ -295,5 +296,5 @@
             }
             currentCRSValueLabel.setText(crsDescription);
-            
+
             currentCRSLabel = new JLabel();
             currentCRSLabel.setBounds(new Rectangle(15, 33, 52, 16));
@@ -339,7 +340,7 @@
 
     /**
-     * This method initializes okButton 
-     *  
-     * @return javax.swing.JButton  
+     * This method initializes okButton
+     *
+     * @return javax.swing.JButton
      */
     private JButton getOkButton() {
@@ -349,6 +350,7 @@
             okButton.setText("OK");
             okButton.addActionListener(new java.awt.event.ActionListener() {
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    
+                @Override
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+
                     setVisible(false);
                     dispose();
@@ -360,7 +362,7 @@
 
     /**
-     * This method initializes searchField  
-     *  
-     * @return javax.swing.JTextField   
+     * This method initializes searchField
+     *
+     * @return javax.swing.JTextField
      */
     private JTextField getSearchField() {
@@ -370,8 +372,9 @@
             searchField.setToolTipText("Enter keywords or EPSG codes");
             searchField.addKeyListener(new java.awt.event.KeyAdapter() {
-                public void keyTyped(java.awt.event.KeyEvent e) {
-                    
+                @Override
+				public void keyTyped(java.awt.event.KeyEvent e) {
+
                     for (Iterator<String> iterator = supportedCRS.iterator(); iterator.hasNext();) {
-                        String type = (String) iterator.next();
+                        String type = iterator.next();
                         if (type.contains(searchField.getText())) {
                             crsJList.setSelectedIndex(supportedCRS.indexOf(type));
@@ -379,5 +382,5 @@
                             break;
                         }
-                        
+
                     }
                 }
@@ -388,7 +391,7 @@
 
     /**
-     * This method initializes crsListScrollPane    
-     *  
-     * @return javax.swing.JScrollPane  
+     * This method initializes crsListScrollPane
+     *
+     * @return javax.swing.JScrollPane
      */
     private JScrollPane getCrsListScrollPane() {
@@ -402,7 +405,7 @@
 
     /**
-     * This method initializes crsJList 
-     *  
-     * @return javax.swing.JList    
+     * This method initializes crsJList
+     *
+     * @return javax.swing.JList
      */
     private JList<String> getCrsJList() {
@@ -415,7 +418,7 @@
 
     /**
-     * This method initializes useDefaultCRSButton  
-     *  
-     * @return javax.swing.JButton  
+     * This method initializes useDefaultCRSButton
+     *
+     * @return javax.swing.JButton
      */
     private JButton getUseDefaultCRSButton() {
@@ -425,8 +428,9 @@
             useDefaultCRSButton.setText("Apply Default");
             useDefaultCRSButton.addActionListener(new java.awt.event.ActionListener() {
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    
+                @Override
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+
                     try {
-                        
+
                         setCursor(new Cursor(Cursor.WAIT_CURSOR));
                         if(PluginOperations.defaultSourceCRS != null){
@@ -436,5 +440,5 @@
                             JOptionPane.showMessageDialog(getContentPane(), "<html>No default reference system available.<br>Please select one from the list</html>");
                         }
-                        
+
                     } catch (NoSuchAuthorityCodeException e1) {
                         // TODO Auto-generated catch block
@@ -457,7 +461,7 @@
 
     /**
-     * This method initializes applySelectedCRSButton   
-     *  
-     * @return javax.swing.JButton  
+     * This method initializes applySelectedCRSButton
+     *
+     * @return javax.swing.JButton
      */
     private JButton getApplySelectedCRSButton() {
@@ -469,15 +473,16 @@
             applySelectedCRSButton.setText("<html>Apply<br>Selection</html>");
             applySelectedCRSButton.addActionListener(new java.awt.event.ActionListener() {
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    
-                    String selection = (String) crsJList.getSelectedValue();
+                @Override
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+
+                    String selection = crsJList.getSelectedValue();
                     String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
-                    
+
                     CoordinateReferenceSystem newRefSys = null;
                     try {
                         newRefSys = CRS.decode(code, eastingFirstCheckBox.isSelected());
-                        
+
                         setCursor(new Cursor(Cursor.WAIT_CURSOR));
-                        
+
                         imageLayer.resample(newRefSys);
 
@@ -495,6 +500,6 @@
                         setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                     }
-                    
-                    
+
+
                 }
             });
@@ -504,7 +509,7 @@
 
     /**
-     * This method initializes setSelectedCRSAsDefaultButton    
-     *  
-     * @return javax.swing.JButton  
+     * This method initializes setSelectedCRSAsDefaultButton
+     *
+     * @return javax.swing.JButton
      */
     private JButton getSetSelectedCRSAsDefaultButton() {
@@ -515,37 +520,29 @@
             setSelectedCRSAsDefaultButton
                     .addActionListener(new java.awt.event.ActionListener() {
-                        public void actionPerformed(java.awt.event.ActionEvent e) {
-                            
+                        @Override
+						public void actionPerformed(java.awt.event.ActionEvent e) {
+
                             if(crsJList.getSelectedValue() != null){
-                                String selection = (String) crsJList.getSelectedValue();
+                                String selection = crsJList.getSelectedValue();
                                 String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
-                                
+
                                 try {
                                     PluginOperations.defaultSourceCRS = CRS.decode(code, eastingFirstCheckBox.isSelected());
                                     PluginOperations.defaultSourceCRSDescription = selection;
-                                    
+
                                     ImportImagePlugin.pluginProps.setProperty("default_crs_eastingfirst", "" + eastingFirstCheckBox.isSelected());
                                     ImportImagePlugin.pluginProps.setProperty("default_crs_srid", code);
-                                    FileWriter fileWriter = new FileWriter(new File(ImportImagePlugin.PLUGINPROPERTIES_PATH));
-                                    ImportImagePlugin.pluginProps.store(fileWriter, null);
-                                    fileWriter.close();
-                                    
+                                    try (FileWriter fileWriter = new FileWriter(new File(ImportImagePlugin.PLUGINPROPERTIES_PATH))) {
+                                    	ImportImagePlugin.pluginProps.store(fileWriter, null);
+                                    }
+
                                     defaultCRSLabel.setText(selection);
-                                    
-                                } catch (IOException e2) {
-                                    // TODO Auto-generated catch block
-                                    e2.printStackTrace();
-                                } catch (NoSuchAuthorityCodeException e3) {
-                                    // TODO Auto-generated catch block
-                                    e3.printStackTrace();
-                                } catch (FactoryException e4) {
-                                    // TODO Auto-generated catch block
-                                    e4.printStackTrace();
+
+                                } catch (IOException | FactoryException e2) {
+                                    Main.error(e2);
                                 }
-                            }else{
+                            } else {
                                 JOptionPane.showMessageDialog(getContentPane(), "Please make a selection from the list.");
                             }
-
-                            
                         }
                     });
@@ -553,9 +550,9 @@
         return setSelectedCRSAsDefaultButton;
     }
-    
-    /**
-     * This method initializes eastingFirstCheckBox 
-     *  
-     * @return javax.swing.JCheckBox    
+
+    /**
+     * This method initializes eastingFirstCheckBox
+     *
+     * @return javax.swing.JCheckBox
      */
     private JCheckBox getEastingFirstCheckBox() {
@@ -568,6 +565,6 @@
     }
 
-    
-    
+
+
     /**
      * Listener setting text in the search field if selection has changed.
@@ -575,5 +572,6 @@
      */
     class ListSelectionHandler implements ListSelectionListener {
-        public void valueChanged(ListSelectionEvent e) {
+        @Override
+		public void valueChanged(ListSelectionEvent e) {
             if(e.getValueIsAdjusting())
             {
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 30737)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 30738)
@@ -296,13 +296,10 @@
         logger.debug("Loading .prj file: " + prjFile.getAbsolutePath());
 
-        StringBuilder sb = new StringBuilder();
-        String content = null;
-        BufferedReader br = new BufferedReader(new FileReader(prjFile));
-        while((content = br.readLine()) != null)
-        {
-            sb.append(content);
-        }
-        br.close();
-        try {
+        try (BufferedReader br = new BufferedReader(new FileReader(prjFile))) {
+            StringBuilder sb = new StringBuilder();
+            String content = null;
+            while((content = br.readLine()) != null) {
+                sb.append(content);
+            }
             refSys = CRS.parseWKT(sb.toString().trim());
         } catch (FactoryException e) {
