Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 19373)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 19374)
@@ -291,7 +291,7 @@
         ParseResult result;
         try (CachedFile cache = new CachedFile(url)) {
-             Pair <ZipFile, InputStream> zip = cache.findZipEntryInputStream("validator.mapcss", "");
-             try (InputStream s = zip != null ? zip.b : cache.getInputStream();
-             Reader reader = new BufferedReader(UTFInputStreamReader.create(s))) {
+            Pair<ZipFile, InputStream> zip = cache.findZipEntryInputStream("validator.mapcss", "");
+            try (InputStream s = zip != null ? zip.b : cache.getInputStream();
+            Reader reader = new BufferedReader(UTFInputStreamReader.create(s))) {
                 if (zip != null)
                     I18n.addTexts(cache.getFile());
Index: /trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 19373)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 19374)
@@ -377,18 +377,19 @@
         try (
             CachedFile cf = new CachedFile(source).setHttpAccept(PRESET_MIME_TYPES);
-            // zip may be null, but Java 7 allows it: https://blogs.oracle.com/darcy/entry/project_coin_null_try_with
         ) {
-            Pair <ZipFile, InputStream> zip = cf.findZipEntryInputStream("xml", "preset");
-            if (zip != null) {
-                try {
+            Pair<ZipFile, InputStream> zip = cf.findZipEntryInputStream("xml", "preset");
+            try {
+                if (zip != null) {
                     zipIcons = cf.getFile();
                     I18n.addTexts(zipIcons);
-                } finally {
+                }
+                try (InputStreamReader r = UTFInputStreamReader.create(zip == null ? cf.getInputStream() : zip.b)) {
+                    tp = readAll(new BufferedReader(r), validate, all);
+                }
+            } finally {
+                if (zip != null) {
                     Utils.close(zip.b);
                     Utils.close(zip.a);
                 }
-            }
-            try (InputStreamReader r = UTFInputStreamReader.create(zip == null ? cf.getInputStream() : zip.b)) {
-                tp = readAll(new BufferedReader(r), validate, all);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 19373)
+++ /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 19374)
@@ -348,7 +348,7 @@
         if (file == null)
             return null;
-        Pair<String, Pair <ZipFile, InputStream>> res = null;
+        Pair<String, Pair<ZipFile, InputStream>> res = null;
         try {
-            ZipFile zipFile = new ZipFile(file, StandardCharsets.UTF_8);
+            ZipFile zipFile = new ZipFile(file, StandardCharsets.UTF_8); // NOPMD
             ZipEntry resentry = null;
             Enumeration<? extends ZipEntry> entries = zipFile.entries();
@@ -361,5 +361,5 @@
             }
             if (resentry != null) {
-                InputStream is = zipFile.getInputStream(resentry);
+                InputStream is = zipFile.getInputStream(resentry); // NOPMD
                 res = Pair.create(resentry.getName(), Pair.create(zipFile, is));
             } else {
