Index: applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java	(revision 30731)
+++ applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java	(revision 30738)
@@ -14,4 +14,5 @@
 import java.util.regex.Pattern;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.plugins.opendata.core.io.archive.DefaultArchiveHandler;
@@ -23,5 +24,5 @@
     private static final String ZIP_PATTERN = "FR(.*)_SW";
     private static final String SHP_PATTERN = "FR_(.*)_SWB_.W_20......";
-    
+
     private static final class WaterAgency {
         public final String code;
@@ -34,5 +35,5 @@
         }
     }
-    
+
     private static final WaterAgency[] waterAgencies = new WaterAgency[]{
         new WaterAgency("A",  "Escaut Somme", "Escaut-Somme-30381967"),
@@ -49,10 +50,10 @@
         new WaterAgency("L",  "La Réunion", "Réunion-30381991"),
     };
-    
+
     public EauxDeSurfaceHandler() {
         setName("Eaux de surface");
         setArchiveHandler(new InternalZipHandler());
     }
-    
+
     @Override
     public boolean acceptsFilename(String filename) {
@@ -63,5 +64,5 @@
         return result;
     }
-    
+
     @Override
     public boolean acceptsUrl(String url) {
@@ -91,5 +92,5 @@
         // TODO Auto-generated method stub
     }
-    
+
     @Override
     public List<Pair<String, URL>> getDataURLs() {
@@ -106,25 +107,25 @@
 
     private Pair<String, URL> getDownloadURL(WaterAgency a) throws MalformedURLException {
-        return new Pair<>("SurfaceWater_"+a.name, new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip"));
+        return new Pair<>("SurfaceWater_"+a.name,
+                new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip"));
     }
-    
+
     private class InternalZipHandler extends DefaultArchiveHandler {
         @Override
         public void notifyTempFileWritten(File file) {
-            if (file.getName().matches(SHP_PATTERN.replace("(.*)", "F")+"\\.prj")) { // Adour-Garonne .prj files cannot be parsed because they do not contain quotes... 
-                try {
-                    BufferedReader reader = new BufferedReader(new FileReader(file));
+            // Adour-Garonne .prj files cannot be parsed because they do not contain quotes...
+            if (file.getName().matches(SHP_PATTERN.replace("(.*)", "F")+"\\.prj")) {
+                try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
                     String line = reader.readLine();
-                    reader.close();
                     if (!line.contains("\"")) {
                         for (String term : new String[]{"GCS_ETRS_1989", "D_ETRS_1989", "GRS_1980", "Greenwich", "Degree"}) {
                             line = line.replace(term, "\""+term+"\"");
                         }
-                        BufferedWriter writer = new BufferedWriter(new FileWriter(file));
-                        writer.write(line);
-                        writer.close();
+                        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
+                            writer.write(line);
+                        }
                     }
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
