Index: /applications/editors/josm/plugins/cadastre-fr/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/.checkstyle	(revision 32556)
+++ /applications/editors/josm/plugins/cadastre-fr/.checkstyle	(revision 32556)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value="src/com"/>
+    <filter-data value="src/gnu"/>
+    <filter-data value="src/javax"/>
+    <filter-data value="src/oauth"/>
+    <filter-data value="src/org/apache"/>
+    <filter-data value="src/org/glassfish"/>
+    <filter-data value="src/org/jdesktop"/>
+    <filter-data value="src/org/openstreetmap/gui"/>
+    <filter-data value="src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen"/>
+    <filter-data value="src/org/w3"/>
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: /applications/editors/josm/plugins/cadastre-fr/.project
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/.project	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/.project	(revision 32556)
@@ -17,8 +17,14 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.sonarlint.eclipse.core.sonarlintNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: /applications/editors/josm/plugins/cadastre-fr/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/.settings/org.eclipse.jdt.ui.prefs	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/.settings/org.eclipse.jdt.ui.prefs	(revision 32556)
@@ -37,10 +37,10 @@
 sp_cleanup.remove_private_constructors=true
 sp_cleanup.remove_redundant_type_arguments=true
-sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces=true
 sp_cleanup.remove_trailing_whitespaces_all=true
 sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
 sp_cleanup.remove_unnecessary_casts=true
 sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_imports=true
 sp_cleanup.remove_unused_local_variables=false
 sp_cleanup.remove_unused_private_fields=true
Index: /applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 32556)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Changed constructor for Plugin"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10279"/>
+    <property name="plugin.main.version" value="10420"/>
     
     <!-- Configure these properties (replace "..." accordingly).
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 32556)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -113,5 +114,5 @@
 //        dialog.setVisible(false);
         // kill the window completely to fix an issue on some linux distro and full screen mode.
-        if(dialog != null) {
+        if (dialog != null) {
             dialog.dispose();
             dialog = null;
@@ -156,5 +157,5 @@
                 }
                 if (currentMouseNode.get(tagHouseStreet) != null) {
-                    if(Main.pref.getBoolean("cadastrewms.addr.dontUseRelation", false)) {
+                    if (Main.pref.getBoolean("cadastrewms.addr.dontUseRelation", false)) {
                         inputStreet.setText(currentMouseNode.get(tagHouseStreet));
                         if (ctrl) {
@@ -164,5 +165,5 @@
                                 applyInputNumberChange();
                         }
-                        setSelectedWay((Way)null);
+                        setSelectedWay((Way) null);
                     }
                 } else {
@@ -184,5 +185,5 @@
         } else {
             List<WaySegment> wss = mv.getNearestWaySegments(mousePos, OsmPrimitive.isSelectablePredicate);
-            for(WaySegment ws : wss) {
+            for (WaySegment ws : wss) {
                 if (ws.way.get(tagHighway) != null && ws.way.get(tagHighwayName) != null)
                     mouseOnExistingWays.add(ws.way);
@@ -220,9 +221,9 @@
         for (OsmPrimitive osm : l) {
             if (osm instanceof Relation && osm.hasKey("type") && osm.get("type").equals(relationAddrType)) {
-                for (RelationMember rm : ((Relation)osm).getMembers()) {
+                for (RelationMember rm : ((Relation) osm).getMembers()) {
                     if (rm.getRole().equals(relationAddrStreetRole)) {
                         OsmPrimitive osp = rm.getMember();
                         if (osp instanceof Way && osp.hasKey(tagHighwayName)) {
-                            return (Way)osp;
+                            return (Way) osp;
                         }
                     }
@@ -264,5 +265,5 @@
         for (OsmPrimitive osm : l) {
             if (osm instanceof Relation && osm.hasKey("type") && osm.get("type").equals(relationAddrType)) {
-                return (Relation)osm;
+                return (Relation) osm;
             }
         }
@@ -310,5 +311,5 @@
             is.add(ws.lowerIndex);
         }
-        Set<Pair<Node,Node>> segSet = new HashSet<>();
+        Set<Pair<Node, Node>> segSet = new HashSet<>();
         ArrayList<Way> replacedWays = new ArrayList<>();
         ArrayList<Way> reuseWays = new ArrayList<>();
@@ -333,5 +334,5 @@
     }
 
-    private static void adjustNode(Collection<Pair<Node,Node>> segs, Node n) {
+    private static void adjustNode(Collection<Pair<Node, Node>> segs, Node n) {
 
         switch (segs.size()) {
@@ -341,6 +342,6 @@
             // This computes the intersection between
             // the two segments and adjusts the node position.
-            Iterator<Pair<Node,Node>> i = segs.iterator();
-            Pair<Node,Node> seg = i.next();
+            Iterator<Pair<Node, Node>> i = segs.iterator();
+            Pair<Node, Node> seg = i.next();
             EastNorth A = seg.a.getEastNorth();
             EastNorth B = seg.b.getEastNorth();
@@ -349,5 +350,5 @@
             EastNorth D = seg.b.getEastNorth();
 
-            double u=det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north());
+            double u = det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north());
 
             // Check for parallel segments and do nothing if they are
@@ -366,5 +367,5 @@
 
             int snapToIntersectionThreshold
-            = Main.pref.getInteger("edit.snap-intersection-threshold",10);
+            = Main.pref.getInteger("edit.snap-intersection-threshold", 10);
 
             // only adjust to intersection if within snapToIntersectionThreshold pixel of mouse click; otherwise
@@ -462,5 +463,5 @@
                 inputNumber.setText("");
                 inputStreet.setText("");
-                setSelectedWay((Way)null);
+                setSelectedWay((Way) null);
             }
         });
@@ -495,7 +496,9 @@
                 Main.pref.put("cadastrewms.addr.bounds", dialog.getX()+","+dialog.getY()+","+dialog.getWidth()+","+dialog.getHeight());
             }
+
             @Override public void componentMoved(ComponentEvent e) {
                 rememberGeometry();
             }
+
             @Override public void componentResized(ComponentEvent e) {
                 rememberGeometry();
@@ -506,12 +509,12 @@
             public void windowClosing(WindowEvent arg) {
                 exitMode();
-                Main.map.selectMapMode((MapMode)Main.map.getDefaultButtonAction());
+                Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
             }
         });
-        String bounds = Main.pref.get("cadastrewms.addr.bounds",null);
+        String bounds = Main.pref.get("cadastrewms.addr.bounds", null);
         if (bounds != null) {
             String[] b = bounds.split(",");
             dialog.setBounds(new Rectangle(
-                    Integer.parseInt(b[0]),Integer.parseInt(b[1]),Integer.parseInt(b[2]),Integer.parseInt(b[3])));
+                    Integer.parseInt(b[0]), Integer.parseInt(b[1]), Integer.parseInt(b[2]), Integer.parseInt(b[3])));
         }
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -42,4 +42,5 @@
             super(out);
         }
+
         @Override
         protected void writeStreamHeader() throws IOException {
@@ -88,10 +89,10 @@
             for (int i = 0; i < files.length; i++) {
                 size += files[i].length();
-                if (files[i].lastModified() <  oldestFileDate) {
+                if (files[i].lastModified() < oldestFileDate) {
                     oldestFile = i;
                     oldestFileDate = files[i].lastModified();
                 }
             }
-            if (size > (long)cacheSize*1024*1024) {
+            if (size > (long) cacheSize*1024*1024) {
                 Main.info("Delete oldest file  \""+ files[oldestFile].getName()
                         + "\" in cache dir to stay under the limit of " + cacheSize + " MB.");
@@ -120,5 +121,5 @@
                     CadastrePlugin.prepareDialog(dialog);
                     dialog.setVisible(true);
-                    return (Integer)pane.getValue();
+                    return (Integer) pane.getValue();
                     // till here
                 }
@@ -142,6 +143,7 @@
         if (file.exists())
             file.delete();
-        while (file.exists()) // wait until file is really gone (otherwise appends to existing one)
+        while (file.exists()) { // wait until file is really gone (otherwise appends to existing one)
             CadastrePlugin.safeSleep(500);
+        }
     }
 
@@ -158,5 +160,5 @@
                 @Override
                 public void run() {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."), 
+                    JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."),
                             tr("Error"), JOptionPane.ERROR_MESSAGE);
                 }
@@ -193,5 +195,5 @@
                         try (ObjectOutputStreamAppend oos = new ObjectOutputStreamAppend(
                                 new BufferedOutputStream(new FileOutputStream(file, true)))) {
-                            for (int i=0; i < size; i++) {
+                            for (int i = 0; i < size; i++) {
                                 oos.writeObject(imagesToSave.get(i));
                             }
@@ -201,5 +203,5 @@
                                 new BufferedOutputStream(new FileOutputStream(file)))) {
                             wmsLayer.write(file, oos);
-                            for (int i=0; i < size; i++) {
+                            for (int i = 0; i < size; i++) {
                                 oos.writeObject(imagesToSave.get(i));
                             }
@@ -210,10 +212,12 @@
                 }
                 imagesLock.lock();
-                for (int i=0; i < size; i++) {
+                for (int i = 0; i < size; i++) {
                     imagesToSave.remove(0);
                 }
                 imagesLock.unlock();
             }
-            try {wait();} catch (InterruptedException e) {
+            try {
+                wait();
+            } catch (InterruptedException e) {
                 Main.error(e);
             }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert4ZoneFilter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert4ZoneFilter.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert4ZoneFilter.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -35,7 +35,8 @@
     public boolean acceptName(String filename) {
         String name = filename.toLowerCase(Locale.FRANCE);
-        for (String ext : extension.split(","))
+        for (String ext : extension.split(",")) {
             if (name.endsWith("." + ext))
                 return true;
+        }
         return false;
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert9ZoneFilter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert9ZoneFilter.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileLambert9ZoneFilter.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -8,5 +8,5 @@
 import javax.swing.filechooser.FileFilter;
 
-public class CacheFileLambert9ZoneFilter extends FileFilter {
+public final class CacheFileLambert9ZoneFilter extends FileFilter {
 
     /**
@@ -17,13 +17,13 @@
 
     public static CacheFileLambert9ZoneFilter[] filters = {
-        new CacheFileLambert9ZoneFilter("cc1", tr("Lambert CC9 Zone {0} cache file (.CC{0})",1)),
-        new CacheFileLambert9ZoneFilter("cc2", tr("Lambert CC9 Zone {0} cache file (.CC{0})",2)),
-        new CacheFileLambert9ZoneFilter("cc3", tr("Lambert CC9 Zone {0} cache file (.CC{0})",3)),
-        new CacheFileLambert9ZoneFilter("cc4", tr("Lambert CC9 Zone {0} cache file (.CC{0})",4)),
-        new CacheFileLambert9ZoneFilter("cc5", tr("Lambert CC9 Zone {0} cache file (.CC{0})",5)),
-        new CacheFileLambert9ZoneFilter("cc6", tr("Lambert CC9 Zone {0} cache file (.CC{0})",6)),
-        new CacheFileLambert9ZoneFilter("cc7", tr("Lambert CC9 Zone {0} cache file (.CC{0})",7)),
-        new CacheFileLambert9ZoneFilter("cc8", tr("Lambert CC9 Zone {0} cache file (.CC{0})",8)),
-        new CacheFileLambert9ZoneFilter("cc9", tr("Lambert CC9 Zone {0} cache file (.CC{0})",9))
+        new CacheFileLambert9ZoneFilter("cc1", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 1)),
+        new CacheFileLambert9ZoneFilter("cc2", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 2)),
+        new CacheFileLambert9ZoneFilter("cc3", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 3)),
+        new CacheFileLambert9ZoneFilter("cc4", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 4)),
+        new CacheFileLambert9ZoneFilter("cc5", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 5)),
+        new CacheFileLambert9ZoneFilter("cc6", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 6)),
+        new CacheFileLambert9ZoneFilter("cc7", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 7)),
+        new CacheFileLambert9ZoneFilter("cc8", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 8)),
+        new CacheFileLambert9ZoneFilter("cc9", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 9))
         };
 
@@ -39,7 +39,8 @@
     public boolean acceptName(String filename) {
         String name = filename.toLowerCase();
-        for (String ext : extension.split(","))
+        for (String ext : extension.split(",")) {
             if (name.endsWith("." + ext))
                 return true;
+        }
         return false;
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileUTM20NFilter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileUTM20NFilter.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileUTM20NFilter.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -8,5 +8,5 @@
 import javax.swing.filechooser.FileFilter;
 
-public class CacheFileUTM20NFilter extends FileFilter {
+public final class CacheFileUTM20NFilter extends FileFilter {
 
     /**
@@ -34,7 +34,8 @@
     public boolean acceptName(String filename) {
         String name = filename.toLowerCase();
-        for (String ext : extension.split(","))
+        for (String ext : extension.split(",")) {
             if (name.endsWith("." + ext))
                 return true;
+        }
         return false;
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -54,5 +54,5 @@
         str += wmsLayer.eastNorth2raster(lambertMin, lambertMax);
         str += "&width="+cRasterX+"&height="; // maximum allowed by wms server (576/345, 800/378, 1000/634)
-        str += (int)(cRasterX*(wmsLayer.communeBBox.max.getY() - wmsLayer.communeBBox.min.getY())/(wmsLayer.communeBBox.max.getX() - wmsLayer.communeBBox.min.getX()));
+        str += (int) (cRasterX*(wmsLayer.communeBBox.max.getY() - wmsLayer.communeBBox.min.getY())/(wmsLayer.communeBBox.max.getX() - wmsLayer.communeBBox.min.getX()));
         str += "&exception=application/vnd.ogc.se_inimage&styles="; // required for raster images
         Main.info("URL="+str);
@@ -84,5 +84,5 @@
 
     private BufferedImage grab(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
+        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
         wmsInterface.urlConn.setRequestProperty("Connection", "close");
         wmsInterface.urlConn.setRequestMethod("GET");
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -49,4 +49,5 @@
         }
     }
+
     private List<PlanImage> listOfFeuilles = new ArrayList<>();
     private long cookieTimestamp;
@@ -109,5 +110,4 @@
      * @return true if a cookie is delivered by WMS and false is WMS is not opening a client session
      *         (too many clients or in maintenance)
-     * @throws IOException
      */
     private void getCookie() throws IOException {
@@ -117,5 +117,5 @@
             searchFormURL = new URL(BASE_URL + "/scpc/accueil.do");
             while (!success && retries > 0) {
-                urlConn = (HttpURLConnection)searchFormURL.openConnection();
+                urlConn = (HttpURLConnection) searchFormURL.openConnection();
                 urlConn.setRequestProperty("Connection", "close");
                 urlConn.setRequestMethod("GET");
@@ -124,5 +124,5 @@
                     Main.info("GET "+searchFormURL);
                     BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream(), StandardCharsets.UTF_8));
-                    while(in.readLine() != null) {
+                    while (in.readLine() != null) {
                         // read the buffer otherwise we sent POST too early
                     }
@@ -132,13 +132,13 @@
                     CookieHandler cookieHandler = CookieHandler.getDefault();
                     if (cookieHandler != null) {
-                        if (handleCookie(cookieHandler.get(searchFormURL.toURI(), new HashMap<String,List<String>>()).get("Cookie").get(0))) {
+                        if (handleCookie(cookieHandler.get(searchFormURL.toURI(), new HashMap<String, List<String>>()).get("Cookie").get(0))) {
                             break;
                         }
                     } else {
                         String headerName;
-                        for (int i=1; (headerName = urlConn.getHeaderFieldKey(i))!=null; i++) {
+                        for (int i = 1; (headerName = urlConn.getHeaderFieldKey(i)) != null; i++) {
                             if ("Set-Cookie".equals(headerName) && handleCookie(urlConn.getHeaderField(i))) {
                                 break;
-                            } 
+                            }
                         }
                     }
@@ -146,5 +146,5 @@
                     Main.warn("Request to home page failed. Http error:"+urlConn.getResponseCode()+". Try again "+retries+" times");
                     CadastrePlugin.safeSleep(3000);
-                    retries --;
+                    retries--;
                 }
             }
@@ -238,9 +238,9 @@
     }
 
-    private void openInterface() throws IOException  {
+    private void openInterface() throws IOException {
         try {
             // finally, open the interface on server side giving access to the wms server
             URL interfaceURL = new URL(BASE_URL + "/scpc/"+interfaceRef);
-            urlConn = (HttpURLConnection)interfaceURL.openConnection();
+            urlConn = (HttpURLConnection) interfaceURL.openConnection();
             urlConn.setRequestMethod("GET");
             setCookie();
@@ -283,8 +283,5 @@
      * where QP224 is the code commune known by the WMS (or "afficherCarteTa.do?c=..." for raster images).
      *
-     * @param location
-     * @param codeCommune
      * @return retURL url to available code commune in the cadastre; "" if not found
-     * @throws IOException
      */
     private String postForm(WMSLayer wmsLayer, String codeCommune) throws IOException {
@@ -308,5 +305,5 @@
             content += "&x=0&y=0";
             searchFormURL = new URL(BASE_URL + "/scpc/rechercherPlan.do");
-            urlConn = (HttpURLConnection)searchFormURL.openConnection();
+            urlConn = (HttpURLConnection) searchFormURL.openConnection();
             urlConn.setRequestMethod("POST");
             urlConn.setDoOutput(true);
@@ -335,5 +332,5 @@
                 if (!wmsLayer.isRaster() && lines.indexOf(C_INTERFACE_VECTOR) != -1) {  // "afficherCarteCommune.do"
                     // shall be something like: interfaceRef = "afficherCarteCommune.do?c=X2269";
-                    lines = lines.substring(lines.indexOf(C_INTERFACE_VECTOR),lines.length());
+                    lines = lines.substring(lines.indexOf(C_INTERFACE_VECTOR), lines.length());
                     lines = lines.substring(0, lines.indexOf('\''));
                     lines = Entities.unescape(lines);
@@ -369,5 +366,5 @@
         } catch (MalformedURLException e) {
             throw (IOException) new IOException("Illegal url.").initCause(e);
-        } catch (DuplicateLayerException e){
+        } catch (DuplicateLayerException e) {
             Main.error(e);
         }
@@ -401,5 +398,5 @@
         try {
             URL getAllImagesURL = new URL(BASE_URL + "/scpc/listerFeuillesParcommune.do?keepVolatileSession=&offset=2000");
-            urlConn2 = (HttpURLConnection)getAllImagesURL.openConnection();
+            urlConn2 = (HttpURLConnection) getAllImagesURL.openConnection();
             setCookie(urlConn2);
             urlConn2.connect();
@@ -491,5 +488,4 @@
      * and store the result in the wmsLayer as well.
      * @param wmsLayer the WMSLayer where the commune data and images are stored
-     * @throws IOException
      */
     public void retrieveCommuneBBox(WMSLayer wmsLayer) throws IOException {
@@ -500,5 +496,5 @@
         content += "&dontSaveLastForward&keepVolatileSession=";
         searchFormURL = new URL(content);
-        urlConn = (HttpURLConnection)searchFormURL.openConnection();
+        urlConn = (HttpURLConnection) searchFormURL.openConnection();
         urlConn.setRequestMethod("GET");
         setCookie();
@@ -534,5 +530,5 @@
             int l = input.indexOf(C_BBOX_COMMUN_END, k+1);
             double maxy = Double.parseDouble(input.substring(k+1, l));
-            wmsLayer.setCommuneBBox( new EastNorthBound(new EastNorth(minx,miny), new EastNorth(maxx,maxy)));
+            wmsLayer.setCommuneBBox(new EastNorthBound(new EastNorth(minx, miny), new EastNorth(maxx, maxy)));
         }
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -46,6 +46,6 @@
  * a city/town/village code.
  *
- * @author Pieren <pieren3@gmail.com>,
- *         <matthieu.lochegnies@gmail.com> for the extension to codeCommune
+ * @author Pieren &lt;pieren3@gmail.com&gt;,
+ *         &lt;matthieu.lochegnies@gmail.com&gt; for the extension to codeCommune
  *
  * @version 2.6
@@ -171,5 +171,5 @@
     public static String grabLayers, grabStyles = null;
 
-    static private boolean menuEnabled = false;
+    private static boolean menuEnabled = false;
 
     private static String LAYER_BULDINGS = "CDIF:LS2";
@@ -204,5 +204,5 @@
             cacheDir = Main.pref.get("cadastrewms.cacheDir");
         }
-        if (cacheDir.charAt(cacheDir.length()-1) != File.separatorChar )
+        if (cacheDir.charAt(cacheDir.length()-1) != File.separatorChar)
             cacheDir += File.separatorChar;
         Main.info("current cache directory: "+cacheDir);
@@ -212,5 +212,5 @@
         UploadAction.registerUploadHook(new CheckSourceUploadHook());
 
-        registerSessionLayerExporter(WMSLayer.class , CadastreSessionExporter.class);
+        registerSessionLayerExporter(WMSLayer.class, CadastreSessionExporter.class);
         registerSessionLayerImporter("cadastre-fr", CadastreSessionImporter.class);
     }
@@ -277,5 +277,5 @@
         if (currentResolution.equals("high")) {
             imageWidth = 1000; imageHeight = 800;
-        } else if (currentResolution.equals("medium")){
+        } else if (currentResolution.equals("medium")) {
             imageWidth = 800; imageHeight = 600;
         } else {
@@ -339,5 +339,5 @@
             grabStyles = grabStyles.substring(0, grabStyles.length()-1);
         } else {
-            JOptionPane.showMessageDialog(Main.parent,tr("Please enable at least two WMS layers in the cadastre-fr "
+            JOptionPane.showMessageDialog(Main.parent, tr("Please enable at least two WMS layers in the cadastre-fr "
                     + "plugin configuration.\nLayers ''Building'' and ''Parcel'' added by default."));
             Main.pref.put("cadastrewms.layerBuilding", true);
@@ -430,5 +430,7 @@
         try {
             Thread.sleep(milliseconds);
-        } catch (InterruptedException e) {}
+        } catch (InterruptedException e) {
+            Main.debug(e);
+        }
     }
 
@@ -439,5 +441,5 @@
             try {
                 dialog.setAlwaysOnTop(true);
-            } catch(SecurityException e) {
+            } catch (SecurityException e) {
                 Main.warn(tr("Warning: failed to put option pane dialog always on top. Exception was: {0}", e.toString()));
             }
@@ -457,5 +459,5 @@
         if (Main.map != null && Main.map.mapView != null) {
             int wmsNewLayerPos = Main.getLayerManager().getLayers().size();
-            for(Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) {
+            for (Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) {
                 int wmsPos = Main.getLayerManager().getLayers().indexOf(l);
                 if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos;
@@ -477,5 +479,7 @@
         try {
             year = Integer.decode(srcYear);
-        } catch (NumberFormatException e) {}
+        } catch (NumberFormatException e) {
+            Main.debug(e);
+        }
         if (srcYear.equals("AAAA") || (year != null && year < currentYear)) {
             Main.info("Replace source year "+srcYear+" by current year "+currentYear);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -7,5 +7,19 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import javax.swing.*;
+
+import javax.swing.AbstractButton;
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
 
 import org.openstreetmap.josm.Main;
@@ -19,5 +33,5 @@
  * Preference settings for the French Cadastre plugin
  *
- * @author Pieren <pieren3@gmail.com>
+ * @author Pieren &lt;pieren3@gmail.com&gt;
  */
 public class CadastrePreferenceSetting extends DefaultTabPreferenceSetting {
@@ -42,5 +56,5 @@
 
     private JCheckBox enableTableauAssemblage = new JCheckBox(tr("Use \"Tableau d''assemblage\""));
-    
+
     private JCheckBox simplify2BitsColors = new JCheckBox(tr("Replace grey shades by white color only"));
 
@@ -92,5 +106,5 @@
 
     static final int DEFAULT_CROSSPIECES = 0;
-    
+
     static final String DEFAULT_GRAB_MULTIPLIER = Scale.SQUARE_100M.value;
 
@@ -108,9 +122,10 @@
     }
 
+    @Override
     public void addGui(final PreferenceTabbedPane gui) {
         JPanel cadastrewmsMast = gui.createPreferenceTab(this);
 
         JPanel cadastrewms = new JPanel(new GridBagLayout());
-        cadastrewms.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
+        cadastrewms.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
 
         // option to automatically set the source tag when uploading
@@ -128,9 +143,11 @@
         // option to reverse the grey colors (to see texts background)
         reversGrey.setSelected(Main.pref.getBoolean("cadastrewms.invertGrey", false));
-        reversGrey.setToolTipText(tr("Invert the original black and white colors (and all intermediate greys). Useful for texts on dark backgrounds."));
+        reversGrey.setToolTipText(
+                tr("Invert the original black and white colors (and all intermediate greys). Useful for texts on dark backgrounds."));
         cadastrewms.add(reversGrey, GBC.eop().insets(0, 0, 0, 0));
 
         // option to enable transparency
         transparency.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
                 sliderTrans.setEnabled(transparency.isSelected());
@@ -146,5 +163,5 @@
         sliderTrans.setMajorTickSpacing(10);
         sliderTrans.setMinorTickSpacing(1);
-        sliderTrans.setValue((int)(Float.parseFloat(Main.pref.get("cadastrewms.brightness", "1.0f"))*10));
+        sliderTrans.setValue((int) (Float.parseFloat(Main.pref.get("cadastrewms.brightness", "1.0f"))*10));
         sliderTrans.setPaintTicks(true);
         sliderTrans.setPaintLabels(false);
@@ -201,4 +218,5 @@
         ButtonGroup bgGrabMultiplier = new ButtonGroup();
         ActionListener multiplierActionListener = new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent actionEvent) {
               AbstractButton button = (AbstractButton) actionEvent.getSource();
@@ -208,17 +226,17 @@
         grabMultiplier1.setIcon(ImageProvider.get("preferences", "unsel_box_1"));
         grabMultiplier1.setSelectedIcon(ImageProvider.get("preferences", "sel_box_1"));
-        grabMultiplier1.addActionListener( multiplierActionListener);
+        grabMultiplier1.addActionListener(multiplierActionListener);
         grabMultiplier1.setToolTipText(tr("Grab one image full screen"));
         grabMultiplier2.setIcon(ImageProvider.get("preferences", "unsel_box_2"));
         grabMultiplier2.setSelectedIcon(ImageProvider.get("preferences", "sel_box_2"));
-        grabMultiplier2.addActionListener( multiplierActionListener);
+        grabMultiplier2.addActionListener(multiplierActionListener);
         grabMultiplier2.setToolTipText(tr("Grab smaller images (higher quality but use more memory)"));
         grabMultiplier3.setIcon(ImageProvider.get("preferences", "unsel_box_3"));
         grabMultiplier3.setSelectedIcon(ImageProvider.get("preferences", "sel_box_3"));
-        grabMultiplier3.addActionListener( multiplierActionListener);
+        grabMultiplier3.addActionListener(multiplierActionListener);
         grabMultiplier3.setToolTipText(tr("Grab smaller images (higher quality but use more memory)"));
         grabMultiplier4.setIcon(ImageProvider.get("preferences", "unsel_box_4"));
         grabMultiplier4.setSelectedIcon(ImageProvider.get("preferences", "sel_box_4"));
-        grabMultiplier4.addActionListener( multiplierActionListener);
+        grabMultiplier4.addActionListener(multiplierActionListener);
         grabMultiplier4.setToolTipText(tr("Fixed size square (default is 100m)"));
         bgGrabMultiplier.add(grabMultiplier1);
@@ -321,4 +339,5 @@
         // option to enable automatic caching
         enableCache.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
                 jLabelCacheSize.setEnabled(enableCache.isSelected());
@@ -356,8 +375,9 @@
         cadastrewms.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
         JScrollPane scrollpane = new JScrollPane(cadastrewms);
-        scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
+        scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
         cadastrewmsMast.add(scrollpane, GBC.eol().fill(GBC.BOTH));
     }
 
+    @Override
     public boolean ok() {
         Main.pref.put("cadastrewms.source", sourcing.getText());
@@ -366,5 +386,5 @@
         Main.pref.put("cadastrewms.invertGrey", reversGrey.isSelected());
         Main.pref.put("cadastrewms.backgroundTransparent", transparency.isSelected());
-        Main.pref.put("cadastrewms.brightness", Float.toString((float)sliderTrans.getValue()/10));
+        Main.pref.put("cadastrewms.brightness", Float.toString((float) sliderTrans.getValue()/10));
         Main.pref.put("cadastrewms.drawBoundaries", drawBoundaries.isSelected());
         if (grabRes1.isSelected())
@@ -392,5 +412,6 @@
                 if (squareSize >= 25 && squareSize <= 1000)
                     Main.pref.put("cadastrewms.squareSize", grabMultiplier4Size.getText());
-            } catch (NumberFormatException e) { // ignore the last input
+            } catch (NumberFormatException e) {
+                Main.debug(e);
             }
         }
@@ -408,5 +429,6 @@
             if (i > 0 && i < 13)
                 Main.pref.put("cadastrewms.rasterDivider", String.valueOf(i));
-        } catch (NumberFormatException e) { // ignore the last input
+        } catch (NumberFormatException e) {
+            Main.debug(e);
         }
         Main.pref.put("cadastrewms.noImageCropping", disableImageCropping.isSelected());
@@ -423,5 +445,6 @@
             CacheControl.cacheSize = Integer.parseInt(cacheSize.getText());
             Main.pref.put("cadastrewms.cacheSize", String.valueOf(CacheControl.cacheSize));
-        } catch (NumberFormatException e) { // ignore the last input
+        } catch (NumberFormatException e) {
+            Main.debug(e);
         }
         Main.pref.put("cadastrewms.autoFirstLayer", autoFirstLayer.isSelected());
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionExporter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionExporter.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionExporter.java	(revision 32556)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -44,5 +45,5 @@
         p.add(export, GBC.std());
         p.add(lbl, GBC.std());
-        p.add(GBC.glue(1,0), GBC.std().fill(GBC.HORIZONTAL));
+        p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));
         return p;
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionImporter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionImporter.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreSessionImporter.java	(revision 32556)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -20,5 +21,5 @@
 import org.w3c.dom.Element;
 
-public class CadastreSessionImporter implements SessionLayerImporter{
+public class CadastreSessionImporter implements SessionLayerImporter {
 
     @Override
@@ -41,6 +42,6 @@
             fileStr = URLDecoder.decode(fileStr, "UTF-8");
             fileStr = fileStr.substring(fileStr.indexOf(":/")+2);
-            String filename = fileStr.substring(fileStr.lastIndexOf('/')+1,fileStr.length());
-            String ext = (filename.lastIndexOf('.')==-1)?"":filename.substring(filename.lastIndexOf('.')+1,filename.length());
+            String filename = fileStr.substring(fileStr.lastIndexOf('/')+1, fileStr.length());
+            String ext = (filename.lastIndexOf('.') == -1) ? "" : filename.substring(filename.lastIndexOf('.')+1, filename.length());
             // create layer and load cache
             if (ext.length() == 3 && ext.substring(0, CacheControl.C_LAMBERT_CC_9Z.length()).equals(CacheControl.C_LAMBERT_CC_9Z))
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -30,12 +30,11 @@
  * automatically a tag "source"="Cadastre..." as defined in the plugin preferences.
  */
-public class CheckSourceUploadHook implements UploadHook
-{
+public class CheckSourceUploadHook implements UploadHook {
 
     /**
      * Add the tag "source" if it doesn't exist for all new Nodes and Ways before uploading
      */
-    public boolean checkUpload(APIDataSet apiDataSet)
-    {
+    @Override
+    public boolean checkUpload(APIDataSet apiDataSet) {
         if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !apiDataSet.getPrimitivesToAdd().isEmpty()) {
             Collection<OsmPrimitive> sel = new HashSet<>();
@@ -55,10 +54,9 @@
     /**
      * Check whenever one of the keys of the object is "source"
-     * @param OsmPrimitive
      * @return true if one of keys is "source"
      */
     private boolean tagSourceExist(OsmPrimitive osm) {
         for (String key : osm.keySet()) {
-            if (key.equals("source") ) {
+            if (key.equals("source")) {
                 return true;
             }
@@ -72,6 +70,5 @@
      * @param sel the list of elements added without a key "source"
      */
-    private void displaySource(Collection<OsmPrimitive> sel)
-    {
+    private void displaySource(Collection<OsmPrimitive> sel) {
         if (!sel.isEmpty()) {
             JPanel p = new JPanel(new GridBagLayout());
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -106,5 +106,5 @@
 
         // convert SVG nodes to eastNorth coordinates
-        for (int i=0; i< SVGpaths.length; i++) {
+        for (int i = 0; i < SVGpaths.length; i++) {
             ArrayList<EastNorth> eastNorth = new ArrayList<>();
             createNodes(SVGpaths[i], eastNorth);
@@ -147,9 +147,10 @@
                 for (Way w : svgDataSet.getWays()) {
                     int replaced = 0;
-                    for (Node node : w.getNodes())
+                    for (Node node : w.getNodes()) {
                         if (node == n) {
                             node = nearestNewNode;
                             replaced++;
                         }
+                    }
                     if (w.getNodesCount() == replaced)
                         w.setDeleted(true);
@@ -161,10 +162,12 @@
 
         Collection<Command> cmds = new LinkedList<>();
-        for (Node node : svgDataSet.getNodes())
+        for (Node node : svgDataSet.getNodes()) {
             if (!node.isDeleted())
                 cmds.add(new AddCommand(node));
-        for (Way way : svgDataSet.getWays())
+        }
+        for (Way way : svgDataSet.getWays()) {
             if (!way.isDeleted())
                 cmds.add(new AddCommand(way));
+        }
         Main.main.undoRedo.add(new SequenceCommand(tr("Create buildings"), cmds));
         Main.map.repaint();
@@ -176,12 +179,12 @@
         double dx = Double.parseDouble(coor[1]);
         double dy = Double.parseDouble(coor[2]);
-        for (int i=3; i<coor.length; i+=2){
+        for (int i = 3; i < coor.length; i += 2) {
             if (coor[i].isEmpty()) {
                 eastNorth.clear(); // some paths are just artifacts
                 return;
             }
-            double east = dx+=Double.parseDouble(coor[i]);
-            double north = dy+=Double.parseDouble(coor[i+1]);
-            eastNorth.add(new EastNorth(east,north));
+            double east = dx += Double.parseDouble(coor[i]);
+            double north = dy += Double.parseDouble(coor[i+1]);
+            eastNorth.add(new EastNorth(east, north));
         }
         // flip the image (svg using a reversed Y coordinate system)
@@ -240,5 +243,5 @@
 
     private String grabSVG(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
+        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
         wmsInterface.urlConn.setRequestProperty("Connection", "close");
         wmsInterface.urlConn.setRequestMethod("GET");
@@ -253,5 +256,5 @@
                  BufferedReader br = new BufferedReader(isr)) {
                 String line;
-                while ( null!=(line=br.readLine())){
+                while (null != (line = br.readLine())) {
                     line += "\n";
                     bos.write(line.getBytes(StandardCharsets.UTF_8));
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -111,7 +111,7 @@
         ArrayList<Double> fitViewBox = new ArrayList<>();
         ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<>();
-        for (int i=0; i< SVGpaths.length; i++) {
+        for (int i = 0; i < SVGpaths.length; i++) {
             ArrayList<EastNorth> eastNorth = new ArrayList<>();
-            fitViewBox.add( createNodes(SVGpaths[i], eastNorth) );
+            fitViewBox.add(createNodes(SVGpaths[i], eastNorth));
             eastNorths.add(eastNorth);
         }
@@ -149,8 +149,8 @@
         double maxY = Double.MIN_VALUE;
         double maxX = Double.MIN_VALUE;
-        for (int i=3; i<coor.length; i+=2){
-            double east = dx+=Double.parseDouble(coor[i]);
-            double north = dy+=Double.parseDouble(coor[i+1]);
-            eastNorth.add(new EastNorth(east,north));
+        for (int i = 3; i < coor.length; i += 2) {
+            double east = dx += Double.parseDouble(coor[i]);
+            double north = dy += Double.parseDouble(coor[i+1]);
+            eastNorth.add(new EastNorth(east, north));
             minX = minX > east ? east : minX;
             minY = minY > north ? north : minY;
@@ -193,5 +193,5 @@
 
     private String grabSVG(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
+        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
         wmsInterface.urlConn.setRequestProperty("Connection", "close");
         wmsInterface.urlConn.setRequestMethod("GET");
@@ -203,8 +203,8 @@
                 file.delete();
             try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file, true));
-                 InputStreamReader isr =new InputStreamReader(is);
+                 InputStreamReader isr = new InputStreamReader(is);
                  BufferedReader br = new BufferedReader(isr)) {
                 String line;
-                while ( null!=(line=br.readLine())){
+                while (null != (line = br.readLine())) {
                     line += "\n";
                     bos.write(line.getBytes(StandardCharsets.UTF_8));
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -24,5 +24,5 @@
 
     private class Task extends PleaseWaitRunnable {
-        public Task(WMSLayer wmsLayer, Bounds bounds) {
+        Task(WMSLayer wmsLayer, Bounds bounds) {
             super(tr("Downloading {0}", wmsLayer.getName()));
         }
@@ -35,8 +35,5 @@
                 if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
                     if (!wmsLayer.getImages().isEmpty()) {
-                        //JOptionPane.showMessageDialog(Main.parent,tr("Image already loaded"));
-                        JOptionPane pane = new JOptionPane(
-                                tr("Image already loaded")
-                                , JOptionPane.INFORMATION_MESSAGE);
+                        JOptionPane pane = new JOptionPane(tr("Image already loaded"), JOptionPane.INFORMATION_MESSAGE);
                         // this below is a temporary workaround to fix the "always on top" issue
                         JDialog dialog = pane.createDialog(Main.parent, "");
@@ -45,5 +42,5 @@
                         // till here
                         dontGeoreference = true;
-                    } else if (wmsLayer.grabber.getWmsInterface().downloadCanceled){
+                    } else if (wmsLayer.grabber.getWmsInterface().downloadCanceled) {
                         // do nothing
                     } else {
@@ -73,6 +70,6 @@
                                     "Use the normal Cadastre Grab menu."));*/
                             JOptionPane pane = new JOptionPane(
-                                    tr("Municipality vectorized !\nUse the normal Cadastre Grab menu.")
-                                    , JOptionPane.INFORMATION_MESSAGE);
+                                    tr("Municipality vectorized !\nUse the normal Cadastre Grab menu."),
+                                    JOptionPane.INFORMATION_MESSAGE);
                             // this below is a temporary workaround to fix the "always on top" issue
                             JDialog dialog = pane.createDialog(Main.parent, "");
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -42,5 +42,6 @@
                     if (wmsLayer.isRaster()) {
                         // set raster image commune bounding box based on current view (before adjustment)
-                        JOptionPane.showMessageDialog(Main.parent,tr("This commune is not vectorized.\nPlease use the other menu entry to georeference a \"Plan image\""));
+                        JOptionPane.showMessageDialog(Main.parent,
+                                tr("This commune is not vectorized.\nPlease use the other menu entry to georeference a \"Plan image\""));
                         Main.getLayerManager().removeLayer(wmsLayer);
                         wmsLayer = null;
@@ -53,6 +54,5 @@
                 // grab new images from wms server into active layer
                 wmsLayer.grab(bounds);
-            }
-            else if(wmsLayer.getImages().size()==0)
+            } else if (wmsLayer.getImages().size() == 0)
               // failed to contact WMS of find this commune. Remove layer if empty.
               Main.getLayerManager().removeLayer(wmsLayer);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DuplicateLayerException.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DuplicateLayerException.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DuplicateLayerException.java	(revision 32556)
@@ -1,5 +1,6 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
 class DuplicateLayerException extends Exception {
-    private static final long serialVersionUID = 1L;}
+    private static final long serialVersionUID = 1L;
+}
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -44,9 +44,8 @@
     private double pixelPerEast;
     private double pixelPerNorth;
-    
 
     public GeorefImage(BufferedImage img, EastNorth min, EastNorth max, WMSLayer wmsLayer) {
         image = img;
- 
+
         this.min = min;
         this.max = max;
@@ -81,5 +80,5 @@
      */
     private EastNorthBound computeNewBounding(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) {
-        EastNorth pt[] = new EastNorth[4];
+        EastNorth[] pt = new EastNorth[4];
         pt[0] = p1;
         pt[1] = p2;
@@ -90,5 +89,5 @@
         double highestEast = Double.MIN_VALUE;
         double highestNorth = Double.MIN_VALUE;
-        for(int i=0; i<=3; i++) {
+        for (int i = 0; i <= 3; i++) {
             smallestEast = Math.min(pt[i].east(), smallestEast);
             smallestNorth = Math.min(pt[i].north(), smallestNorth);
@@ -111,6 +110,6 @@
 
         // apply offsets defined manually when vector images are translated manually (not saved in cache)
-        double dx=0, dy=0;
-        if (wmsLayer!=null) {
+        double dx = 0, dy = 0;
+        if (wmsLayer != null) {
             dx = wmsLayer.deltaEast;
             dy = wmsLayer.deltaNorth;
@@ -131,9 +130,10 @@
             } else {
                 Point[] croppedPoint = new Point[5];
-                for (int i=0; i<4; i++)
+                for (int i = 0; i < 4; i++) {
                     croppedPoint[i] = nc.getPoint(
                             new EastNorth(orgCroppedRaster[i].east()+dx, orgCroppedRaster[i].north()+dy));
+                }
                 croppedPoint[4] = croppedPoint[0];
-                for (int i=0; i<4; i++) {
+                for (int i = 0; i < 4; i++) {
                     g.setColor(Color.green);
                     g.drawLine(croppedPoint[i].x, croppedPoint[i].y, croppedPoint[i+1].x, croppedPoint[i+1].y);
@@ -173,6 +173,4 @@
     /**
      * Make all pixels masked by the given georefImage transparent in this image
-     *
-     * @param georefImage
      */
     public void withdraw(GeorefImage georefImage) {
@@ -189,7 +187,9 @@
             int heightYMaskPixel = Math.abs((int) ((maxMaskNorth - minMaskNorth) / pxPerNorth));
             Graphics g = image.getGraphics();
-            for (int x = minXMaskPixel; x < minXMaskPixel + widthXMaskPixel; x++)
-                for (int y = minYMaskPixel; y < minYMaskPixel + heightYMaskPixel; y++)
+            for (int x = minXMaskPixel; x < minXMaskPixel + widthXMaskPixel; x++) {
+                for (int y = minYMaskPixel; y < minYMaskPixel + heightYMaskPixel; y++) {
                     image.setRGB(x, y, VectorImageModifier.cadastreBackgroundTransp);
+                }
+            }
             g.dispose();
         }
@@ -222,7 +222,7 @@
         if (WMSLayer.currentFormat >= 4) {
             imageOriginalHeight = in.readInt();
-            imageOriginalWidth =  in.readInt();
-        }
-        image = (BufferedImage) ImageIO.read(ImageIO.createImageInputStream(in));
+            imageOriginalWidth = in.readInt();
+        }
+        image = ImageIO.read(ImageIO.createImageInputStream(in));
         updatePixelPer();
     }
@@ -285,19 +285,17 @@
         min = new EastNorth(min.east() + dx, min.north() + dy);
         max = new EastNorth(max.east() + dx, max.north() + dy);
-        for (int i=0; i<4; i++) {
+        for (int i = 0; i < 4; i++) {
             orgRaster[i] = new EastNorth(orgRaster[i].east() + dx, orgRaster[i].north() + dy);
             orgCroppedRaster[i] = new EastNorth(orgCroppedRaster[i].east() + dx, orgCroppedRaster[i].north() + dy);
         }
     }
-    
+
     /**
      * Change this image scale by moving the min,max coordinates around an anchor
-     * @param anchor
-     * @param proportion
      */
     public void scale(EastNorth anchor, double proportion) {
         min = anchor.interpolate(min, proportion);
         max = anchor.interpolate(max, proportion);
-        for (int i=0; i<4; i++) {
+        for (int i = 0; i < 4; i++) {
             orgRaster[i] = anchor.interpolate(orgRaster[i], proportion);
             orgCroppedRaster[i] = anchor.interpolate(orgCroppedRaster[i], proportion);
@@ -316,5 +314,5 @@
             return;
         // rotate the bounding boxes coordinates first
-        for (int i=0; i<4; i++) {
+        for (int i = 0; i < 4; i++) {
             orgRaster[i] = orgRaster[i].rotate(anchor, delta_ang);
             orgCroppedRaster[i] = orgCroppedRaster[i].rotate(anchor, delta_ang);
@@ -323,6 +321,6 @@
         double sin = Math.abs(Math.sin(angle+delta_ang)), cos = Math.abs(Math.cos(angle+delta_ang));
         int w = imageOriginalWidth, h = imageOriginalHeight;
-        int neww = (int)Math.floor(w*cos+h*sin);
-        int newh = (int)Math.floor(h*cos+w*sin);
+        int neww = (int) Math.floor(w*cos+h*sin);
+        int newh = (int) Math.floor(h*cos+w*sin);
         GraphicsConfiguration gc = getDefaultConfiguration();
         BufferedImage result = gc.createCompatibleImage(neww, newh, image.getTransparency());
@@ -336,5 +334,5 @@
         min = enb.min;
         max = enb.max;
-        angle+=delta_ang;
+        angle += delta_ang;
     }
 
@@ -346,8 +344,8 @@
     public void crop(EastNorth adj1, EastNorth adj2) {
         // s1 and s2 have 0,0 at top, left where all EastNorth coord. have 0,0 at bottom, left
-        int sx1 = (int)((adj1.getX() - min.getX())*getPixelPerEast());
-        int sy1 = (int)((max.getY() - adj2.getY())*getPixelPerNorth());
-        int sx2 = (int)((adj2.getX() - min.getX())*getPixelPerEast());
-        int sy2 = (int)((max.getY() - adj1.getY())*getPixelPerNorth());
+        int sx1 = (int) ((adj1.getX() - min.getX())*getPixelPerEast());
+        int sy1 = (int) ((max.getY() - adj2.getY())*getPixelPerNorth());
+        int sx2 = (int) ((adj2.getX() - min.getX())*getPixelPerEast());
+        int sy2 = (int) ((max.getY() - adj1.getY())*getPixelPerNorth());
         int newWidth = Math.abs(sx2 - sx1);
         int newHeight = Math.abs(sy2 - sy1);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -35,5 +35,4 @@
     /**
      * Call directly grabber for raster images or prepare thread for vector images
-     * @param moreImages
      */
     public void addImages(ArrayList<EastNorthBound> moreImages) {
@@ -41,5 +40,5 @@
         imagesToGrab.addAll(moreImages);
         lockImagesToGrag.unlock();
-        synchronized(this) {
+        synchronized (this) {
             this.notify();
         }
@@ -139,5 +138,6 @@
                 notifyWaiter();
             }
-            waitNotification();        }
+            waitNotification();
+        }
     }
 
@@ -152,6 +152,7 @@
             getCacheControl().deleteCacheFile();
             wmsLayer.imagesLock.lock();
-            for (GeorefImage image : wmsLayer.getImages())
+            for (GeorefImage image : wmsLayer.getImages()) {
                 getCacheControl().saveCache(image);
+            }
             wmsLayer.imagesLock.unlock();
         }
@@ -199,5 +200,5 @@
         croppedPoint[3] = mv.getPoint(new EastNorth(img.max.east(), img.min.north()));
         croppedPoint[4] = croppedPoint[0];
-        for (int i=0; i<4; i++) {
+        for (int i = 0; i < 4; i++) {
             g.setColor(color);
             g.drawLine(croppedPoint[i].x, croppedPoint[i].y, croppedPoint[i+1].x, croppedPoint[i+1].y);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java	(revision 32556)
@@ -1,4 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
-// Some of the procedures below are imported from image4j.sourceforge.net, license LGPL.
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -25,7 +24,8 @@
     protected BufferedImage convert1(BufferedImage src) {
         IndexColorModel icm = new IndexColorModel(
-            1, 2, new byte[] { (byte) 0, (byte) 0xFF },
-            new byte[] { (byte) 0, (byte) 0xFF },
-            new byte[] { (byte) 0, (byte) 0xFF }
+            1, 2,
+            new byte[] {(byte) 0, (byte) 0xFF},
+            new byte[] {(byte) 0, (byte) 0xFF},
+            new byte[] {(byte) 0, (byte) 0xFF}
         );
 
@@ -113,7 +113,8 @@
 
     public boolean isBuildingColor(int rgb, boolean ignoreParcelColor) {
-        for (int i = 0; i < cBuilingFootColors.length; i++)
+        for (int i = 0; i < cBuilingFootColors.length; i++) {
             if (rgb == cBuilingFootColors[i])
                     return true;
+        }
         if (ignoreParcelColor && (rgb == parcelColor))
             return true;
@@ -122,7 +123,8 @@
 
     public boolean isRoofColor(int rgb, boolean ignoreParcelColor) {
-        for (int i = 0; i < cRoofColors.length; i++)
+        for (int i = 0; i < cRoofColors.length; i++) {
             if (rgb == cRoofColors[i])
                     return true;
+        }
         if (ignoreParcelColor && (rgb == parcelColor))
             return true;
@@ -153,6 +155,4 @@
     /**
      * Checks if the rgb value is the black background color
-     * @param
-     * @return
      */
     public boolean isBackgroundColor(BufferedImage img, int x, int y) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionBoundaries.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionBoundaries.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionBoundaries.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -22,4 +22,5 @@
     }
 
+    @Override
     public void actionPerformed(ActionEvent arg0) {
         wmsLayer = WMSDownloadAction.getLayer();
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionCancelGrab.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionCancelGrab.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionCancelGrab.java	(revision 32556)
@@ -1,6 +1,7 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.event.ActionEvent;
@@ -20,5 +21,4 @@
     }
 
-
     @Override
     public void actionPerformed(ActionEvent arg0) {
@@ -27,4 +27,3 @@
         }
     }
-
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -25,4 +25,5 @@
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         if (Main.map != null) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -25,5 +25,5 @@
     private WMSLayer wmsLayer;
     private RasterImageGeoreferencer rasterImageGeoreferencer;
-    
+
     public MenuActionGrabPlanImage() {
         super(tr(name), "cadastre_small", tr("Grab non-georeferenced image"), null, false, "cadastrefr/grabplanimage", true);
@@ -36,5 +36,5 @@
         if (!rasterImageGeoreferencer.isRunning()) return;
         if (Main.getLayerManager().containsLayer(wmsLayer))
-        	return;
+            return;
         JOptionPane.showMessageDialog(Main.parent, tr("Georeferencing interrupted"));
         rasterImageGeoreferencer.actionInterrupted();
@@ -42,5 +42,5 @@
 
     @Override
-	public void actionPerformed(ActionEvent ae) {
+    public void actionPerformed(ActionEvent ae) {
         if (Main.map != null) {
             if (CadastrePlugin.isCadastreProjection()) {
@@ -58,5 +58,5 @@
 
     @Override
-	public void run() {
+    public void run() {
         // wait until plan image is fully loaded and joined into one single image
         boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -39,5 +39,5 @@
             if (file.exists()) {
                 String filename = file.getName();
-                String ext = (filename.lastIndexOf('.')==-1)?"":filename.substring(filename.lastIndexOf('.')+1,filename.length());
+                String ext = (filename.lastIndexOf('.') == -1) ? "" : filename.substring(filename.lastIndexOf('.')+1, filename.length());
                 if ((ext.length() == 3 && ext.substring(0, CacheControl.C_LAMBERT_CC_9Z.length()).equals(CacheControl.C_LAMBERT_CC_9Z) &&
                     !(CadastrePlugin.isLambert_cc9()))
@@ -45,5 +45,6 @@
                             !(CadastrePlugin.isUtm_france_dom()))
                     || (ext.length() == 1) && !(CadastrePlugin.isLambert())) {
-                        JOptionPane.showMessageDialog(Main.parent, tr("{0} not allowed with the current projection", filename), tr("Error"), JOptionPane.ERROR_MESSAGE);
+                        JOptionPane.showMessageDialog(Main.parent, tr("{0} not allowed with the current projection", filename),
+                                tr("Error"), JOptionPane.ERROR_MESSAGE);
                         continue;
                 } else {
@@ -56,7 +57,9 @@
                     try {
                         int cacheZone = Integer.parseInt(ext) - 1;
-                        if (cacheZone >=0 && cacheZone <= 9) {
+                        if (cacheZone >= 0 && cacheZone <= 9) {
                             if (cacheZone != layoutZone) {
-                                JOptionPane.showMessageDialog(Main.parent, tr("Cannot load cache {0} which is not compatible with current projection zone", filename), tr("Error"), JOptionPane.ERROR_MESSAGE);
+                                JOptionPane.showMessageDialog(Main.parent,
+                                        tr("Cannot load cache {0} which is not compatible with current projection zone", filename),
+                                        tr("Error"), JOptionPane.ERROR_MESSAGE);
                                 continue nextFile;
                             } else
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -23,5 +23,8 @@
     private static final long serialVersionUID = 1L;
 
-    private static final String departements[] = {
+    // CHECKSTYLE.OFF: LineLength
+    // CHECKSTYLE.OFF: SingleSpaceSeparator
+
+    private static final String[] departements = {
         "", tr("(optional)"),
         "001", "01 - Ain",                 "002", "02 - Aisne",              "003", "03 - Allier",                "004", "04 - Alpes de Haute-Provence", "005", "05 - Hautes-Alpes",
@@ -48,6 +51,10 @@
     };
 
+    // CHECKSTYLE.ON: SingleSpaceSeparator
+    // CHECKSTYLE.ON: LineLength
+
     public MenuActionNewLocation() {
-        super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false, "cadastrefr/newlocation", true);
+        super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false,
+                "cadastrefr/newlocation", true);
     }
 
@@ -66,17 +73,18 @@
         JPanel p = new JPanel(new GridBagLayout());
         JLabel labelLocation = new JLabel(tr("Commune"));
-        final JTextField inputTown = new JTextField( Main.pref.get("cadastrewms.location") );
+        final JTextField inputTown = new JTextField(Main.pref.get("cadastrewms.location"));
         inputTown.setToolTipText(tr("<html>Enter the town,village or city name.<br>"
                 + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>"));
-        JLabel labelDepartement =  new JLabel(tr("Departement"));
+        JLabel labelDepartement = new JLabel(tr("Departement"));
         final JComboBox<String> inputDepartement = new JComboBox<>();
-        for (int i=1; i<departements.length; i+=2) {
+        for (int i = 1; i < departements.length; i += 2) {
             inputDepartement.addItem(departements[i]);
         }
         inputDepartement.setToolTipText(tr("<html>Departement number (optional)</html>"));
         if (!Main.pref.get("cadastrewms.codeDepartement").equals("")) {
-            for (int i=0; i < departements.length; i=i+2)
+            for (int i = 0; i < departements.length; i += 2) {
                 if (departements[i].equals(Main.pref.get("cadastrewms.codeDepartement")))
                     inputDepartement.setSelectedIndex(i/2);
+            }
         }
         p.add(labelSectionNewLocation, GBC.eol());
@@ -119,5 +127,5 @@
             Main.info("Add new layer with Location:" + inputTown.getText());
         } else if (existingLayers != null && existingLayers.size() > 0 && Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
-            wmsLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
+            wmsLayer = (WMSLayer) Main.getLayerManager().getActiveLayer();
         }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionOpenPreferences.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionOpenPreferences.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionOpenPreferences.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Vincent Privat <vincent.privat@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -11,17 +11,18 @@
 import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
 
-public class MenuActionOpenPreferences extends JosmAction { 
-    private static final long serialVersionUID = 1L; 
+public class MenuActionOpenPreferences extends JosmAction {
+    private static final long serialVersionUID = 1L;
 
-    public static String name = marktr("Preferences"); 
+    public static String name = marktr("Preferences");
 
-    public MenuActionOpenPreferences() { 
-        super(tr(name), "cadastre_small", tr("Open Cadastre Preferences"), null, false, "cadastrefr/openpreferences", true); 
-    } 
-  
-    public void actionPerformed(ActionEvent e) { 
-        PreferenceDialog p = new PreferenceDialog(Main.parent); 
-        p.selectPreferencesTabByClass(CadastrePreferenceSetting.class); 
-        p.setVisible(true); 
-    } 
+    public MenuActionOpenPreferences() {
+        super(tr(name), "cadastre_small", tr("Open Cadastre Preferences"), null, false, "cadastrefr/openpreferences", true);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        PreferenceDialog p = new PreferenceDialog(Main.parent);
+        p.selectPreferencesTabByClass(CadastrePreferenceSetting.class);
+        p.setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java	(revision 32556)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -24,5 +25,5 @@
     @Override
     public void actionPerformed(ActionEvent arg0) {
-        if(!wmsLayer.isRaster()) {
+        if (!wmsLayer.isRaster()) {
             Main.info("MenuActionRefineGeoRef called for unexpected layer type");
             return;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -19,4 +19,5 @@
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         //CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookie();
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -43,4 +43,5 @@
             return file.getName().toLowerCase().endsWith(".png");
         }
+
         @Override
         public String getDescription() {
@@ -57,4 +58,5 @@
             return file.getName().toLowerCase().endsWith(".tif");
         }
+
         @Override
         public String getDescription() {
@@ -82,6 +84,5 @@
             file = fc.getSelectedFile();
             BufferedImage bi = wmsLayer.getImage(0).image;
-            if (fc.getFileFilter().equals(filtrePng))
-            {
+            if (fc.getFileFilter().equals(filtrePng)) {
                 if (!file.getName().endsWith(".png"))
                     file = new File(file.getParent(), file.getName()+".png");
@@ -98,7 +99,5 @@
                     e.printStackTrace();
                 }
-            }
-            else if (fc.getFileFilter().equals(filtreTiff))
-            {
+            } else if (fc.getFileFilter().equals(filtreTiff)) {
                 boolean alpha = bi.getColorModel().hasAlpha();
                 Main.info("image with alpha channel : " + alpha);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 32556)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -39,5 +40,5 @@
     private int initialClickDelay;
 
-    public void addListener(){
+    public void addListener() {
         Main.map.mapView.addMouseListener(this);
     }
@@ -51,8 +52,8 @@
        mode = cGetCorners;
        countMouseClicked = 0;
-       initialClickDelay = Main.pref.getInteger("cadastrewms.georef-click-delay",200);
+       initialClickDelay = Main.pref.getInteger("cadastrewms.georef-click-delay", 200);
        mouseClickedTime = System.currentTimeMillis();
-       Object[] options = { "OK", "Cancel" };
-       int ret = JOptionPane.showOptionDialog( null,
+       Object[] options = {"OK", "Cancel"};
+       int ret = JOptionPane.showOptionDialog(null,
                tr("Click first corner for image cropping\n(two points required)"),
                tr("Image cropping"),
@@ -75,8 +76,8 @@
       countMouseClicked = 0;
       mode = cGetLambertCrosspieces;
-      initialClickDelay = Main.pref.getInteger("cadastrewms.georef-click-delay",200);
+      initialClickDelay = Main.pref.getInteger("cadastrewms.georef-click-delay", 200);
       mouseClickedTime = System.currentTimeMillis();
-      Object[] options = { "OK", "Cancel" };
-      int ret = JOptionPane.showOptionDialog( null,
+      Object[] options = {"OK", "Cancel"};
+      int ret = JOptionPane.showOptionDialog(null,
               tr("Click first Lambert crosspiece for georeferencing\n(two points required)"),
               tr("Image georeferencing"),
@@ -91,6 +92,5 @@
   }
 
-  public boolean isRunning()
-  {
+  public boolean isRunning() {
       return (countMouseClicked != 0 || mode != 0);
   }
@@ -101,6 +101,5 @@
           Main.info("mouse click bounce detected");
           return; // mouse click anti-bounce
-      }
-      else
+      } else
           mouseClickedTime = System.currentTimeMillis();
       if (e.getButton() != MouseEvent.BUTTON1)
@@ -115,6 +114,5 @@
           // ignore clicks outside the image
           if (ea.east() < wmsLayer.getImage(0).min.east() || ea.east() > wmsLayer.getImage(0).max.east()
-                  || ea.north() < wmsLayer.getImage(0).min.north() || ea.north() > wmsLayer.getImage(0).max.north())
-          {
+                  || ea.north() < wmsLayer.getImage(0).min.north() || ea.north() > wmsLayer.getImage(0).max.north()) {
               Main.info("ignore click outside the image");
               return;
@@ -144,5 +142,4 @@
   }
 
-
   /**
    *
@@ -150,6 +147,6 @@
    */
  private boolean canceledOrRestartCurrAction(String action) {
-     Object[] options = { "Cancel", "Retry" };
-     int selectedValue = JOptionPane.showOptionDialog( null,
+     Object[] options = {"Cancel", "Retry"};
+     int selectedValue = JOptionPane.showOptionDialog(null,
              tr("Do you want to cancel completely\n"+
                      "or just retry "+action+" ?"), "",
@@ -177,6 +174,5 @@
  private void affineTransform(EastNorth org1, EastNorth org2, EastNorth dst1, EastNorth dst2) {
      // handle an NPE case I'm not able to reproduce
-     if(org1==null || org2==null || dst1==null || dst2==null)
-     {
+     if (org1 == null || org2 == null || dst1 == null || dst2 == null) {
          JOptionPane.showMessageDialog(Main.parent,
                  tr("Ooops. I failed to catch all coordinates\n"+
@@ -286,6 +282,6 @@
  */
 private boolean continueCropping() {
-    Object[] options = { "OK", "Cancel" };
-    int ret = JOptionPane.showOptionDialog( null,
+    Object[] options = {"OK", "Cancel"};
+    int ret = JOptionPane.showOptionDialog(null,
             tr("Click second corner for image cropping"),
             tr("Image cropping"),
@@ -316,6 +312,6 @@
  */
 private boolean continueGeoreferencing() {
-    Object[] options = { "OK", "Cancel" };
-    int ret = JOptionPane.showOptionDialog( null,
+    Object[] options = {"OK", "Cancel"};
+    int ret = JOptionPane.showOptionDialog(null,
             tr("Click second Lambert crosspiece for georeferencing"),
             tr("Image georeferencing"),
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -12,12 +12,12 @@
 
     private int cadastreBackground = -1; // white
-    
+
     public static int cadastreBackgroundTransp = 16777215; // original white but transparent
-    
+
     private boolean transparencyEnabled = false;
 
     public RasterImageModifier(BufferedImage bi) {
         bufferedImage = bi;
-        transparencyEnabled = Main.pref.getBoolean("cadastrewms.backgroundTransparent"); 
+        transparencyEnabled = Main.pref.getBoolean("cadastrewms.backgroundTransparent");
         if (transparencyEnabled)
             makeTransparent();
@@ -35,5 +35,5 @@
             for (int y = 0; y < h; y++) {
                 int pixel = bufferedImage.getRGB(x, y);
-                if ((!transparencyEnabled && pixel != cadastreBackground) 
+                if ((!transparencyEnabled && pixel != cadastreBackground)
                         || (transparencyEnabled && pixel != cadastreBackgroundTransp)) {
                     bufferedImage.setRGB(x, y, reverseIfGrey(pixel));
@@ -46,6 +46,4 @@
      * Reverse the grey value if the pixel is grey (light grey becomes dark grey)
      * Used for texts.
-     * @param pixel
-     * @return
      */
     private int reverseIfGrey(int pixel) {
@@ -77,8 +75,8 @@
                     Color maskedColor;
                     if (rgb == cadastreBackground) {
-                        maskedColor = simplifyColors ? new Color(0xff, 0xff, 0xff, 0x00) : 
+                        maskedColor = simplifyColors ? new Color(0xff, 0xff, 0xff, 0x00) :
                             new Color(r, g, b, 0x00); // transparent
                     } else {
-                        maskedColor = simplifyColors ? new Color(0, 0, 0, 0xFF) : 
+                        maskedColor = simplifyColors ? new Color(0, 0, 0, 0xFF) :
                             new Color(r, g, b, 0xFF); // opaque
                     }
@@ -90,9 +88,8 @@
         return;
     }
-    
+
     /**
-     * Temporary fix for Java6 which doesn't de-serialize correctly cached image on disk. 
-     * Recreate a new raster image based on what is loaded/serialized from disk cache. 
-     * @param img
+     * Temporary fix for Java6 which doesn't de-serialize correctly cached image on disk.
+     * Recreate a new raster image based on what is loaded/serialized from disk cache.
      * @return new image
      */
@@ -101,5 +98,5 @@
         int height = img.getHeight();
         BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-        int rgbArray[] = new int[width * height];
+        int[] rgbArray = new int[width * height];
         img.getRGB(0, 0, width, height, rgbArray, 0, width);
         bi.setRGB(0, 0, width, height, rgbArray, 0, width);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -7,5 +7,5 @@
  * This class is not intended to be a real SVG parser. It's also not using existing
  * xml parsers. It's just extracting the required strings from an SVG file coming
- * from the French land registry cadastre.gouv.fr 
+ * from the French land registry cadastre.gouv.fr
  *
  */
@@ -29,8 +29,9 @@
             try {
                 String str = svg.substring(s, e);
-                String [] viewBox = str.split(" ");
+                String[] viewBox = str.split(" ");
                 double[] dbox = new double[4];
-                for (int i = 0; i<4; i++)
-                    dbox[i] = Double.parseDouble(viewBox[i]); 
+                for (int i = 0; i < 4; i++) {
+                    dbox[i] = Double.parseDouble(viewBox[i]);
+                }
                 return dbox;
             } catch (Exception ex) {
@@ -40,11 +41,9 @@
         return null;
     }
-    
+
     /**
      * Closed SVG paths are finishing with a "Z" at the end of the moves list.
-     * @param svg
-     * @return
      */
-    public String [] getClosedPaths(String svg) {
+    public String[] getClosedPaths(String svg) {
         ArrayList<String> path = new ArrayList<>();
         int i = 0;
@@ -53,5 +52,5 @@
             int e = svg.indexOf(cClosedPathEnd, s);
             if (s != -1 && e != -1) {
-                String onePath = svg.substring(s, e); 
+                String onePath = svg.substring(s, e);
                 if (onePath.indexOf("Z") != -1) // only closed SVG path
                     path.add(onePath);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -24,4 +24,6 @@
         this.value = value;
     }
+
+    @Override
     public String toString() {
         return value;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -10,5 +10,5 @@
 /**
  * Imported from plugin UtilsPlugin
- * @author 
+ * @author
  *
  */
@@ -26,11 +26,12 @@
             simplifyWayRange(wnew, from, to, ns, thr);
             List<Node> nodes = wnew.getNodes();
-            for (int j = to - 1; j > from; j--)
+            for (int j = to - 1; j > from; j--) {
                 nodes.remove(j);
+            }
             nodes.addAll(from+1, ns);
             wnew.setNodes(nodes);
         }
     }
-    
+
     /*
      * Takes an interval [from,to] and adds nodes from (from,to) to ns.
@@ -60,5 +61,7 @@
         }
     }
+
     public static double EARTH_RAD = 6378137.0;
+
     /* From Aviaton Formulary v1.3
      * http://williams.best.vwh.net/avform.htm
@@ -74,4 +77,5 @@
                 % (2 * Math.PI);
     }
+
     public static double xtd(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3) {
         double dist_AD = dist(lat1, lon1, lat3, lon3);
@@ -80,4 +84,3 @@
         return Math.asin(Math.sin(dist_AD) * Math.sin(crs_AD - crs_AB));
     }
-
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/VectorImageModifier.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/VectorImageModifier.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/VectorImageModifier.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -7,4 +7,5 @@
 import java.awt.image.IndexColorModel;
 import java.awt.image.WritableRaster;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.ColorHelper;
@@ -13,11 +14,13 @@
 
     private int cadastreBackground = -1; // white
-    
+
     public static int cadastreBackgroundTransp = 1; // original white but transparent
 
     private int backgroundPixel = 0;
 
-    public VectorImageModifier() {super();}
-    
+    public VectorImageModifier() {
+        super();
+    }
+
     public VectorImageModifier(BufferedImage bi, boolean monocolor) {
         bufferedImage = bi;
@@ -70,6 +73,4 @@
      * Reverse the grey value if the pixel is grey (light grey becomes dark grey)
      * Used for texts.
-     * @param pixel
-     * @return
      */
     private int reverseIfGrey(int pixel) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -16,12 +16,12 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 public class WMSAdjustAction extends MapMode implements
-        MouseListener, MouseMotionListener{
+        MouseListener, MouseMotionListener {
 
     private static final long serialVersionUID = 1L;
@@ -29,5 +29,6 @@
     private boolean rasterMoved;
     private EastNorth prevEastNorth;
-    enum Mode { moveXY, moveZ, rotate}
+    enum Mode { moveXY, moveZ, rotate }
+
     private static Mode mode = null;
     private static EastNorth[] croppedRaster = new EastNorth[5];;
@@ -42,5 +43,5 @@
         if (Main.map != null) {
             if (Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
-                modifiedLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
+                modifiedLayer = (WMSLayer) Main.getLayerManager().getActiveLayer();
                 super.enterMode();
                 Main.map.mapView.addMouseListener(this);
@@ -52,5 +53,5 @@
 //                        +"a cadastre layer"));
                 exitMode();
-                Main.map.selectMapMode((MapMode)Main.map.getDefaultButtonAction());
+                Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
             }
         }
@@ -97,5 +98,5 @@
 
     @Override public void mouseDragged(MouseEvent e) {
-        EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(),e.getY());
+        EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(), e.getY());
         if (mode == Mode.rotate) {
             rotateFrameOnly(prevEastNorth, newEastNorth);
@@ -105,18 +106,19 @@
             } else if (mode == Mode.moveZ) {
                 resize(newEastNorth);
-            } 
+            }
             prevEastNorth = newEastNorth;
         }
         Main.map.mapView.repaint();
     }
-    
+
     public static void paintAdjustFrames(Graphics2D g, final MapView mv) {
         if (mode == Mode.rotate && croppedRaster != null) {
             g.setColor(Color.red);
-            for (int i=0; i<4; i++)
+            for (int i = 0; i < 4; i++) {
                 g.drawLine(mv.getPoint(croppedRaster[i]).x,
                         mv.getPoint(croppedRaster[i]).y,
                         mv.getPoint(croppedRaster[i+1]).x,
                         mv.getPoint(croppedRaster[i+1]).y);
+            }
         }
     }
@@ -148,5 +150,5 @@
             double rotationAngle = endAngle - startAngle;
             if (modifiedLayer.getImage(0).orgCroppedRaster != null) {
-                for (int i=0; i<4; i++) {
+                for (int i = 0; i < 4; i++) {
                     croppedRaster[i] = modifiedLayer.getImage(0).orgCroppedRaster[i].rotate(pivot, rotationAngle);
                 }
@@ -157,7 +159,6 @@
 
     @Override public void mouseReleased(MouseEvent e) {
-        //Main.map.mapView.repaint();
         if (mode == Mode.rotate) {
-            EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(),e.getY());
+            EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(), e.getY());
             rotate(prevEastNorth, newEastNorth);
             Main.map.mapView.repaint();
@@ -168,8 +169,13 @@
     }
 
+    @Override
     public void mouseEntered(MouseEvent e) {
     }
+
+    @Override
     public void mouseExited(MouseEvent e) {
     }
+
+    @Override
     public void mouseMoved(MouseEvent e) {
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -13,5 +13,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 
-public class WMSDownloadAction /*extends JosmAction */{
+public class WMSDownloadAction /*extends JosmAction */ {
 
 //    public WMSDownloadAction(String layerName) {
@@ -32,5 +32,5 @@
             for (Layer l : Main.getLayerManager().getLayers()) {
                 if (l instanceof WMSLayer) {
-                    existingWMSlayers.add((WMSLayer)l);
+                    existingWMSlayers.add((WMSLayer) l);
                 }
             }
@@ -50,4 +50,3 @@
         return null;
     }
-};
-
+}
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSException.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSException.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSException.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -5,8 +5,11 @@
     private String message;
     private static final long serialVersionUID = 1L;
-    public WMSException(String message) {
+
+    WMSException(String message) {
         super();
         this.message = message;
     }
+
+    @Override
     public String getMessage() {
         return message;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 32555)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 32556)
@@ -1,3 +1,3 @@
-// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
+// License: GPL. For details, see LICENSE file.
 package cadastre_fr;
 
@@ -77,5 +77,5 @@
     private String codeCommune = "";
 
-    public EastNorthBound communeBBox = new EastNorthBound(new EastNorth(0,0), new EastNorth(0,0));
+    public EastNorthBound communeBBox = new EastNorthBound(new EastNorth(0, 0), new EastNorth(0, 0));
 
     private boolean isRaster;
@@ -100,7 +100,8 @@
     @SuppressWarnings("serial")
     class ResetOffsetActionMenu extends JosmAction {
-        public ResetOffsetActionMenu() {
+        ResetOffsetActionMenu() {
             super(tr("Reset offset"), null, tr("Reset offset (only vector images)"), null, false);
         }
+
         @Override
         public void actionPerformed(ActionEvent arg0) {
@@ -136,5 +137,5 @@
     public void destroy() {
         // if the layer is currently saving the images in the cache, wait until it's finished
-        if(grabThread != null)
+        if (grabThread != null)
                 grabThread.cancel();
         grabThread = null;
@@ -149,5 +150,5 @@
         if (codeCommune != null && !codeCommune.isEmpty())
             ret += "(" + codeCommune + ")";
-        return  ret;
+        return ret;
     }
 
@@ -160,5 +161,5 @@
         grabThread.setGrabber(grabber);
         // if it is the first layer, use the communeBBox as grab bbox (and not divided)
-        if (Main.getLayerManager().getLayers().size() == 1 ) {
+        if (Main.getLayerManager().getLayers().size() == 1) {
             final Bounds bounds = this.getCommuneBBox().toBounds();
             GuiHelper.runInEDTAndWait(new Runnable() {
@@ -174,5 +175,5 @@
                         Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER)));
             } else
-                divideBbox(b, 
+                divideBbox(b,
                         Integer.parseInt(Main.pref.get("cadastrewms.scale", CadastrePreferenceSetting.DEFAULT_GRAB_MULTIPLIER)));
         }
@@ -199,8 +200,9 @@
         dividedBbox.clear();
         if (factor < 4 || isRaster) {
-            for (int xEast = 0; xEast < factor; xEast++)
+            for (int xEast = 0; xEast < factor; xEast++) {
                 for (int xNorth = 0; xNorth < factor; xNorth++) {
                     dividedBbox.add(new EastNorthBound(new EastNorth(minEast + xEast * dEast, minNorth + xNorth * dNorth),
                                 new EastNorth(minEast + (xEast + 1) * dEast, minNorth + (xNorth + 1) * dNorth)));
+                }
             }
         } else {
@@ -208,13 +210,13 @@
             // grab all square in a spiral starting from the center (usually the most interesting place)
             int c = Integer.parseInt(Main.pref.get("cadastrewms.squareSize", String.valueOf(CadastrePreferenceSetting.DEFAULT_SQUARE_SIZE)));
-            lambertMin = lambertMin.add(- minEast%c, - minNorth%c);
-            lambertMax = lambertMax.add(c - lambertMax.east()%c, c - lambertMax.north()%c);
+            lambertMin = lambertMin.add(-minEast % c, -minNorth % c);
+            lambertMax = lambertMax.add(c - lambertMax.east() % c, c - lambertMax.north() % c);
             EastNorth mid = lambertMax.getCenter(lambertMin);
             mid = mid.add(-1, 1); // in case the boxes side is a pair, select the one one top,left to follow the rotation
-            mid = mid.add(- mid.east()%c, - mid.north()%c);
-            int x = (int)(lambertMax.east() - lambertMin.east())/c;
-            int y = (int)(lambertMax.north() - lambertMin.north())/c;
-            int dx[] = {+1, 0,-1, 0};
-            int dy[] = {0,-1, 0,+1};
+            mid = mid.add(-mid.east() % c, -mid.north() % c);
+            int x = (int) (lambertMax.east() -lambertMin.east())/c;
+            int y = (int) (lambertMax.north() -lambertMin.north())/c;
+            int[] dx = {+1, 0, -1, 0};
+            int[] dy = {0, -1, 0, +1};
             int currDir = -1, lDir = 1, i = 1, j = 0, k = -1;
             if (x == 1)
@@ -231,5 +233,5 @@
                     }
                     j = 0;
-                    currDir = (currDir+1)%4;
+                    currDir = (currDir+1) % 4;
                 } else if (currDir >= 0 && j >= (currDir == 0 || currDir == 2 ? (x-1) : (y-1))) {
                     // the overall is a rectangle, not a square. Jump to the other side to grab next square.
@@ -240,5 +242,5 @@
                     }
                     j = lDir-1;
-                    currDir = (currDir+1)%4;
+                    currDir = (currDir+1) % 4;
                     mid = new EastNorth(mid.east() + dx[currDir]*c*(lDir-1), mid.north() + dy[currDir]*c*(lDir-1));
                 }
@@ -260,5 +262,5 @@
             str += "\n"+tr("Is not vectorized.");
             str += "\n"+tr("Bounding box: {0}", communeBBox);
-            if(!images.isEmpty())
+            if (!images.isEmpty())
                 str += "\n"+tr("Image size (px): {0}/{1}", images.get(0).image.getWidth(), images.get(0).image.getHeight());
         } else {
@@ -281,5 +283,5 @@
     @Override
     public void paint(Graphics2D g, final MapView mv, Bounds bounds) {
-        synchronized(this){
+        synchronized (this) {
             Object savedInterpolation = g.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
             if (savedInterpolation == null) savedInterpolation = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
@@ -292,7 +294,8 @@
                 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
             imagesLock.lock();
-            for (GeorefImage img : images)
+            for (GeorefImage img : images) {
                 img.paint(g, mv, CadastrePlugin.backgroundTransparent,
                         CadastrePlugin.transparency, CadastrePlugin.drawBoundaries);
+            }
             imagesLock.unlock();
             g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, savedInterpolation);
@@ -329,5 +332,5 @@
         refineGeoRef.setEnabled(isRaster && grabThread.getImagesToGrabSize() == 0);
         Action resetOffset = new ResetOffsetActionMenu();
-        resetOffset.setEnabled(!isRaster && !images.isEmpty() && (deltaEast!=0.0 || deltaNorth!=0.0));
+        resetOffset.setEnabled(!isRaster && !images.isEmpty() && (deltaEast != 0.0 || deltaNorth != 0.0));
         return new Action[] {
                 LayerListDialog.getInstance().createShowHideLayerAction(),
@@ -447,6 +450,4 @@
      * Called by CacheControl when a new cache file is created on disk.
      * Save only primitives to keep cache independent of software changes.
-     * @param oos
-     * @throws IOException
      */
     public void write(File associatedFile, ObjectOutputStream oos) throws IOException {
@@ -475,7 +476,4 @@
      * Called by CacheControl when a cache file is read from disk.
      * Cache uses only primitives to stay independent of software changes.
-     * @param ois
-     * @throws IOException
-     * @throws ClassNotFoundException
      */
     public boolean read(File associatedFile, ObjectInputStream ois, int currentLambertZone) throws IOException, ClassNotFoundException {
@@ -506,5 +504,5 @@
         double maxX = ois.readDouble();
         double maxY = ois.readDouble();
-        this.communeBBox =  new EastNorthBound(new EastNorth(minX, minY), new EastNorth(maxX, maxY));
+        this.communeBBox = new EastNorthBound(new EastNorth(minX, minY), new EastNorth(maxX, maxY));
         if (this.lambertZone != currentLambertZone && currentLambertZone != -1) {
             JOptionPane.showMessageDialog(Main.parent, tr("Lambert zone {0} in cache "+
@@ -513,5 +511,5 @@
             return false;
         }
-        synchronized(this){
+        synchronized (this) {
             boolean EOF = false;
             try {
@@ -534,4 +532,5 @@
             } catch (EOFException ex) {
                 // expected exception when all images are read
+                Main.trace(ex);
             }
         }
@@ -560,5 +559,5 @@
             Graphics g = newImg.getGraphics();
             // Coordinate (0,0) is on top,left corner where images are grabbed from bottom left
-            int rasterDivider = (int)Math.sqrt(images.size());
+            int rasterDivider = (int) Math.sqrt(images.size());
             for (int h = 0; h < lx.size(); h++) {
                 for (int v = 0; v < ly.size(); v++) {
@@ -569,5 +568,5 @@
                 }
             }
-            synchronized(this) {
+            synchronized (this) {
                 images.clear();
                 images.add(new GeorefImage(newImg, min, max, this));
@@ -581,8 +580,6 @@
      * Works only for raster image layer (only one image in collection).
      * Updates layer georeferences.
-     * @param en1
-     * @param en2
-     */
-    public void cropImage(EastNorth en1, EastNorth en2){
+     */
+    public void cropImage(EastNorth en1, EastNorth en2) {
         // adj1 is corner bottom, left
         EastNorth adj1 = new EastNorth(en1.east() <= en2.east() ? en1.east() : en2.east(),
@@ -596,6 +593,6 @@
         rasterMax = adj2;
         setCommuneBBox(new EastNorthBound(
-                new EastNorth(0,0), 
-                new EastNorth(images.get(0).image.getWidth()-1,images.get(0).image.getHeight()-1)));
+                new EastNorth(0, 0),
+                new EastNorth(images.get(0).image.getWidth()-1, images.get(0).image.getHeight()-1)));
         rasterRatio = (rasterMax.getX()-rasterMin.getX())/(communeBBox.max.getX() - communeBBox.min.getX());
     }
@@ -613,5 +610,5 @@
         double minY = Double.MAX_VALUE;
         double maxY = Double.MIN_VALUE;
-        for (GeorefImage image:images){
+        for (GeorefImage image:images) {
             minX = image.min.east() < minX ? image.min.east() : minX;
             maxX = image.max.east() > maxX ? image.max.east() : maxX;
@@ -649,6 +646,6 @@
             images.get(0).shear(dx, dy);
         } else {
-            deltaEast+=dx;
-            deltaNorth+=dy;
+            deltaEast += dx;
+            deltaNorth += dy;
         }
     }
@@ -675,15 +672,15 @@
             EastNorthBound currentView = new EastNorthBound(mv.getEastNorth(0, mv.getHeight()),
                     mv.getEastNorth(mv.getWidth(), 0));
-            int minX = ((int)currentView.min.east()/modulo+1)*modulo;
-            int minY = ((int)currentView.min.north()/modulo+1)*modulo;
-            int maxX = ((int)currentView.max.east()/modulo)*modulo;
-            int maxY = ((int)currentView.max.north()/modulo)*modulo;
-            int size=(maxX-minX)/modulo;
-            if (size<20) {
-                int px= size > 10 ? 2 : Math.abs(12-size);
+            int minX = ((int) currentView.min.east()/modulo+1)*modulo;
+            int minY = ((int) currentView.min.north()/modulo+1)*modulo;
+            int maxX = ((int) currentView.max.east()/modulo)*modulo;
+            int maxY = ((int) currentView.max.north()/modulo)*modulo;
+            int size = (maxX-minX)/modulo;
+            if (size < 20) {
+                int px = size > 10 ? 2 : Math.abs(12-size);
                 g.setColor(Color.green);
-                for (int x=minX; x<=maxX; x+=modulo) {
-                    for (int y=minY; y<=maxY; y+=modulo) {
-                        Point p = mv.getPoint(new EastNorth(x,y));
+                for (int x = minX; x <= maxX; x += modulo) {
+                    for (int y = minY; y <= maxY; y += modulo) {
+                        Point p = mv.getPoint(new EastNorth(x, y));
                         g.drawLine(p.x-px, p.y, p.x+px, p.y);
                         g.drawLine(p.x, p.y-px, p.x, p.y+px);
