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) + "...";
         }
