Index: trunk/.checkstyle
===================================================================
--- trunk/.checkstyle	(revision 15033)
+++ trunk/.checkstyle	(revision 15034)
@@ -18,11 +18,33 @@
     <filter-data value="src/org/openstreetmap/gui"/>
     <filter-data value="src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen"/>
+    <filter-data value="src/org/tukaani"/>
+    <filter-data value=".externalToolBuilders"/>
+    <filter-data value=".settings"/>
     <filter-data value=".svn"/>
+    <filter-data value="bin"/>
+    <filter-data value="bintest"/>
+    <filter-data value="build"/>
+    <filter-data value="build2"/>
     <filter-data value="data"/>
+    <filter-data value="data_nodist"/>
+    <filter-data value="dist"/>
+    <filter-data value="eclipse"/>
     <filter-data value="images"/>
+    <filter-data value="images_nodist"/>
     <filter-data value="javadoc"/>
+    <filter-data value="linux"/>
+    <filter-data value="macosx"/>
+    <filter-data value="netbeans"/>
+    <filter-data value="patches"/>
     <filter-data value="resources"/>
     <filter-data value="styles"/>
-    <filter-data value="scripts"/>
+    <filter-data value="styles_nodist"/>
+    <filter-data value="test/build"/>
+    <filter-data value="test/config"/>
+    <filter-data value="test/data"/>
+    <filter-data value="test/lib"/>
+    <filter-data value="test/report"/>
+    <filter-data value="tools"/>
+    <filter-data value="windows"/>
   </filter>
 </fileset-config>
Index: trunk/build.xml
===================================================================
--- trunk/build.xml	(revision 15033)
+++ trunk/build.xml	(revision 15034)
@@ -47,5 +47,5 @@
         <property name="failureaccess.jar" location="${tools.dir}/failureaccess.jar"/>
         <property name="guava.jar" location="${tools.dir}/guava.jar"/>
-    	<property name="commons-lang3.jar" location="${pmd.dir}/commons-lang3-3.8.1.jar"/>
+        <property name="commons-lang3.jar" location="${pmd.dir}/commons-lang3-3.8.1.jar"/>
         <property name="jformatstring.jar" location="${spotbugs.dir}/jFormatString-3.0.0.jar"/>
         <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
Index: trunk/scripts/SyncEditorLayerIndex.java
===================================================================
--- trunk/scripts/SyncEditorLayerIndex.java	(revision 15033)
+++ trunk/scripts/SyncEditorLayerIndex.java	(revision 15034)
@@ -1,15 +1,15 @@
 // License: GPL. For details, see LICENSE file.
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.text.DecimalFormat;
 import java.text.ParseException;
@@ -50,4 +50,5 @@
 import org.openstreetmap.josm.io.imagery.ImageryReader;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.OptionParser;
 import org.openstreetmap.josm.tools.OptionParser.OptionCount;
@@ -74,18 +75,20 @@
 public class SyncEditorLayerIndex {
 
+    private static final int MAXLEN = 140;
+
     private List<ImageryInfo> josmEntries;
     private JsonArray eliEntries;
 
-    private Map<String, JsonObject> eliUrls = new HashMap<>();
-    private Map<String, ImageryInfo> josmUrls = new HashMap<>();
-    private Map<String, ImageryInfo> josmMirrors = new HashMap<>();
-    private static Map<String, String> oldproj = new HashMap<>();
-    private static List<String> ignoreproj = new LinkedList<>();
+    private final Map<String, JsonObject> eliUrls = new HashMap<>();
+    private final Map<String, ImageryInfo> josmUrls = new HashMap<>();
+    private final Map<String, ImageryInfo> josmMirrors = new HashMap<>();
+    private static final Map<String, String> oldproj = new HashMap<>();
+    private static final List<String> ignoreproj = new LinkedList<>();
 
     private static String eliInputFile = "imagery_eli.geojson";
     private static String josmInputFile = "imagery_josm.imagery.xml";
     private static String ignoreInputFile = "imagery_josm.ignores.txt";
-    private static FileOutputStream outputFile = null;
-    private static OutputStreamWriter outputStream = null;
+    private static OutputStream outputFile;
+    private static OutputStreamWriter outputStream;
     private static String optionOutput;
     private static boolean optionShorten;
@@ -108,5 +111,5 @@
     public static void main(String[] args) throws IOException, SAXException, ReflectiveOperationException {
         Locale.setDefault(Locale.ROOT);
-        parse_command_line_arguments(args);
+        parseCommandLineArguments(args);
         Preferences pref = new Preferences(JosmBaseDirectories.getInstance());
         Config.setPreferencesInstance(pref);
@@ -118,17 +121,13 @@
         script.loadJosmEntries();
         if (optionJosmXml != null) {
-            FileOutputStream file = new FileOutputStream(optionJosmXml);
-            OutputStreamWriter stream = new OutputStreamWriter(file, "UTF-8");
-            script.printentries(script.josmEntries, stream);
-            stream.close();
-            file.close();
+            try (OutputStreamWriter stream = new OutputStreamWriter(Files.newOutputStream(Paths.get(optionJosmXml)), UTF_8)) {
+                script.printentries(script.josmEntries, stream);
+            }
         }
         script.loadELIEntries();
         if (optionEliXml != null) {
-            FileOutputStream file = new FileOutputStream(optionEliXml);
-            OutputStreamWriter stream = new OutputStreamWriter(file, "UTF-8");
-            script.printentries(script.eliEntries, stream);
-            stream.close();
-            file.close();
+            try (OutputStreamWriter stream = new OutputStreamWriter(Files.newOutputStream(Paths.get(optionEliXml)), UTF_8)) {
+                script.printentries(script.eliEntries, stream);
+            }
         }
         script.checkInOneButNotTheOther();
@@ -154,8 +153,10 @@
         return "usage: java -cp build SyncEditorLayerIndex\n" +
         "-c,--encoding <encoding>           output encoding (defaults to UTF-8 or cp850 on Windows)\n" +
-        "-e,--eli_input <eli_input>         Input file for the editor layer index (geojson). Default is imagery_eli.geojson (current directory).\n" +
+        "-e,--eli_input <eli_input>         Input file for the editor layer index (geojson). " +
+                                            "Default is imagery_eli.geojson (current directory).\n" +
         "-h,--help                          show this help\n" +
         "-i,--ignore_input <ignore_input>   Input file for the ignore list. Default is imagery_josm.ignores.txt (current directory).\n" +
-        "-j,--josm_input <josm_input>       Input file for the JOSM imagery list (xml). Default is imagery_josm.imagery.xml (current directory).\n" +
+        "-j,--josm_input <josm_input>       Input file for the JOSM imagery list (xml). " +
+                                            "Default is imagery_josm.imagery.xml (current directory).\n" +
         "-m,--noeli                         don't show output for ELI problems\n" +
         "-n,--noskip                        don't skip known entries\n" +
@@ -171,8 +172,7 @@
      * Parse command line arguments.
      * @param args program arguments
-     * @throws FileNotFoundException if a file can't be found
-     * @throws UnsupportedEncodingException  if the given encoding can't be found
+     * @throws IOException in case of I/O error
      */
-    static void parse_command_line_arguments(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
+    static void parseCommandLineArguments(String[] args) throws IOException {
         new OptionParser("JOSM/ELI synchronization script")
                 .addFlagParameter("help", SyncEditorLayerIndex::showHelp)
@@ -204,6 +204,6 @@
                 .parseOptionsOrExit(Arrays.asList(args));
 
-        if (optionOutput != null && optionOutput != "-") {
-            outputFile = new FileOutputStream(optionOutput);
+        if (optionOutput != null && !"-".equals(optionOutput)) {
+            outputFile = Files.newOutputStream(Paths.get(optionOutput));
             outputStream = new OutputStreamWriter(outputFile, optionEncoding != null ? optionEncoding : "UTF-8");
         } else if (optionEncoding != null) {
@@ -233,5 +233,5 @@
     void loadSkip() throws IOException {
         final Pattern pattern = Pattern.compile("^\\|\\| *(ELI|Ignore) *\\|\\| *\\{\\{\\{(.+)\\}\\}\\} *\\|\\|");
-        try (BufferedReader fr = new BufferedReader(new InputStreamReader(new FileInputStream(ignoreInputFile), "UTF-8"))) {
+        try (BufferedReader fr = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get(ignoreInputFile)), UTF_8))) {
             String line;
 
@@ -262,10 +262,11 @@
             skip.remove(s);
             if (optionXhtmlBody || optionXhtml) {
-                s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")+"</pre>";
+                s = "<pre style=\"margin:3px;color:"+color+"\">"
+                        + s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</pre>";
             }
             if (!optionNoSkip) {
                 return;
             }
-        } else if(optionXhtmlBody || optionXhtml) {
+        } else if (optionXhtmlBody || optionXhtml) {
             String color =
                     s.startsWith("***") ? "black" :
@@ -273,5 +274,5 @@
                             (s.startsWith("#") ? "indigo" :
                                 (s.startsWith("!") ? "orange" : "red")));
-            s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")+"</pre>";
+            s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</pre>";
         }
         if ((s.startsWith("+ ") || s.startsWith("+++ ELI") || s.startsWith("#")) && optionNoEli) {
@@ -283,6 +284,9 @@
     void start() throws IOException {
         if (optionXhtml) {
-            myprintlnfinal("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n");
-            myprintlnfinal("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/><title>JOSM - ELI differences</title></head><body>\n");
+            myprintlnfinal(
+                    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n");
+            myprintlnfinal(
+                    "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>"+
+                    "<title>JOSM - ELI differences</title></head><body>\n");
         }
     }
@@ -298,5 +302,5 @@
 
     void loadELIEntries() throws IOException {
-        try (JsonReader jr = Json.createReader(new InputStreamReader(new FileInputStream(eliInputFile), "UTF-8"))) {
+        try (JsonReader jr = Json.createReader(new InputStreamReader(Files.newInputStream(Paths.get(eliInputFile)), UTF_8))) {
             eliEntries = jr.readObject().getJsonArray("features");
         }
@@ -306,5 +310,5 @@
             if (url.contains("{z}")) {
                 myprintln("+++ ELI-URL uses {z} instead of {zoom}: "+url);
-                url = url.replace("{z}","{zoom}");
+                url = url.replace("{z}", "{zoom}");
             }
             if (eliUrls.containsKey(url)) {
@@ -355,6 +359,7 @@
             if (p != null) {
                 res += offset + "<projections>\n";
-                for (String c : p)
+                for (String c : p) {
                     res += offset + "    <code>"+c+"</code>\n";
+                }
                 res += offset + "</projections>\n";
             }
@@ -370,6 +375,6 @@
         for (Object e : entries) {
             stream.write("    <entry"
-                + ("eli-best".equals(getQuality(e)) ? " eli-best=\"true\"" : "" )
-                + (getOverlay(e) ? " overlay=\"true\"" : "" )
+                + ("eli-best".equals(getQuality(e)) ? " eli-best=\"true\"" : "")
+                + (getOverlay(e) ? " overlay=\"true\"" : "")
                 + ">\n");
             String t;
@@ -428,5 +433,5 @@
                         if (lat < minlat) minlat = lat;
                         if (lon < minlon) minlon = lon;
-                        if ((i++%3) == 0) {
+                        if ((i++ % 3) == 0) {
                             shapes += sep + "    ";
                         }
@@ -435,8 +440,12 @@
                     shapes += sep + "</shape>\n";
                 }
-            } catch(IllegalArgumentException ignored) {
+            } catch (IllegalArgumentException ignored) {
+                Logging.trace(ignored);
             }
             if (!shapes.isEmpty()) {
-                stream.write("        <bounds min-lat='"+df.format(minlat)+"' min-lon='"+df.format(minlon)+"' max-lat='"+df.format(maxlat)+"' max-lon='"+df.format(maxlon)+"'>\n");
+                stream.write("        <bounds min-lat='"+df.format(minlat)
+                                          +"' min-lon='"+df.format(minlon)
+                                          +"' max-lat='"+df.format(maxlat)
+                                          +"' max-lon='"+df.format(maxlon)+"'>\n");
                 stream.write(shapes + "        </bounds>\n");
             }
@@ -464,5 +473,5 @@
             if (url.contains("{z}")) {
                 myprintln("+++ JOSM-URL uses {z} instead of {zoom}: "+url);
-                url = url.replace("{z}","{zoom}");
+                url = url.replace("{z}", "{zoom}");
             }
             if (josmUrls.containsKey(url)) {
@@ -475,5 +484,5 @@
                 Field origNameField = ImageryInfo.class.getDeclaredField("origName");
                 ReflectionUtils.setObjectsAccessible(origNameField);
-                origNameField.set(m, m.getOriginalName().replaceAll(" mirror server( \\d+)?",""));
+                origNameField.set(m, m.getOriginalName().replaceAll(" mirror server( \\d+)?", ""));
                 if (josmUrls.containsKey(url)) {
                     myprintln("+++ JOSM-Mirror-URL is not unique: "+url);
@@ -504,5 +513,5 @@
                 JsonObject e = eliUrls.get(urle);
                 String ide = getId(e);
-                String urlhttps = urle.replace("http:","https:");
+                String urlhttps = urle.replace("http:", "https:");
                 if (lj.contains(urlhttps)) {
                     myprintln("+ Missing https: "+getDescription(e));
@@ -523,5 +532,5 @@
                             // replace key for this entry with JOSM URL
                             eliUrls.remove(urle);
-                            eliUrls.put(urlj,e);
+                            eliUrls.put(urlj, e);
                             break;
                         }
@@ -548,4 +557,18 @@
 
     void checkCommonEntries() throws IOException {
+        doSameUrlButDifferentName();
+        doSameUrlButDifferentId();
+        doSameUrlButDifferentType();
+        doSameUrlButDifferentZoomBounds();
+        doSameUrlButDifferentCountryCode();
+        doSameUrlButDifferentQuality();
+        doSameUrlButDifferentDates();
+        doSameUrlButDifferentInformation();
+        doMismatchingShapes();
+        doMismatchingIcons();
+        doMiscellaneousChecks();
+    }
+
+    void doSameUrlButDifferentName() throws IOException {
         myprintln("*** Same URL, but different name: ***");
         for (String url : eliUrls.keySet()) {
@@ -553,11 +576,13 @@
             if (!josmUrls.containsKey(url)) continue;
             ImageryInfo j = josmUrls.get(url);
-            String ename = getName(e).replace("'","\u2019");
-            String jname = getName(j).replace("'","\u2019");
+            String ename = getName(e).replace("'", "\u2019");
+            String jname = getName(j).replace("'", "\u2019");
             if (!ename.equals(jname)) {
                 myprintln("* Name differs ('"+getName(e)+"' != '"+getName(j)+"'): "+getUrl(j));
             }
         }
-
+    }
+
+    void doSameUrlButDifferentId() throws IOException {
         myprintln("*** Same URL, but different Id: ***");
         for (String url : eliUrls.keySet()) {
@@ -571,5 +596,7 @@
             }
         }
-
+    }
+
+    void doSameUrlButDifferentType() throws IOException {
         myprintln("*** Same URL, but different type: ***");
         for (String url : eliUrls.keySet()) {
@@ -581,5 +608,7 @@
             }
         }
-
+    }
+
+    void doSameUrlButDifferentZoomBounds() throws IOException {
         myprintln("*** Same URL, but different zoom bounds: ***");
         for (String url : eliUrls.keySet()) {
@@ -605,5 +634,7 @@
             }
         }
-
+    }
+
+    void doSameUrlButDifferentCountryCode() throws IOException {
         myprintln("*** Same URL, but different country code: ***");
         for (String url : eliUrls.keySet()) {
@@ -619,4 +650,7 @@
             }
         }
+    }
+
+    void doSameUrlButDifferentQuality() throws IOException {
         myprintln("*** Same URL, but different quality: ***");
         for (String url : eliUrls.keySet()) {
@@ -634,4 +668,7 @@
             }
         }
+    }
+
+    void doSameUrlButDifferentDates() throws IOException {
         myprintln("*** Same URL, but different dates: ***");
         Pattern pattern = Pattern.compile("^(.*;)(\\d\\d\\d\\d)(-(\\d\\d)(-(\\d\\d))?)?$");
@@ -642,5 +679,5 @@
             String jd = getDate(j);
             // The forms 2015;- or -;2015 or 2015;2015 are handled equal to 2015
-            String ef = ed.replaceAll("\\A-;","").replaceAll(";-\\z","").replaceAll("\\A([0-9-]+);\\1\\z", "$1");
+            String ef = ed.replaceAll("\\A-;", "").replaceAll(";-\\z", "").replaceAll("\\A([0-9-]+);\\1\\z", "$1");
             // ELI has a strange and inconsistent used end_date definition, so we try again with subtraction by one
             String ed2 = ed;
@@ -658,5 +695,5 @@
                     ed2 += "-" + String.format("%02d", cal.get(Calendar.DAY_OF_MONTH));
             }
-            String ef2 = ed2.replaceAll("\\A-;","").replaceAll(";-\\z","").replaceAll("\\A([0-9-]+);\\1\\z", "$1");
+            String ef2 = ed2.replaceAll("\\A-;", "").replaceAll(";-\\z", "").replaceAll("\\A([0-9-]+);\\1\\z", "$1");
             if (!ed.equals(jd) && !ef.equals(jd) && !ed2.equals(jd) && !ef2.equals(jd)) {
                 String t = "'"+ed+"'";
@@ -673,4 +710,7 @@
             }
         }
+    }
+
+    void doSameUrlButDifferentInformation() throws IOException {
         myprintln("*** Same URL, but different information: ***");
         for (String url : eliUrls.keySet()) {
@@ -723,5 +763,5 @@
                     myprintln("- Missing JOSM attribution URL ("+et+"): "+getDescription(j));
                 } else if (isNotBlank(et)) {
-                    String ethttps = et.replace("http:","https:");
+                    String ethttps = et.replace("http:", "https:");
                     if (jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) {
                         myprintln("+ Attribution URL differs ('"+et+"' != '"+jt+"'): "+getDescription(j));
@@ -786,4 +826,7 @@
             }
         }
+    }
+
+    void doMismatchingShapes() throws IOException {
         myprintln("*** Mismatching shapes: ***");
         for (String url : josmUrls.keySet()) {
@@ -792,5 +835,5 @@
             for (Shape shape : getShapes(j)) {
                 List<Coordinate> p = shape.getPoints();
-                if(!p.get(0).equals(p.get(p.size()-1))) {
+                if (!p.get(0).equals(p.get(p.size()-1))) {
                     myprintln("+++ JOSM shape "+num+" unclosed: "+getDescription(j));
                 }
@@ -811,5 +854,5 @@
                 for (Shape shape : s) {
                     List<Coordinate> p = shape.getPoints();
-                    if(!p.get(0).equals(p.get(p.size()-1)) && !optionNoEli) {
+                    if (!p.get(0).equals(p.get(p.size()-1)) && !optionNoEli) {
                         myprintln("+++ ELI shape "+num+" unclosed: "+getDescription(e));
                     }
@@ -834,10 +877,10 @@
                     myprintln("+ No ELI shape: "+getDescription(j));
                 }
-            } else if(js.isEmpty() && !s.isEmpty()) {
+            } else if (js.isEmpty() && !s.isEmpty()) {
                 // don't report boundary like 5 point shapes as difference
                 if (s.size() != 1 || s.get(0).getPoints().size() != 5) {
                     myprintln("- No JOSM shape: "+getDescription(j));
                 }
-            } else if(s.size() != js.size()) {
+            } else if (s.size() != js.size()) {
                 myprintln("* Different number of shapes ("+s.size()+" != "+js.size()+"): "+getDescription(j));
             } else {
@@ -850,11 +893,11 @@
                         if (ep.size() == jp.size() && !jdone[jnums]) {
                             boolean err = false;
-                            for(int nump = 0; nump < ep.size() && !err; ++nump) {
+                            for (int nump = 0; nump < ep.size() && !err; ++nump) {
                                 Coordinate ept = ep.get(nump);
                                 Coordinate jpt = jp.get(nump);
-                                if(Math.abs(ept.getLat()-jpt.getLat()) > 0.00001 || Math.abs(ept.getLon()-jpt.getLon()) > 0.00001)
+                                if (Math.abs(ept.getLat()-jpt.getLat()) > 0.00001 || Math.abs(ept.getLon()-jpt.getLon()) > 0.00001)
                                     err = true;
                             }
-                            if(!err) {
+                            if (!err) {
                                 edone[enums] = true;
                                 jdone[jnums] = true;
@@ -897,5 +940,6 @@
                                 numtxt += '/' + Integer.toString(jnums+1);
                             }
-                            myprintln("* Different number of points for shape "+numtxt+" ("+ep.size()+" ! = "+jp.size()+")): "+getDescription(j));
+                            myprintln("* Different number of points for shape "+numtxt+" ("+ep.size()+" ! = "+jp.size()+")): "
+                                    + getDescription(j));
                             edone[enums] = true;
                             jdone[jnums] = true;
@@ -906,4 +950,7 @@
             }
         }
+    }
+
+    void doMismatchingIcons() throws IOException {
         myprintln("*** Mismatching icons: ***");
         for (String url : eliUrls.keySet()) {
@@ -927,5 +974,5 @@
               || ie.startsWith("https://raw.githubusercontent.com/osmlab/editor-layer-index/")) &&
               ij.startsWith("data:"))) {
-                String iehttps = ie.replace("http:","https:");
+                String iehttps = ie.replace("http:", "https:");
                 if (ij.equals(iehttps)) {
                     myprintln("+ Different icons: "+getDescription(j));
@@ -935,4 +982,7 @@
             }
         }
+    }
+
+    void doMiscellaneousChecks() throws IOException {
         myprintln("*** Miscellaneous checks: ***");
         Map<String, ImageryInfo> josmIds = new HashMap<>();
@@ -964,5 +1014,6 @@
                     }
                     for (String o : old) {
-                        myprintln("* Projection "+o+" is an old unsupported code and has been replaced by "+oldproj.get(o)+": "+getDescription(j));
+                        myprintln("* Projection "+o+" is an old unsupported code and has been replaced by "+oldproj.get(o)+": "
+                                + getDescription(j));
                     }
                 }
@@ -995,5 +1046,5 @@
                     myprintln("* Strange URL '"+u+"': "+getDescription(j));
                 } else {
-                    String domain = m.group(1).replaceAll("\\{switch:.*\\}","x");
+                    String domain = m.group(1).replaceAll("\\{switch:.*\\}", "x");
                     String port = m.group(2);
                     if (!(domain.matches("^\\d+\\.\\d+\\.\\d+\\.\\d+$")) && !dv.isValid(domain))
@@ -1028,6 +1079,5 @@
                             myprintln("* JOSM-Date '"+d+"' is strange (second earlier than first): "+getDescription(j));
                         }
-                    }
-                    catch (Exception e) {
+                    } catch (Exception e) {
                         myprintln("* JOSM-Date '"+d+"' is strange ("+e.getMessage()+"): "+getDescription(j));
                     }
@@ -1053,8 +1103,8 @@
                         double lat = p.getLat();
                         double lon = p.getLon();
-                        if(lat > maxlat) maxlat = lat;
-                        if(lon > maxlon) maxlon = lon;
-                        if(lat < minlat) minlat = lat;
-                        if(lon < minlon) minlon = lon;
+                        if (lat > maxlat) maxlat = lat;
+                        if (lon > maxlon) maxlon = lon;
+                        if (lat < minlat) minlat = lat;
+                        if (lon < minlon) minlon = lon;
                     }
                 }
@@ -1062,5 +1112,6 @@
                 if (b.getMinLat() != minlat || b.getMinLon() != minlon || b.getMaxLat() != maxlat || b.getMaxLon() != maxlon) {
                     myprintln("* Bounds do not match shape (is "+b.getMinLat()+","+b.getMinLon()+","+b.getMaxLat()+","+b.getMaxLon()
-                        + ", calculated <bounds min-lat='"+minlat+"' min-lon='"+minlon+"' max-lat='"+maxlat+"' max-lon='"+maxlon+"'>): "+getDescription(j));
+                        + ", calculated <bounds min-lat='"+minlat+"' min-lon='"+minlon+"' max-lat='"+maxlat+"' max-lon='"+maxlon+"'>): "
+                        + getDescription(j));
                 }
             }
@@ -1085,5 +1136,5 @@
 
     static String getUrlStripped(Object e) {
-        return getUrl(e).replaceAll("\\?(apikey|access_token)=.*","");
+        return getUrl(e).replaceAll("\\?(apikey|access_token)=.*", "");
     }
 
@@ -1093,9 +1144,9 @@
         String start = p.containsKey("start_date") ? p.getString("start_date") : "";
         String end = p.containsKey("end_date") ? p.getString("end_date") : "";
-        if(!start.isEmpty() && !end.isEmpty())
+        if (!start.isEmpty() && !end.isEmpty())
             return start+";"+end;
-        else if(!start.isEmpty())
+        else if (!start.isEmpty())
             return start+";-";
-        else if(!end.isEmpty())
+        else if (!end.isEmpty())
             return "-;"+end;
         return "";
@@ -1104,5 +1155,5 @@
     static Date verifyDate(String year, String month, String day) throws ParseException {
         String date;
-        if(year == null) {
+        if (year == null) {
             date = "3000-01-01";
         } else {
@@ -1161,5 +1212,5 @@
         if (e instanceof ImageryInfo) {
             ImageryBounds bounds = ((ImageryInfo) e).getBounds();
-            if(bounds != null) {
+            if (bounds != null) {
                 return bounds.getShapes();
             }
@@ -1283,6 +1334,6 @@
     }
 
-    static Map<String,String> getDescriptions(Object e) {
-        Map<String,String> res = new HashMap<String, String>();
+    static Map<String, String> getDescriptions(Object e) {
+        Map<String, String> res = new HashMap<String, String>();
         if (e instanceof ImageryInfo) {
             String a = ((ImageryInfo) e).getDescription();
@@ -1290,5 +1341,5 @@
         } else {
             String a = ((Map<String, JsonObject>) e).get("properties").getString("description", null);
-            if (a != null) res.put("en", a.replaceAll("''","'"));
+            if (a != null) res.put("en", a.replaceAll("''", "'"));
         }
         return res;
@@ -1323,5 +1374,4 @@
         String d = cc + getName(o) + " - " + getUrl(o);
         if (optionShorten) {
-            final int MAXLEN = 140;
             if (d.length() > MAXLEN) d = d.substring(0, MAXLEN-1) + "...";
         }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 15033)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 15034)
@@ -595,13 +595,13 @@
         }
 
-        private static String lc(String s) {
+        private static String lower(String s) {
             return s.toLowerCase(Locale.ENGLISH);
         }
 
         static String validateUploadTag(String uploadValue, String preferencePrefix, List<String> defMandatory, List<String> defForbidden) {
-            String uploadValueLc = lc(uploadValue);
+            String uploadValueLc = lower(uploadValue);
             // Check mandatory terms
             List<String> missingTerms = Config.getPref().getList(preferencePrefix+".mandatory-terms", defMandatory)
-                .stream().map(UploadAction::lc).filter(x -> !uploadValueLc.contains(x)).collect(Collectors.toList());
+                .stream().map(UploadAction::lower).filter(x -> !uploadValueLc.contains(x)).collect(Collectors.toList());
             if (!missingTerms.isEmpty()) {
                 return tr("The following required terms are missing: {0}", missingTerms);
@@ -609,5 +609,5 @@
             // Check forbidden terms
             List<String> forbiddenTerms = Config.getPref().getList(preferencePrefix+".forbidden-terms", defForbidden)
-                    .stream().map(UploadAction::lc).filter(uploadValueLc::contains).collect(Collectors.toList());
+                    .stream().map(UploadAction::lower).filter(uploadValueLc::contains).collect(Collectors.toList());
             if (!forbiddenTerms.isEmpty()) {
                 return tr("The following forbidden terms have been found: {0}", forbiddenTerms);
Index: trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
===================================================================
--- trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(revision 15033)
+++ trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(revision 15034)
@@ -10,7 +10,7 @@
 import java.awt.image.BufferedImage;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.text.MessageFormat;
 import java.util.ArrayList;
@@ -345,12 +345,12 @@
         }
 
-        public DataSet getOsmDataSet() throws FileNotFoundException, IllegalDataException {
+        public DataSet getOsmDataSet() throws IllegalDataException, IOException {
             if (ds == null) {
-                ds = OsmReader.parseDataSet(new FileInputStream(getTestDirectory() + "/data.osm"), null);
+                ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(getTestDirectory(), "data.osm")), null);
             }
             return ds;
         }
 
-        public Bounds getTestArea() throws FileNotFoundException, IllegalDataException {
+        public Bounds getTestArea() throws IllegalDataException, IOException {
             if (testArea == null) {
                 testArea = getOsmDataSet().getDataSourceBounds().get(0);
Index: trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java	(revision 15033)
+++ trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java	(revision 15034)
@@ -7,7 +7,8 @@
 import java.awt.image.BufferedImage;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 
 import javax.imageio.ImageIO;
@@ -80,8 +81,8 @@
         StyledMapRenderer.PREFERENCE_TEXT_ANTIALIASING.put("gasp");
 
-        try (InputStream fisR = new FileInputStream("data_nodist/restriction.osm");
-                InputStream fisM = new FileInputStream("data_nodist/multipolygon.osm");
-                InputStream fisC = Compression.getUncompressedFileInputStream(new File("data_nodist/neubrandenburg.osm.bz2"));
-                InputStream fisO = Compression.getUncompressedFileInputStream(new File("data_nodist/overpass-download.osm.bz2"));) {
+        try (InputStream fisR = Files.newInputStream(Paths.get("data_nodist/restriction.osm"));
+             InputStream fisM = Files.newInputStream(Paths.get("data_nodist/multipolygon.osm"));
+             InputStream fisC = Compression.getUncompressedFileInputStream(new File("data_nodist/neubrandenburg.osm.bz2"));
+             InputStream fisO = Compression.getUncompressedFileInputStream(new File("data_nodist/overpass-download.osm.bz2"));) {
             dsRestriction = OsmReader.parseDataSet(fisR, NullProgressMonitor.INSTANCE);
             dsMultipolygon = OsmReader.parseDataSet(fisM, NullProgressMonitor.INSTANCE);
Index: trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 15034)
@@ -4,5 +4,6 @@
 import static org.junit.Assert.assertEquals;
 
-import java.io.FileInputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Collection;
 import java.util.Map;
@@ -74,5 +75,5 @@
     @Test
     public void testCreate1() throws Exception {
-        DataSet ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
+        DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Pair<SequenceCommand, Relation> mp = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), null);
         assertEquals("Sequence: Create multipolygon", mp.a.getDescriptionText());
@@ -82,5 +83,5 @@
     @Test
     public void testCreate2() throws Exception {
-        DataSet ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
+        DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=1 OR ref:1.1.", null, true);
         assertEquals("{1=outer, 1.1.1=inner, 1.1.2=inner}", getRefToRoleMap(mp).toString());
@@ -89,5 +90,5 @@
     @Test
     public void testUpdate1() throws Exception {
-        DataSet ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
+        DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=\".*1$\"", null, true);
         assertEquals(3, mp.getMembersCount());
@@ -100,5 +101,5 @@
     @Test
     public void testUpdate2() throws Exception {
-        DataSet ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
+        DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=1 OR ref:1.1.1", null, true);
         assertEquals("{1=outer, 1.1.1=inner}", getRefToRoleMap(mp).toString());
Index: trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 15034)
@@ -5,7 +5,8 @@
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Collection;
@@ -106,8 +107,8 @@
     public void testExamples() throws Exception {
         DataSet dsToJoin, dsExpected;
-        try (InputStream is = new FileInputStream("data_nodist/Join_Areas_Tests.osm")) {
+        try (InputStream is = Files.newInputStream(Paths.get("data_nodist/Join_Areas_Tests.osm"))) {
             dsToJoin = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
         }
-        try (InputStream is = new FileInputStream("data_nodist/Join_Areas_Tests_joined.osm")) {
+        try (InputStream is = Files.newInputStream(Paths.get("data_nodist/Join_Areas_Tests_joined.osm"))) {
             dsExpected = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
         }
Index: trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(revision 15034)
@@ -4,5 +4,7 @@
 import static org.junit.Assert.assertEquals;
 
-import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
@@ -97,5 +99,5 @@
 
     DataSet performTest(String... search) throws Exception {
-        try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "orthogonalize.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "orthogonalize.osm"))) {
             final DataSet ds = OsmReader.parseDataSet(in, null);
             // TODO: Executing commands depends on active edit layer
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java	(revision 15034)
@@ -6,6 +6,7 @@
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Collection;
@@ -73,5 +74,5 @@
         for (int i : new int[] {1, 2, 3, 11, 12, 13, 14, 15}) {
             DataSet ds;
-            try (InputStream is = new FileInputStream("data_nodist/filterTests.osm")) {
+            try (InputStream is = Files.newInputStream(Paths.get("data_nodist/filterTests.osm"))) {
                 ds = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE);
             }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 15034)
@@ -4,6 +4,7 @@
 import static org.openstreetmap.josm.TestUtils.getPrivateField;
 
-import java.io.FileInputStream;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.security.SecureRandom;
 import java.util.ArrayList;
@@ -84,5 +85,5 @@
     public void testRemove() throws Exception {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
-        try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) {
+        try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/restriction.osm"))) {
             DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
             removeAllTest(ds);
@@ -97,5 +98,5 @@
     public void testMove() throws Exception {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
-        try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) {
+        try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/restriction.osm"))) {
             DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
 
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 15034)
@@ -5,6 +5,4 @@
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -15,4 +13,6 @@
 import java.lang.reflect.Method;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.security.SecureRandom;
 import java.util.ArrayList;
@@ -121,5 +121,5 @@
         }
         try (BufferedReader in = new BufferedReader(new InputStreamReader(
-                new FileInputStream(REFERENCE_DATA_FILE), StandardCharsets.UTF_8))) {
+                Files.newInputStream(Paths.get(REFERENCE_DATA_FILE)), StandardCharsets.UTF_8))) {
             String line;
             Pattern projPattern = Pattern.compile("<(.+?)>(.*)<>");
@@ -357,5 +357,5 @@
         }
         try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
-                new FileOutputStream(REFERENCE_DATA_FILE), StandardCharsets.UTF_8))) {
+                Files.newOutputStream(Paths.get(REFERENCE_DATA_FILE)), StandardCharsets.UTF_8))) {
             for (Map.Entry<String, RefEntry> e : refsMap.entrySet()) {
                 RefEntry ref = e.getValue();
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 15034)
@@ -5,11 +5,11 @@
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.security.SecureRandom;
 import java.util.ArrayList;
@@ -89,5 +89,5 @@
         Random rand = new SecureRandom();
         try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
-                new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
+                Files.newOutputStream(Paths.get(PROJECTION_DATA_FILE)), StandardCharsets.UTF_8))) {
             out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n");
             out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n");
@@ -114,5 +114,5 @@
 
     private static List<TestData> readData() throws IOException, FileNotFoundException {
-        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE),
+        try (BufferedReader in = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get(PROJECTION_DATA_FILE)),
                 StandardCharsets.UTF_8))) {
             List<TestData> result = new ArrayList<>();
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java	(revision 15034)
@@ -5,8 +5,9 @@
 import static org.junit.Assert.assertThat;
 
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 
 import org.junit.Before;
@@ -45,5 +46,5 @@
     @Test
     public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException {
-        try (InputStream fis = new FileInputStream("data_nodist/UnconnectedWaysTest.osm")) {
+        try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/UnconnectedWaysTest.osm"))) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
             bib.visit(ds.allPrimitives());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java	(revision 15034)
@@ -6,6 +6,7 @@
 import static org.junit.Assert.fail;
 
-import java.io.FileInputStream;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -35,5 +36,5 @@
             Function<DataSet, Iterable<T>> provider, Predicate<String> namePredicate,
             Test... tests) throws Exception {
-        try (InputStream is = new FileInputStream(sampleFile)) {
+        try (InputStream is = Files.newInputStream(Paths.get(sampleFile))) {
             for (T t: provider.apply(OsmReader.parseDataSet(is, null))) {
                 String name = DefaultNameFormatter.getInstance().format(t);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(revision 15034)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.relation.sort;
 
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.List;
 
@@ -44,5 +45,5 @@
     public void loadData() throws IllegalDataException, IOException {
         if (testDataset == null) {
-            try (InputStream fis = new FileInputStream("data_nodist/relation_sort.osm")) {
+            try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/relation_sort.osm"))) {
                 testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
             }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(revision 15034)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.relation.sort;
 
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -46,5 +47,5 @@
     public void loadData() throws IllegalDataException, IOException {
         if (testDataset == null) {
-            try (InputStream fis = new FileInputStream("data_nodist/relation_sort.osm")) {
+            try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/relation_sort.osm"))) {
                 testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
             }
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(revision 15034)
@@ -6,5 +6,6 @@
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 
@@ -188,5 +189,5 @@
     @Test
     public void testContains() throws Exception {
-        ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/amenity-in-amenity.osm"), null);
+        ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get("data_nodist/amenity-in-amenity.osm")), null);
         ChildOrParentSelector css = parse("node[tag(\"amenity\") = parent_tag(\"amenity\")] ∈ *[amenity] {}");
         assertTrue(css.matches(new Environment(ds.getPrimitiveById(123, OsmPrimitiveType.WAY))));
Index: trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(revision 15034)
@@ -5,5 +5,7 @@
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 
@@ -113,5 +115,5 @@
     @Test
     public void testMultipolygon() throws Exception {
-        try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "multipolygon.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
             final GeoJSONWriter writer = new GeoJSONWriter(ds);
@@ -126,5 +128,5 @@
     @Test
     public void testMultipolygonRobustness() throws Exception {
-        try (FileInputStream in = new FileInputStream("data_nodist/multipolygon.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get("data_nodist/multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
             final GeoJSONWriter writer = new GeoJSONWriter(ds);
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java	(revision 15034)
@@ -9,7 +9,8 @@
 
 import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 
 import org.junit.Rule;
@@ -59,5 +60,5 @@
         OsmReader.deregisterPostprocessor(unregistered);
 
-        try (InputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "empty.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "empty.osm"))) {
             OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
             assertTrue(registered.called);
Index: trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java	(revision 15034)
@@ -7,7 +7,8 @@
 
 import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -61,5 +62,5 @@
     public void testReader() throws Exception {
         TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));
-        final NmeaReader in = new NmeaReader(new FileInputStream("data_nodist/btnmeatrack_2016-01-25.nmea"));
+        final NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get("data_nodist/btnmeatrack_2016-01-25.nmea")));
         in.parse(true);
         assertEquals(30, in.getNumberOfCoordinates());
@@ -87,5 +88,5 @@
     private static void compareWithReference(int ticket, String filename, int numCoor) throws IOException, SAXException {
         GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(ticket, filename+".gpx"));
-        NmeaReader in = new NmeaReader(new FileInputStream(TestUtils.getRegressionDataFile(ticket, filename+".nmea")));
+        NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get(TestUtils.getRegressionDataFile(ticket, filename+".nmea"))));
         in.parse(true);
         assertEquals(numCoor, in.getNumberOfCoordinates());
Index: trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java	(revision 15033)
+++ trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java	(revision 15034)
@@ -7,5 +7,7 @@
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
@@ -78,5 +80,5 @@
     @Test
     public void testClosedWayArea() throws Exception {
-        try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
             Way closedWay = (Way) SubclassFilteredCollection.filter(ds.allPrimitives(),
@@ -94,5 +96,5 @@
     @Test
     public void testMultipolygonArea() throws Exception {
-        try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "multipolygon.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
             final Relation r = ds.getRelations().iterator().next();
@@ -109,5 +111,5 @@
     @Test
     public void testAreaAndPerimeter() throws Exception {
-        try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm")) {
+        try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
             Way closedWay = (Way) SubclassFilteredCollection.filter(ds.allPrimitives(),
