Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 33514)
@@ -7,5 +7,4 @@
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -15,7 +14,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.io.ProgressInputStream;
 
 public class CadastreGrabber {
@@ -86,9 +83,5 @@
 
     private BufferedImage grab(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
-        wmsInterface.urlConn.setRequestProperty("Connection", "close");
-        wmsInterface.urlConn.setRequestMethod("GET");
-        wmsInterface.setCookie();
-        try (InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE)) {
+        try (InputStream is = wmsInterface.getContent(url)) {
             return ImageIO.read(is);
         }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 33514)
@@ -7,4 +7,5 @@
 import java.io.BufferedReader;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
@@ -29,9 +30,13 @@
 import org.openstreetmap.josm.data.validation.util.Entities;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.io.OsmTransferException;
+import org.openstreetmap.josm.io.ProgressInputStream;
 import org.openstreetmap.josm.tools.GBC;
 
 public class CadastreInterface {
     public boolean downloadCanceled;
-    public HttpURLConnection urlConn;
+    private HttpURLConnection urlConn;
 
     private String cookie;
@@ -53,5 +58,5 @@
     private long cookieTimestamp;
 
-    static final String BASE_URL = "http://www.cadastre.gouv.fr";
+    static final String BASE_URL = "https://www.cadastre.gouv.fr";
     static final String C_IMAGE_FORMAT = "Cette commune est au format ";
     static final String C_COMMUNE_LIST_START = "<select name=\"codeCommune\"";
@@ -98,7 +103,8 @@
         } catch (IOException e) {
             Main.error(e);
-            JOptionPane.showMessageDialog(Main.parent,
+            GuiHelper.runInEDT(() ->
+                JOptionPane.showMessageDialog(Main.parent,
                     tr("Town/city {0} not found or not available\n" +
-                            "or action canceled", wmsLayer.getLocation()));
+                            "or action canceled", wmsLayer.getLocation())));
             return false;
         }
@@ -191,5 +197,5 @@
     }
 
-    public void setCookie() {
+    private void setCookie() {
         this.urlConn.setRequestProperty("Cookie", this.cookie);
     }
@@ -591,3 +597,11 @@
         lastWMSLayerName = null;
     }
+
+    public InputStream getContent(URL url) throws IOException, OsmTransferException {
+        urlConn = (HttpURLConnection) url.openConnection();
+        urlConn.setRequestProperty("Connection", "close");
+        urlConn.setRequestMethod("GET");
+        setCookie();
+        return new ProgressInputStream(urlConn, NullProgressMonitor.INSTANCE);
+    }
 }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 33514)
@@ -40,5 +40,5 @@
 
 /**
- * Plugin to access the French Cadastre WMS server at <a href="http://www.cadastre.gouv.fr">
+ * Plugin to access the French Cadastre WMS server at <a href="https://www.cadastre.gouv.fr">
  * www.cadastre.gouv.fr</a>.<br>
  * This WMS server requires some specific handling like retrieving a cookie for a
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 33514)
@@ -11,5 +11,4 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -31,7 +30,5 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.io.ProgressInputStream;
 
 public class DownloadSVGBuilding extends PleaseWaitRunnable {
@@ -243,11 +240,7 @@
 
     private String grabSVG(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
-        wmsInterface.urlConn.setRequestProperty("Connection", "close");
-        wmsInterface.urlConn.setRequestMethod("GET");
-        wmsInterface.setCookie();
         File file = new File(CadastrePlugin.cacheDir + "building.svg");
         String svg = "";
-        try (InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE)) {
+        try (InputStream is = wmsInterface.getContent(url)) {
             if (file.exists())
                 file.delete();
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 33514)
@@ -11,5 +11,4 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -31,7 +30,6 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.io.ProgressInputStream;
+
 /**
  * Grab the SVG administrative boundaries of the active commune layer (cadastre),
@@ -193,11 +191,7 @@
 
     private String grabSVG(URL url) throws IOException, OsmTransferException {
-        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
-        wmsInterface.urlConn.setRequestProperty("Connection", "close");
-        wmsInterface.urlConn.setRequestMethod("GET");
-        wmsInterface.setCookie();
         File file = new File(CadastrePlugin.cacheDir + "boundary.svg");
         String svg = "";
-        try (InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE)) {
+        try (InputStream is = wmsInterface.getContent(url)) {
             if (file.exists())
                 file.delete();
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 33514)
@@ -49,5 +49,5 @@
                             if (wmsLayer.grabThread.getCacheControl().loadCacheIfExist()) {
                                 dontGeoreference = true;
-                                Main.map.mapView.repaint();
+                                wmsLayer.invalidate();
                                 return;
                             }
@@ -61,5 +61,5 @@
                             if (wmsLayer.grabber.getWmsInterface().downloadCanceled) {
                                 wmsLayer.clearImages();
-                                Main.map.mapView.repaint();
+                                wmsLayer.invalidate();
                             } else {
                                 // next steps follow in method finish() when download is terminated
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 33514)
@@ -119,5 +119,5 @@
                         }
                         wmsLayer.addImage(newImage);
-                        Main.map.mapView.repaint();
+                        wmsLayer.invalidate();
                         saveToCache(newImage);
                     } catch (NullPointerException e) {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 33514)
@@ -126,5 +126,5 @@
               if (countMouseClicked == 2) {
                   wmsLayer.cropImage(ea1, ea);
-                  Main.map.mapView.repaint();
+                  wmsLayer.invalidate();
                   startGeoreferencing(wmsLayer);
               }
@@ -201,5 +201,5 @@
      affineTransform(ea1, ea2, georefpoint1, georefpoint2);
      wmsLayer.grabThread.saveNewCache();
-     Main.map.mapView.repaint();
+     wmsLayer.invalidate();
      actionCompleted();
      clickOnTheMap = false;
@@ -300,5 +300,5 @@
     affineTransform(ea1, ea2, georefpoint1, georefpoint2);
     wmsLayer.grabThread.saveNewCache();
-    Main.map.mapView.repaint();
+    wmsLayer.invalidate();
 }
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java	(revision 33514)
@@ -64,5 +64,5 @@
 
     /* From Aviaton Formulary v1.3
-     * http://williams.best.vwh.net/avform.htm
+     * http://www.edwilliams.org/avform.htm
      */
     public static double dist(double lat1, double lon1, double lat2, double lon2) {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 33514)
@@ -112,5 +112,7 @@
             prevEastNorth = newEastNorth;
         }
-        Main.map.mapView.repaint();
+        if (modifiedLayer != null) {
+            modifiedLayer.invalidate();
+        }
     }
 
@@ -161,9 +163,12 @@
     }
 
-    @Override public void mouseReleased(MouseEvent e) {
+    @Override
+    public void mouseReleased(MouseEvent e) {
         if (mode == Mode.rotate) {
             EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(), e.getY());
             rotate(prevEastNorth, newEastNorth);
-            Main.map.mapView.repaint();
+            if (modifiedLayer != null) {
+                modifiedLayer.invalidate();
+            }
         }
         Main.map.mapView.setCursor(Cursor.getDefaultCursor());
@@ -188,5 +193,5 @@
 
     private void saveModifiedLayers() {
-            modifiedLayer.grabThread.saveNewCache();
+        modifiedLayer.grabThread.saveNewCache();
     }
 }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 33513)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 33514)
@@ -98,5 +98,4 @@
     private Action refineGeoRef;
 
-    @SuppressWarnings("serial")
     class ResetOffsetActionMenu extends JosmAction {
         ResetOffsetActionMenu() {
@@ -108,5 +107,5 @@
             deltaEast = 0;
             deltaNorth = 0;
-            Main.map.mapView.repaint();
+            invalidate();
         }
     }
