Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30435)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30436)
@@ -549,13 +549,15 @@
 
                 if (tracks) {
-                    final GpxWriter gpxWriter = new GpxWriter(printWriter);
-                    GpxFilter gpxFilter = new GpxFilter();
-                    gpxFilter.initBboxFilter(bbox);
-                    List<GpxLayer> gpxLayers = Main.map.mapView.getLayersOfType(GpxLayer.class);
-                    for (GpxLayer gpxLayer : gpxLayers) {
-                        gpxFilter.addGpxData(gpxLayer.data);
-                    }
-                    gpxWriter.write(gpxFilter.getGpxData());
-                    Utils.close(gpxWriter);
+                    try (GpxWriter gpxWriter = new GpxWriter(printWriter)) {
+                        GpxFilter gpxFilter = new GpxFilter();
+                        gpxFilter.initBboxFilter(bbox);
+                        List<GpxLayer> gpxLayers = Main.map.mapView.getLayersOfType(GpxLayer.class);
+                        for (GpxLayer gpxLayer : gpxLayers) {
+                            gpxFilter.addGpxData(gpxLayer.data);
+                        }
+                        gpxWriter.write(gpxFilter.getGpxData());
+                    } catch (IOException e) {
+                        Main.warn(e);
+                    }
                 }
                 Utils.close(osmWriter);
Index: /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java	(revision 30435)
+++ /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java	(revision 30436)
@@ -26,5 +26,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.MirroredInputStream;
-import org.openstreetmap.josm.tools.Utils;
 
 public class UrlSelectionDialog
@@ -106,8 +105,8 @@
     String src = Main.pref.get("plugin.mirrored_download.url-src", "https://josm.openstreetmap.de/mirrored_download_info");
     Collection<String> urls = new ArrayList<String>();
-    InputStream in = null;
-    try {
-      in = new MirroredInputStream(src, 24*60*60);
-      BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+    try (
+      InputStream in = new MirroredInputStream(src, 24*60*60);
+      BufferedReader reader = new BufferedReader(new InputStreamReader(in))
+    ) {
       String line = null;
       while ((line = reader.readLine()) != null) {
@@ -117,9 +116,6 @@
         }
       }
-      Utils.close(reader);
     } catch (IOException e) {
-      e.printStackTrace();
-    } finally {
-      Utils.close(in);
+      Main.error(e);
     }
     for (String url : Main.pref.getCollection("plugin.mirrored_download.custom-urls")) {
@@ -136,5 +132,4 @@
           cbSelectUrl.getSelectedItem().toString());
     }
-
   }
 
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 30435)
+++ /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java	(revision 30436)
@@ -35,24 +35,18 @@
     public SevenZipReader(InputStream in, AbstractDataSetHandler handler, boolean promptUser) throws IOException {
         super(handler, handler != null ? handler.getArchiveHandler() : null, promptUser);
-        OutputStream out = null;
-        try {
-            // Write entire 7z file as a temp file on disk as we need random access later, and "in" can be a network stream
-            File tmpFile = File.createTempFile("7z_", ".7z", OdUtils.createTempDir());
-            out = new FileOutputStream(tmpFile);
+        // Write entire 7z file as a temp file on disk as we need random access later, and "in" can be a network stream
+        File tmpFile = File.createTempFile("7z_", ".7z", OdUtils.createTempDir());
+        try (OutputStream out = new FileOutputStream(tmpFile)) {
             Utils.copyStream(in, out);
-            Utils.close(out);
-            out = null;
-            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();
-                }
-                throw new IOException(message);
+        }
+        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();
             }
-        } finally {
-            Utils.close(out);
+            throw new IOException(message);
         }
     }
Index: /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java
===================================================================
--- /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java	(revision 30435)
+++ /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java	(revision 30436)
@@ -22,5 +22,4 @@
 import org.openstreetmap.josm.plugins.opendata.OdPlugin;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -92,6 +91,4 @@
 
     protected void download(ModuleInformation pi, File file) throws ModuleDownloadException{
-        OutputStream out = null;
-        InputStream in = null;
         try {
             if (pi.downloadlink == null) {
@@ -108,12 +105,13 @@
                 downloadConnection.connect();
             }
-            in = downloadConnection.getInputStream();
-            out = new FileOutputStream(file);
-            byte[] buffer = new byte[8192];
-            for (int read = in.read(buffer); read != -1; read = in.read(buffer)) {
-                out.write(buffer, 0, read);
+            try (
+                InputStream in = downloadConnection.getInputStream();
+                OutputStream out = new FileOutputStream(file)
+            ) {
+                byte[] buffer = new byte[8192];
+                for (int read = in.read(buffer); read != -1; read = in.read(buffer)) {
+                    out.write(buffer, 0, read);
+                }
             }
-            out.close();
-            in.close();
         } catch(MalformedURLException e) {
             String msg = tr("Warning: Cannot download module ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink);
@@ -125,9 +123,7 @@
             throw new ModuleDownloadException(e);
         } finally {
-            Utils.close(in);
             synchronized(this) {
                 downloadConnection = null;
             }
-            Utils.close(out);
         }
     }
Index: /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java
===================================================================
--- /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java	(revision 30435)
+++ /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java	(revision 30436)
@@ -174,7 +174,5 @@
 
     protected void processLocalModuleInformationFile(File file) throws ModuleListParseException{
-        FileInputStream fin = null;
-        try {
-            fin = new FileInputStream(file);
+        try (FileInputStream fin = new FileInputStream(file)) {
             List<ModuleInformation> pis = new ModuleListParser().parse(fin);
             for (ModuleInformation pi : pis) {
@@ -187,6 +185,4 @@
         } catch(IOException e) {
             throw new ModuleListParseException(e);
-        } finally {
-            Utils.close(fin);
         }
     }
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 30435)
+++ /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java	(revision 30436)
@@ -33,5 +33,4 @@
 import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -142,5 +141,4 @@
      */
     protected String downloadModuleList(String site, ProgressMonitor monitor) {
-        BufferedReader in = null;
         StringBuilder sb = new StringBuilder();
         try {
@@ -159,10 +157,11 @@
                 connection.setRequestProperty("Accept-Charset", "utf-8");
             }
-            in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
-            String line;
-            while((line = in.readLine()) != null) {
-                sb.append(line).append("\n");
-            }
-            return sb.toString();
+            try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"))) {
+                String line;
+                while((line = in.readLine()) != null) {
+                    sb.append(line).append("\n");
+                }
+                return sb.toString();
+            }
         } catch(MalformedURLException e) {
             if (canceled) return null;
@@ -180,5 +179,4 @@
                 connection = null;
             }
-            Utils.close(in);
             monitor.finishTask();
         }
@@ -192,6 +190,4 @@
      */
     protected void downloadModuleIcons(String site, File destFile, ProgressMonitor monitor) {
-        InputStream in = null;
-        OutputStream out = null;
         try {
             site = site.replaceAll("%<(.*)>", "");
@@ -207,12 +203,13 @@
                 connection.setRequestProperty("Host", url.getHost());
             }
-            in = connection.getInputStream();
-            out = new FileOutputStream(destFile);
-            byte[] buffer = new byte[8192];
-            for (int read = in.read(buffer); read != -1; read = in.read(buffer)) {
-                out.write(buffer, 0, read);
-            }
-            out.close();
-            in.close();
+            try (
+                InputStream in = connection.getInputStream();
+                OutputStream out = new FileOutputStream(destFile)
+            ) {
+                byte[] buffer = new byte[8192];
+                for (int read = in.read(buffer); read != -1; read = in.read(buffer)) {
+                    out.write(buffer, 0, read);
+                }
+            }
         } catch(MalformedURLException e) {
             if (canceled) return;
@@ -230,5 +227,4 @@
                 connection = null;
             }
-            Utils.close(in);
             monitor.finishTask();
         }
Index: /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java	(revision 30435)
+++ /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java	(revision 30436)
@@ -42,9 +42,9 @@
         int length = -1;
         byte[] b = new byte[1024];
-        InputStream in = Utils.openURL(new URL(url));
-        while( (length = in.read(b)) > 0 ) {
-            bos.write(b, 0, length);
+        try (InputStream in = Utils.openURL(new URL(url))) {
+            while( (length = in.read(b)) > 0 ) {
+                bos.write(b, 0, length);
+            }
         }
-        Utils.close(in);
 
         return new String(bos.toByteArray(), charset);
@@ -66,7 +66,8 @@
 
         //send the post
-        OutputStream os = con.getOutputStream();
-        os.write(content.getBytes("UTF-8"));
-        os.flush();
+        try (OutputStream os = con.getOutputStream()) {
+            os.write(content.getBytes("UTF-8"));
+            os.flush();
+        }
 
         // read the response
@@ -74,10 +75,9 @@
         int length = -1;
         byte[] b = new byte[1024];
-        InputStream in = con.getInputStream();
-        while( (length = in.read(b)) > 0 ) {
-            bos.write(b, 0, length);
+        try (InputStream in = con.getInputStream()) {
+            while( (length = in.read(b)) > 0 ) {
+                bos.write(b, 0, length);
+            }
         }
-        Utils.close(in);
-        Utils.close(os);
 
         return new String(bos.toByteArray(), responseCharset);
Index: /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
===================================================================
--- /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 30435)
+++ /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 30436)
@@ -56,5 +56,4 @@
 import org.openstreetmap.josm.plugins.piclayer.actions.SavePictureCalibrationAction;
 import org.openstreetmap.josm.plugins.piclayer.transform.PictureTransform;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -457,8 +456,9 @@
 
     public void loadWorldfile(InputStream is) throws IOException {
-        BufferedReader br = null;
-        try {
+        
+        try (
             Reader reader = new InputStreamReader(is);
-            br = new BufferedReader(reader);
+            BufferedReader br = new BufferedReader(reader)
+        ) {
             double e[] = new double[6];
             for (int i=0; i<6; ++i) {
@@ -488,6 +488,4 @@
             initialImageScale = 1;
             Main.map.mapView.repaint();
-        } finally {
-            Utils.close(br);
         }
     }
Index: /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java
===================================================================
--- /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java	(revision 30435)
+++ /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java	(revision 30436)
@@ -23,6 +23,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import org.openstreetmap.josm.Main;
-
 import java.awt.Image;
 import java.io.File;
@@ -38,5 +36,5 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.Main;
 /**
  * Layer displaying a picture loaded from a file.
@@ -96,11 +94,6 @@
                 if (imgEntry != null) {
                     imgNameInZip = imgEntry.getName();
-                    InputStream is = null;
-                    try {
-                        is = zipFile.getInputStream(imgEntry);
-                        image = ImageIO.read(is);
-                        return image;
-                    } finally {
-                        Utils.close(is);
+                    try (InputStream is = zipFile.getInputStream(imgEntry)) {
+                        return ImageIO.read(is);
                     }
                 }
Index: /applications/editors/josm/plugins/reverter/src/reverter/OsmServerMultiObjectReader.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/OsmServerMultiObjectReader.java	(revision 30435)
+++ /applications/editors/josm/plugins/reverter/src/reverter/OsmServerMultiObjectReader.java	(revision 30436)
@@ -12,5 +12,4 @@
 import org.openstreetmap.josm.io.OsmServerReader;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -30,6 +29,5 @@
         sb.append(version);
         progressMonitor.beginTask("", 1);
-        InputStream in = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true));
-        try {
+        try (InputStream in = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true))) {
             rdr.addData(in);
         } catch (Exception e) {
@@ -37,5 +35,4 @@
         } finally {
             progressMonitor.finishTask();
-            Utils.close(in);
         }
     }
Index: /applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmServerChangesetReader.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmServerChangesetReader.java	(revision 30435)
+++ /applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmServerChangesetReader.java	(revision 30436)
@@ -70,6 +70,5 @@
                 return null;
             monitor.indeterminateSubTask(tr("Downloading changesets ..."));
-            List<Changeset> changesets = OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
-            return changesets;
+            return OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
         } catch(OsmTransferException e) {
             throw e;
