Index: applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java	(revision 30738)
@@ -717,4 +717,5 @@
      *                 if a problem occurred opening the stream.
      */
+    @SuppressWarnings("resource")
     @Override
     public OutputStream getOutputStream(ShpFileType type,
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java	(revision 30738)
@@ -4,5 +4,4 @@
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -54,5 +53,5 @@
 /**
  * NEPTUNE -> OSM converter
- * See http://www.chouette.mobi/IMG/pdf/NF__F_-Neptune-maj.pdf 
+ * See http://www.chouette.mobi/IMG/pdf/NF__F_-Neptune-maj.pdf
  */
 public class NeptuneReader extends AbstractReader implements FrenchConstants {
@@ -81,9 +80,9 @@
         schemas.add(NeptuneReader.class.getResource(NEPTUNE_XSD));
     }
-    
+
     private ChouettePTNetworkType root;
-    
+
     private final Map<String, OsmPrimitive> tridentObjects = new HashMap<>();
-    
+
     public static final boolean acceptsXmlNeptuneFile(File file) {
         return acceptsXmlNeptuneFile(file, null);
@@ -91,11 +90,10 @@
 
     public static final boolean acceptsXmlNeptuneFile(File file, URL schemaURL) {
-        
+
         if (schemaURL == null) {
             schemaURL = schemas.get(0);
         }
-        
-        try {
-            FileInputStream in = new FileInputStream(file);
+
+        try (FileInputStream in = new FileInputStream(file)) {
             Source xmlFile = new StreamSource(in);
             try {
@@ -112,18 +110,12 @@
                 Main.error(xmlFile.getSystemId() + " is NOT valid");
                 Main.error("Reason: " + e.getLocalizedMessage());
-            } finally {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    // Ignore exception 
-                }
             }
-        } catch (FileNotFoundException e) {
+        } catch (IOException e) {
             Main.error(e.getMessage());
         }
-        
+
         return false;
     }
-    
+
     public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance) throws JAXBException {
         return new NeptuneReader().parse(in, instance);
@@ -138,5 +130,5 @@
         return doc.getValue();
     }
-    
+
     private final void linkTridentObjectToOsmPrimitive(TridentObjectType object, OsmPrimitive p) {
         p.put("ref:neptune", object.getObjectId());
@@ -151,5 +143,5 @@
         return n;
     }
-    
+
     private Node createPlatform(StopPointType stop) {
         Node n = createNode(createLatLon(stop));
@@ -181,5 +173,5 @@
         return r;
     }
-    
+
     protected Relation createNetwork(PTNetworkType network) {
         Relation r = createRelation(OSM_NETWORK);
@@ -188,5 +180,5 @@
         return r;
     }
-    
+
     protected Relation createRouteMaster(LineType line) {
         Relation r = createPtRelation(OSM_ROUTE_MASTER, line);
@@ -219,5 +211,5 @@
         return r;
     }
-    
+
     protected Relation createStopArea(StopAreaType sa) {
         Relation r = createPtRelation(OSM_STOP_AREA, sa);
@@ -225,9 +217,9 @@
         return r;
     }
-    
+
     protected LatLon createLatLon(PointType point) {
         return new LatLon(point.getLatitude().doubleValue(), point.getLongitude().doubleValue());
     }
-    
+
     protected final <T extends TridentObjectType> T findTridentObject(List<T> list, String id) {
         for (T object : list) {
@@ -238,5 +230,5 @@
         return null;
     }
-    
+
     protected StopPoint findStopPoint(String id) {
         return findTridentObject(root.getChouetteLineDescription().getStopPoint(), id);
@@ -311,5 +303,5 @@
                             }
                         }
-                        
+
                     } else if (childId.contains("StopPoint")) {
                         StopPoint child = findStopPoint(childId);
@@ -352,5 +344,5 @@
                         addStopToRoute(route, start);
                     }
-                    
+
                     if (end == null) {
                         System.err.println("Cannot find end StopPoint: "+ptlink.getEndOfLink());
@@ -361,8 +353,8 @@
             }
         }
-        
+
         return ds;
     }
-        
+
     private static final boolean addStopToRoute(Relation route, OsmPrimitive stop) {
         if (route.getMembersCount() == 0 || !route.getMember(route.getMembersCount()-1).getMember().equals(stop) ) {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java	(revision 30738)
@@ -33,5 +33,5 @@
 
     private final IInArchive archive = new Handler();
-    
+
     public SevenZipReader(InputStream in, AbstractDataSetHandler handler, boolean promptUser) throws IOException {
         super(handler, handler != null ? handler.getArchiveHandler() : null, promptUser);
@@ -41,22 +41,22 @@
             Utils.copyStream(in, out);
         }
-        IInStream random = new MyRandomAccessFile(tmpFile.getPath(), "r");
-        if (archive.Open(random) != 0) {
-            String message = "Unable to open 7z archive: "+tmpFile.getPath();
-            Main.warn(message);
-            random.close();
-            if (!tmpFile.delete()) {
-                tmpFile.deleteOnExit();
+        try (IInStream random = new MyRandomAccessFile(tmpFile.getPath(), "r")) {
+            if (archive.Open(random) != 0) {
+                String message = "Unable to open 7z archive: "+tmpFile.getPath();
+                Main.warn(message);
+                if (!tmpFile.delete()) {
+                    tmpFile.deleteOnExit();
+                }
+                throw new IOException(message);
             }
-            throw new IOException(message);
         }
     }
-    
-    public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 
+
+    public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser)
             throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {
         return new SevenZipReader(in, handler, promptUser).parseDoc(instance);
     }
 
-    public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 
+    public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser)
             throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {
         return new SevenZipReader(in, handler, promptUser).parseDocs(instance);
@@ -71,8 +71,8 @@
         archive.Extract(null, -1, IInArchive.NExtract_NAskMode_kExtract, new ExtractCallback(archive, temp, candidates));
     }
-    
+
     private class ExtractCallback extends ArchiveExtractCallback {
         private final List<File> candidates;
-        
+
         public ExtractCallback(IInArchive archive, File tempDir, List<File> candidates) {
             Init(archive);
@@ -81,5 +81,5 @@
         }
 
-        @Override 
+        @Override
         public int GetStream(int index, OutputStream[] outStream, int askExtractMode) throws IOException {
             int res = super.GetStream(index, outStream, askExtractMode);
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReader.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReader.java	(revision 30738)
@@ -26,7 +26,7 @@
 
     private final ZipInputStream zis;
-    
+
     private ZipEntry entry;
-    
+
     public ZipReader(InputStream in, AbstractDataSetHandler handler, boolean promptUser) {
         super(handler, handler != null ? handler.getArchiveHandler() : null, promptUser);
@@ -34,14 +34,15 @@
     }
 
-    public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 
+    public static DataSet parseDataSet(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser)
             throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {
         return new ZipReader(in, handler, promptUser).parseDoc(instance);
     }
 
-    public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser) 
+    public static Map<File, DataSet> parseDataSets(InputStream in, AbstractDataSetHandler handler, ProgressMonitor instance, boolean promptUser)
             throws IOException, XMLStreamException, FactoryConfigurationError, JAXBException {
         return new ZipReader(in, handler, promptUser).parseDocs(instance);
     }
 
+    @Override
     protected void extractArchive(final File temp, final List<File> candidates) throws IOException, FileNotFoundException {
         while ((entry = zis.getNextEntry()) != null) {
@@ -58,15 +59,15 @@
             }
             if (!entry.isDirectory()) {
-                if (!file.createNewFile()) { 
+                if (!file.createNewFile()) {
                     throw new IOException("Could not create temp file: " + file.getAbsolutePath());
                 }
                 // Write temp file
-                FileOutputStream fos = new FileOutputStream(file);
-                byte[] buffer = new byte[8192];
-                int count = 0;
-                while ((count = zis.read(buffer, 0, buffer.length)) > 0) {
-                    fos.write(buffer, 0, count);
+                try (FileOutputStream fos = new FileOutputStream(file)) {
+                    byte[] buffer = new byte[8192];
+                    int count = 0;
+                    while ((count = zis.read(buffer, 0, buffer.length)) > 0) {
+                        fos.write(buffer, 0, count);
+                    }
                 }
-                fos.close();
                 // Allow handler to perform specific treatments (for example, fix invalid .prj files)
                 if (archiveHandler != null) {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvImporter.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvImporter.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvImporter.java	(revision 30738)
@@ -18,10 +18,10 @@
 
 public class CsvImporter extends AbstractImporter {
-    
+
     public static final ExtensionFileFilter CSV_FILE_FILTER = new ExtensionFileFilter(
             OdConstants.CSV_EXT, OdConstants.CSV_EXT, tr("CSV files") + " (*."+OdConstants.CSV_EXT+")");
-    
+
     public static final String COLOMBUS_HEADER = "INDEX,TAG,DATE,TIME,LATITUDE N/S,LONGITUDE E/W,HEIGHT,SPEED,HEADING,FIX MODE,VALID,PDOP,HDOP,VDOP,VOX";
-    
+
     public CsvImporter() {
         super(CSV_FILE_FILTER);
@@ -46,12 +46,7 @@
         boolean result = false;
         if (file != null && file.isFile()) {
-            try {
-                BufferedReader reader = new BufferedReader(new FileReader(file));
-                try {
-                    String line = reader.readLine();
-                    result = line != null && line.equalsIgnoreCase(COLOMBUS_HEADER);
-                } finally {
-                    reader.close();
-                }
+            try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
+                String line = reader.readLine();
+                result = line != null && line.equalsIgnoreCase(COLOMBUS_HEADER);
             } catch (IOException e) {
                 // Ignore exceptions
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java	(revision 30738)
@@ -73,9 +73,8 @@
         this.name = name;
         this.file = file;
-        FileInputStream fis = null;
-        JarInputStream jar = null;
-        try {
-            fis = new FileInputStream(file);
-            jar = new JarInputStream(fis);
+        try (
+            FileInputStream fis = new FileInputStream(file);
+            JarInputStream jar = new JarInputStream(fis);
+        ) {
             Manifest manifest = jar.getManifest();
             if (manifest == null)
@@ -85,15 +84,4 @@
         } catch (IOException e) {
             throw new ModuleException(name, e);
-        } finally {
-            if (jar != null) {
-                try {
-                    jar.close();
-                } catch(IOException e) { /* ignore */ }
-            }
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch(IOException e) { /* ignore */ }
-            }
         }
     }
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java	(revision 30738)
@@ -25,4 +25,5 @@
 import java.util.List;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -246,24 +247,20 @@
      */
     protected void cacheModuleList(String site, String list) {
-        PrintWriter writer = null;
         try {
             File moduleDir = OdPlugin.getInstance().getModulesDirectory();
             if (!moduleDir.exists()) {
                 if (! moduleDir.mkdirs()) {
-                    System.err.println(tr("Warning: failed to create module directory ''{0}''. Cannot cache module list from module site ''{1}''.", moduleDir.toString(), site));
+                    Main.warn(tr("Warning: failed to create module directory ''{0}''. Cannot cache module list from module site ''{1}''.",
+                            moduleDir.toString(), site));
                 }
             }
             File cacheFile = createSiteCacheFile(moduleDir, site, CacheType.PLUGIN_LIST);
             getProgressMonitor().subTask(tr("Writing module list to local cache ''{0}''", cacheFile.toString()));
-            writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), "utf-8"));
-            writer.write(list);
+            try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), "utf-8"))) {
+                writer.write(list);
+            }
         } catch (IOException e) {
             // just failed to write the cache file. No big deal, but log the exception anyway
-            e.printStackTrace();
-        } finally {
-            if (writer != null) {
-                writer.flush();
-                writer.close();
-            }
+            Main.warn(e);
         }
     }
@@ -300,4 +297,5 @@
             File [] f = new File(location).listFiles(
                     new FilenameFilter() {
+                        @Override
                         public boolean accept(File dir, String name) {
                             return name.matches("^([0-9]+-)?site.*\\.txt$") ||
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java	(revision 30738)
@@ -11,4 +11,5 @@
 
 import org.apache.commons.lang3.text.WordUtils;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
@@ -16,5 +17,5 @@
 
 public abstract class NamesFrUtils {
-    
+
     private static Map<String, String> dictionary = initDictionary();
 
@@ -29,10 +30,9 @@
         return result;
     }
-    
+
     private static Map<String, String> initDictionary() {
         Map<String, String> result = new HashMap<>();
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(
-                    SimpleDataSetHandler.class.getResourceAsStream(OdConstants.DICTIONARY_FR), OdConstants.UTF8));
+        try (BufferedReader reader = new BufferedReader(new InputStreamReader(
+                SimpleDataSetHandler.class.getResourceAsStream(OdConstants.DICTIONARY_FR), OdConstants.UTF8))) {
             String line = reader.readLine(); // Skip first line
             while ((line = reader.readLine()) != null) {
@@ -40,7 +40,6 @@
                 result.put(tab[0].replace("\"", ""), tab[1].replace("\"", ""));
             }
-            reader.close();
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return result;
@@ -170,5 +169,5 @@
             if (value != null) {
                 value = WordUtils.capitalizeFully(value);
-                // Cas particuliers 
+                // Cas particuliers
                 if (value.equals("Boulingrin")) { // square Boulingrin, mal formé
                     value = "Sq Boulingrin";
