Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java	(revision 9637)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java	(revision 9639)
@@ -52,5 +52,5 @@
     public NTV2GridShiftFile getShiftFile() {
         if (instance == null) {
-            try (InputStream is = new CachedFile(gridFileName).getInputStream()) {
+            try (CachedFile cf = new CachedFile(gridFileName); InputStream is = cf.getInputStream()) {
                 instance = new NTV2GridShiftFile();
                 instance.loadGridShiftFile(is, false);
Index: trunk/src/org/openstreetmap/josm/tools/FontsManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/FontsManager.java	(revision 9637)
+++ trunk/src/org/openstreetmap/josm/tools/FontsManager.java	(revision 9639)
@@ -38,5 +38,5 @@
         for (String fontFile : INCLUDED_FONTS) {
             String url = "resource://data/fonts/"+fontFile;
-            try (InputStream i = new CachedFile(url).getInputStream()) {
+            try (CachedFile cf = new CachedFile(url); InputStream i = cf.getInputStream()) {
                 ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, i));
             } catch (IOException | FontFormatException ex) {
Index: trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java	(revision 9637)
+++ trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java	(revision 9639)
@@ -72,5 +72,6 @@
     private static void initialize() {
         leftHandTrafficPolygons = new ArrayList<>();
-        try (InputStream is = new CachedFile("resource://data/left-right-hand-traffic.osm").getInputStream()) {
+        try (CachedFile cf = new CachedFile("resource://data/left-right-hand-traffic.osm");
+                InputStream is = cf.getInputStream()) {
             DataSet data = OsmReader.parseDataSet(is, null);
             for (Way w : data.getWays()) {
