Index: applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java
===================================================================
--- applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java	(revision 30737)
+++ applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java	(revision 30738)
@@ -103,38 +103,38 @@
         final SimpleDateFormat fmt = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss.SS");
         List<NanoLogEntry> result = new ArrayList<>();
-        BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF8"));
-        while( r.ready() ) {
-            String line = r.readLine();
-            if( line != null ) {
-                Matcher m = NANOLOG_LINE.matcher(line);
-                if( m.matches() ) {
-                    String time = m.group(1);
-                    String message = m.group(2);
-                    String lat = m.group(3);
-                    String lon = m.group(4);
-                    String dir = m.group(5);
-                    Date timeDate = null;
-                    try {
-                        timeDate = fmt.parse(time);
-                    } catch( ParseException e ) {
-                    }
-                    if( message == null || message.length() == 0 || timeDate == null )
-                        continue;
-                    LatLon pos = null;
-                    Integer direction = null;
-                    if( lat != null && lon != null ) {
-                        try {
-                            pos = new LatLon(Double.parseDouble(lat), Double.parseDouble(lon));
-                            direction = new Integer(dir);
-                        } catch( NumberFormatException e ) {
-                            // well...
-                        }
-                    }
-                    NanoLogEntry entry = new NanoLogEntry(timeDate, message, pos, direction);
-                    result.add(entry);
-                }
-            }
-        }
-        r.close();
+        try (BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF8"))) {
+	        while( r.ready() ) {
+	            String line = r.readLine();
+	            if( line != null ) {
+	                Matcher m = NANOLOG_LINE.matcher(line);
+	                if( m.matches() ) {
+	                    String time = m.group(1);
+	                    String message = m.group(2);
+	                    String lat = m.group(3);
+	                    String lon = m.group(4);
+	                    String dir = m.group(5);
+	                    Date timeDate = null;
+	                    try {
+	                        timeDate = fmt.parse(time);
+	                    } catch( ParseException e ) {
+	                    }
+	                    if( message == null || message.length() == 0 || timeDate == null )
+	                        continue;
+	                    LatLon pos = null;
+	                    Integer direction = null;
+	                    if( lat != null && lon != null ) {
+	                        try {
+	                            pos = new LatLon(Double.parseDouble(lat), Double.parseDouble(lon));
+	                            direction = new Integer(dir);
+	                        } catch( NumberFormatException e ) {
+	                            // well...
+	                        }
+	                    }
+	                    NanoLogEntry entry = new NanoLogEntry(timeDate, message, pos, direction);
+	                    result.add(entry);
+	                }
+	            }
+	        }
+        }
         return result;
     }
