Index: /applications/editors/josm/plugins/cadastre-fr/CONTRIBUTION
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/CONTRIBUTION	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/CONTRIBUTION	(revision 15961)
@@ -1,4 +1,4 @@
-The French Cadastre plugin is designed and coded by Pieren <pieren3@gmail.com> 
+The French Cadastre plugin is designed and coded by Pieren <pieren3@gmail.com>
 and is inspired by the wmsplugin for the special handling required by
 the french cadastre WMS www.cadatre.gouv.fr.
-This particular WMS provides vectorized or raster images for only one municipality at a time. 
+This particular WMS provides vectorized or raster images for only one municipality at a time.
Index: /applications/editors/josm/plugins/cadastre-fr/README
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/README	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/README	(revision 15961)
@@ -5,8 +5,8 @@
 is required at the beginning to specify which municipality is desired.
 
-The plugin is today only requesting PNG images on user request only. The 
+The plugin is today only requesting PNG images on user request only. The
 images can be stored in a cache file and reloaded later. The grabed images
 can be done at any zoom level and the drawing method will always select the
-best images (highest scale) to be displayed in front of worst images 
+best images (highest scale) to be displayed in front of worst images
 (lowest scale).
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 15961)
@@ -4,7 +4,7 @@
  * wait status on GUI, fast saving even in big file). A separate thread is created for each WMS
  * layer to not suspend the GUI until disk I/O is terminated (a file for the cache can take
- * several MB's). If the cache file already exists, new images are just appended to the file 
- * (performance). Since we use the ObjectStream methods, it is required to modify the standard 
- * ObjectOutputStream in order to have objects appended readable (otherwise a stream header 
+ * several MB's). If the cache file already exists, new images are just appended to the file
+ * (performance). Since we use the ObjectStream methods, it is required to modify the standard
+ * ObjectOutputStream in order to have objects appended readable (otherwise a stream header
  * is inserted before each append and an exception is raised at objects read).
  */
@@ -31,13 +31,13 @@
 
     public static boolean cacheEnabled = true;
-    
+
     public static int cacheSize = 500;
-    
-    
+
+
     public WMSLayer wmsLayer = null;
-    
+
     private ArrayList<GeorefImage> imagesToSave = new ArrayList<GeorefImage>();
     private Lock imagesLock = new ReentrantLock();
-      
+
     public CacheControl(WMSLayer wmsLayer) {
         cacheEnabled = Main.pref.getBoolean("cadastrewms.enableCaching", true);
@@ -55,5 +55,5 @@
         new Thread(this).start();
     }
-    
+
     private void checkDirSize(File path) {
         long size = 0;
@@ -69,5 +69,5 @@
         }
         if (size > cacheSize*1024*1024) {
-            System.out.println("Delete oldest file  \""+ files[oldestFile].getName() 
+            System.out.println("Delete oldest file  \""+ files[oldestFile].getName()
                     + "\" in cache dir to stay under the limit of " + cacheSize + " MB.");
             files[oldestFile].delete();
@@ -75,10 +75,10 @@
         }
     }
-    
+
     public boolean loadCacheIfExist() {
         try {
             File file = new File(CadastrePlugin.cacheDir + wmsLayer.name + "." + String.valueOf(wmsLayer.lambertZone+1));
             if (file.exists()) {
-                int reply = JOptionPane.showConfirmDialog(null, 
+                int reply = JOptionPane.showConfirmDialog(null,
                         "Location \""+wmsLayer.name+"\" found in cache.\n"+
                         "Load cache first ?\n"+
@@ -90,5 +90,5 @@
                 } else
                     file.delete();
-            }            
+            }
         } catch (Exception e) {
             e.printStackTrace(System.out);
@@ -96,5 +96,5 @@
         return false;
     }
-    
+
     public void deleteCacheFile() {
         try {
@@ -106,5 +106,5 @@
         }
     }
-    
+
     public boolean loadCache(File file, int currentLambertZone) {
         try {
@@ -166,4 +166,3 @@
         }
     }
-
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileFilter.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileFilter.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheFileFilter.java	(revision 15961)
@@ -13,9 +13,9 @@
     private final String description;
 
-    public static CacheFileFilter[] filters = { 
+    public static CacheFileFilter[] filters = {
         new CacheFileFilter("1", tr("Lambert Zone 1 cache file (.1)")),
         new CacheFileFilter("2", tr("Lambert Zone 2 cache file (.2)")),
         new CacheFileFilter("3", tr("Lambert Zone 3 cache file (.3)")),
-        new CacheFileFilter("4", tr("Lambert Zone 4 cache file (.4)")) 
+        new CacheFileFilter("4", tr("Lambert Zone 4 cache file (.4)"))
         };
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 15961)
@@ -14,18 +14,19 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.ProgressInputStream;
 
 public class CadastreGrabber {
 
-	public static final double epsilon = 1e-11;
-	
-	private CadastreInterface wmsInterface = new CadastreInterface(this);
+    public static final double epsilon = 1e-11;
+
+    private CadastreInterface wmsInterface = new CadastreInterface(this);
     private String lastWMSLayerName = null;
-	
-	CadastreGrabber() {
-        getWmsInterface().downloadCancelled = false;	    
-	}
-	
-    public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws IOException {
+
+    CadastreGrabber() {
+        getWmsInterface().downloadCancelled = false;
+    }
+
+    public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws IOException, OsmTransferException {
 
         try {
@@ -58,34 +59,34 @@
     private URL getURLVector(EastNorth lambertMin, EastNorth lambertMax) throws MalformedURLException {
         String str = new String(wmsInterface.baseURL+"/scpc/wms?version=1.1&request=GetMap");
-		str += "&layers=CDIF:LS3,CDIF:LS2,CDIF:LS1,CDIF:PARCELLE,CDIF:NUMERO";
-		str += ",CDIF:PT3,CDIF:PT2,CDIF:PT1,CDIF:LIEUDIT";
-		str += ",CDIF:SUBSECTION";
-		str += ",CDIF:SECTION";
-		str += ",CDIF:COMMUNE";
-		str += "&format=image/png";
-		//str += "&format=image/jpeg";
-		str += "&bbox="+lambertMin.east()+",";
-		str += lambertMin.north() + ",";
-		str += lambertMax.east() + ",";
-		str += lambertMax.north();
-		//str += "&width=800&height=600"; // maximum allowed by wms server
+        str += "&layers=CDIF:LS3,CDIF:LS2,CDIF:LS1,CDIF:PARCELLE,CDIF:NUMERO";
+        str += ",CDIF:PT3,CDIF:PT2,CDIF:PT1,CDIF:LIEUDIT";
+        str += ",CDIF:SUBSECTION";
+        str += ",CDIF:SECTION";
+        str += ",CDIF:COMMUNE";
+        str += "&format=image/png";
+        //str += "&format=image/jpeg";
+        str += "&bbox="+lambertMin.east()+",";
+        str += lambertMin.north() + ",";
+        str += lambertMax.east() + ",";
+        str += lambertMax.north();
+        //str += "&width=800&height=600"; // maximum allowed by wms server
         str += "&width=1000&height=800"; // maximum allowed by wms server
-		str += "&styles=LS3_90,LS2_90,LS1_90,PARCELLE_90,NUMERO_90,PT3_90,PT2_90,PT1_90,LIEUDIT_90";
-		str += ",SUBSECTION_90";
-		str += ",SECTION_90";
-		str += ",COMMUNE_90";
-		System.out.println("URL="+str);
+        str += "&styles=LS3_90,LS2_90,LS1_90,PARCELLE_90,NUMERO_90,PT3_90,PT2_90,PT1_90,LIEUDIT_90";
+        str += ",SUBSECTION_90";
+        str += ",SECTION_90";
+        str += ",COMMUNE_90";
+        System.out.println("URL="+str);
         return new URL(str.replace(" ", "%20"));
-	}
+    }
 
-	private BufferedImage grab(URL url) throws IOException {
-	    wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
-	    wmsInterface.urlConn.setRequestMethod("GET");
-	    wmsInterface.setCookie();
-		InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
-		BufferedImage img = ImageIO.read(is);
+    private BufferedImage grab(URL url) throws IOException, OsmTransferException {
+        wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
+        wmsInterface.urlConn.setRequestMethod("GET");
+        wmsInterface.setCookie();
+        InputStream is = new ProgressInputStream(wmsInterface.urlConn, Main.pleaseWaitDlg);
+        BufferedImage img = ImageIO.read(is);
         is.close();
         return img;
-	}
+    }
 
     public CadastreInterface getWmsInterface() {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 15961)
@@ -41,12 +41,12 @@
     final String cBBoxCommunStart = "new GeoBox(";
     final String cBBoxCommunEnd = ")";
-    
+
     final String cInterfaceVector = "afficherCarteCommune.do";
     final String cInterfaceRaster = "afficherCarteTa.do";
-        
+
     CadastreInterface(CadastreGrabber cadastreGrabber) {
         this.cadastreGrabber = cadastreGrabber;
     }
-    
+
     public boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException {
         if (wmsLayer.name.equals(""))
@@ -64,5 +64,5 @@
             JOptionPane.showMessageDialog(Main.parent,
                     tr("Town/city {0} not found or not available in WMS.\n" +
-                    		"Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation()));
+                            "Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation()));
             return false;
         }
@@ -99,5 +99,5 @@
         cadastreGrabber.setLastWMSLayerName(null);
     }
-    
+
     public void resetCookieIfNewLayer(String newWMSLayerName) {
         if (!newWMSLayerName.equals(cadastreGrabber.getLastWMSLayerName())) {
@@ -105,9 +105,9 @@
         }
     }
-    
+
     public void setCookie() {
         urlConn.setRequestProperty("Cookie", cookie);
     }
-    
+
     private void getInterface(WMSLayer wmsLayer) throws IOException, DuplicateLayerException {
         // first attempt : search for given name without codeCommune
@@ -134,9 +134,9 @@
             }
         }
-        
+
         if (interfaceRef == null)
             throw new IOException("Town/city " + wmsLayer.getLocation() + " not found.");
     }
-    
+
     private void openInterface() throws IOException  {
         try {
@@ -158,10 +158,10 @@
         }
     }
-    
+
     /**
      * Post the form with the commune name and check the returned answer which is embedded
      * in HTTP XML packets. This function doesn't use an XML parser yet but that would be a good idea
      * for the next releases.
-     * Two possibilities : 
+     * Two possibilities :
      * - either the commune name matches and we receive an URL starting with "afficherCarteCommune.do" or
      * - we don't receive a single answer but a list of possible values. This answer looks like:
@@ -171,5 +171,5 @@
      *   <option value="QK066" >COLMAR - 68000</option>
      *   </select>
-     * 
+     *
      * @param location
      * @param codeCommune
@@ -245,5 +245,5 @@
         return null;
     }
-    
+
     private void parseCommuneList(String input) {
         if (input.indexOf(c0ptionListStart) != -1) {
@@ -264,5 +264,5 @@
         }
     }
-    
+
     private void parseTAList(String input) {
         while (input.indexOf(cInterfaceRaster) != -1) {
@@ -272,5 +272,5 @@
             if (!listOfTA.contains(codeTA)) {
                 System.out.println("parse "+codeTA);
-                listOfTA.add(codeTA);                
+                listOfTA.add(codeTA);
             }
             input = input.substring(cInterfaceRaster.length());
@@ -314,5 +314,5 @@
         return cInterfaceRaster + "?f=" + codeCommune;
     }
-    
+
     public EastNorthBound retrieveCommuneBBox() throws IOException {
         if (interfaceRef == null)
@@ -340,5 +340,5 @@
         return parseBBoxCommune(line);
     }
-    
+
     private EastNorthBound parseBBoxCommune(String input) {
         if (input.indexOf(cBBoxCommunStart) != -1) {
@@ -356,5 +356,5 @@
         return null;
     }
-    
+
     private void checkLayerDuplicates(WMSLayer wmsLayer) throws DuplicateLayerException {
         if (Main.map != null) {
@@ -369,6 +369,6 @@
         }
     }
-    
-    public void cancel() {      
+
+    public void cancel() {
         Main.pleaseWaitDlg.currentAction.setText(tr("Aborting..."));
         if (urlConn != null) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 15961)
@@ -190,5 +190,5 @@
             transparency = 1.0f;
         }
-        // overwrite F11 shortcut used from the beginning by this plugin and recently used 
+        // overwrite F11 shortcut used from the beginning by this plugin and recently used
         // for full-screen switch in JOSM core
         int i = 0;
@@ -202,5 +202,5 @@
         }
         if (!alreadyRedefined) {
-            int reply = JOptionPane.showConfirmDialog(null, 
+            int reply = JOptionPane.showConfirmDialog(null,
                     tr("Plugin cadastre-fr used traditionaly for grabbing the key shortcut F11\n"+
                     "which is currently allocated for full-screen switch by default\n"+
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 15961)
@@ -15,13 +15,13 @@
 /**
  * Preference settings for the French Cadastre plugin
- * 
+ *
  * @author Pieren <pieren3@gmail.com>
  */
 public class CadastrePreferenceSetting implements PreferenceSetting {
-    
+
     static final int TRANS_MIN = 1;
     static final int TRANS_MAX = 10;
-    private JSlider sliderTrans = new JSlider(JSlider.HORIZONTAL, TRANS_MIN, TRANS_MAX, TRANS_MAX); 
-    
+    private JSlider sliderTrans = new JSlider(JSlider.HORIZONTAL, TRANS_MIN, TRANS_MAX, TRANS_MAX);
+
     private JTextField sourcing = new JTextField(20);
 
@@ -29,7 +29,7 @@
 
     private JCheckBox reversGrey = new JCheckBox(tr("Reverse grey colors (for black backgrounds)."));
-    
+
     private JCheckBox transparency = new JCheckBox(tr("Set background transparent."));
-    
+
     private JCheckBox drawBoundaries = new JCheckBox(tr("Draw boundaries of downloaded data."));
 
@@ -39,5 +39,5 @@
 
     private JRadioButton grabMultiplier3 = new JRadioButton("", true);
-    
+
     private JRadioButton grabMultiplier4 = new JRadioButton("", true);
 
@@ -97,5 +97,5 @@
         sliderTrans.setPaintLabels(false);
         cadastrewms.add(sliderTrans, GBC.eol().fill(GBC.HORIZONTAL).insets(20, 0, 250, 0));
-        
+
         // option to draw boundaries of downloaded data
         drawBoundaries.setSelected(Main.pref.getBoolean("cadastrewms.drawBoundaries", false));
@@ -150,5 +150,5 @@
         grabMultiplier4Size.setEnabled(currentScale.equals(Scale.SQUARE_100M.value));
         cadastrewms.add(grabMultiplier4Size, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 0, 5));
-        
+
         // option to enable automatic caching
         enableCache.addActionListener(new ActionListener() {
@@ -197,5 +197,5 @@
         }
         Main.pref.put("cadastrewms.enableCaching", enableCache.isSelected());
-        
+
         // spread data into objects instead of restarting the application
         try {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java	(revision 15961)
@@ -24,10 +24,10 @@
 /**
  * This hook is called at JOSM upload and will check if new nodes and ways provide
- * a tag "source=". If not and if auto-sourcing is enabled, it will add 
+ * a tag "source=". If not and if auto-sourcing is enabled, it will add
  * automatically a tag "source"="Cadastre..." as defined in the plugin preferences.
  */
 public class CheckSourceUploadHook implements UploadHook
 {
-	/** Serializable ID */
+    /** Serializable ID */
     private static final long serialVersionUID = -1;
 
@@ -40,5 +40,5 @@
             Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
             for (OsmPrimitive osm : add) {
-                if ((osm instanceof Node || osm instanceof Way) 
+                if ((osm instanceof Node || osm instanceof Way)
                         && (osm.keys == null || !tagSourceExist(osm))) {
                     sel.add(osm);
@@ -51,5 +51,5 @@
         return true;
     }
-    
+
     /**
      * Check whenever one of the keys of the object is "source"
@@ -65,11 +65,11 @@
         return false;
     }
-    
+
     /**
-     * Displays a screen with the list of objects which will be tagged with 
+     * Displays a screen with the list of objects which will be tagged with
      * source="cadastre.." if it is approved.
      * @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()) {
@@ -86,5 +86,5 @@
                 Main.main.undoRedo.add(new ChangePropertyCommand(sel, "source", CadastrePlugin.source));
         }
-                
-    }    
+
+    }
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 15961)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.ProgressInputStream;
 
@@ -39,5 +40,5 @@
     private static EastNorthBound currentView = null;
     private EastNorthBound viewBox = null;
-    
+
     public DownloadSVGBuilding(WMSLayer wmsLayer) {
         super(tr("Downloading {0}", wmsLayer.name));
@@ -48,5 +49,5 @@
 
     @Override
-    public void realRun() throws IOException {
+    public void realRun() throws IOException, OsmTransferException {
         Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
         try {
@@ -77,5 +78,5 @@
         double[] box = new SVGParser().getViewBox(svg);
         if (box != null) {
-            viewBox = new EastNorthBound(new EastNorth(box[0], box[1]), 
+            viewBox = new EastNorthBound(new EastNorth(box[0], box[1]),
                     new EastNorth(box[0]+box[2], box[1]+box[3]));
             return true;
@@ -84,5 +85,5 @@
         return false;
     }
-    
+
     /**
      *  The svg contains more than one commune boundary defined by path elements. So detect
@@ -92,6 +93,6 @@
         String[] SVGpaths = new SVGParser().getClosedPaths(svg);
         ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<ArrayList<EastNorth>>();
-        
-        // convert SVG nodes to eastNorth coordinates 
+
+        // convert SVG nodes to eastNorth coordinates
         for (int i=0; i< SVGpaths.length; i++) {
             ArrayList<EastNorth> eastNorth = new ArrayList<EastNorth>();
@@ -107,6 +108,6 @@
             for (EastNorth eastNorth : path) {
                 Node nodeToAdd = new Node(Main.proj.eastNorth2latlon(eastNorth));
-                // check if new node is not already created by another new path 
-                Node nearestNewNode = checkNearestNode(nodeToAdd, svgDataSet.nodes); 
+                // check if new node is not already created by another new path
+                Node nearestNewNode = checkNearestNode(nodeToAdd, svgDataSet.nodes);
                 if (nearestNewNode == nodeToAdd)
                     svgDataSet.addPrimitive(nearestNewNode);
@@ -116,5 +117,5 @@
             svgDataSet.addPrimitive(wayToAdd);
         }
-        
+
         // TODO remove small boxes (4 nodes with less than 1 meter distance)
         /*
@@ -130,5 +131,5 @@
         // check if the new way or its nodes is already in OSM layer
         for (Node n : svgDataSet.nodes) {
-            Node nearestNewNode = checkNearestNode(n, Main.ds.nodes); 
+            Node nearestNewNode = checkNearestNode(n, Main.ds.nodes);
             if (nearestNewNode != n) {
                 // replace the SVG node by the OSM node
@@ -145,5 +146,5 @@
                 n.delete(true);
             }
-                
+
         }
 
@@ -158,5 +159,5 @@
         Main.map.repaint();
     }
-    
+
     private void createNodes(String SVGpath, ArrayList<EastNorth> eastNorth) {
         // looks like "M981283.38 368690.15l143.81 72.46 155.86 ..."
@@ -170,8 +171,8 @@
             }
             double east = dx+=Double.parseDouble(coor[i]);
-            double north = dy+=Double.parseDouble(coor[i+1]); 
+            double north = dy+=Double.parseDouble(coor[i+1]);
             eastNorth.add(new EastNorth(east,north));
         }
-        // flip the image (svg using a reversed Y coordinate system)            
+        // flip the image (svg using a reversed Y coordinate system)
         double pivot = viewBox.min.getY() + (viewBox.max.getY() - viewBox.min.getY()) / 2;
         for (EastNorth en : eastNorth) {
@@ -183,6 +184,6 @@
     /**
      * Check if node can be reused.
-     * @param nodeToAdd the candidate as new node 
-     * @return the already existing node (if any), otherwise the new node candidate. 
+     * @param nodeToAdd the candidate as new node
+     * @return the already existing node (if any), otherwise the new node candidate.
      */
     private Node checkNearestNode(Node nodeToAdd, Collection<Node> nodes) {
@@ -199,6 +200,5 @@
     }
 
-    private String grabBoundary(EastNorthBound bbox) throws IOException {
-
+    private String grabBoundary(EastNorthBound bbox) throws IOException, OsmTransferException {
         try {
             URL url = null;
@@ -210,5 +210,5 @@
         }
     }
-    
+
     private URL getURLsvg(EastNorthBound bbox) throws MalformedURLException {
         String str = new String(wmsInterface.baseURL+"/scpc/wms?version=1.1&request=GetMap");
@@ -228,5 +228,5 @@
     }
 
-    private String grabSVG(URL url) throws IOException {
+    private String grabSVG(URL url) throws IOException, OsmTransferException {
         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
         wmsInterface.urlConn.setRequestMethod("GET");
@@ -259,5 +259,5 @@
         currentView = new EastNorthBound(mv.getEastNorth(0, mv.getHeight()),
                 mv.getEastNorth(mv.getWidth(), 0));
-        if ((currentView.max.east() - currentView.min.east()) > 1000 || 
+        if ((currentView.max.east() - currentView.min.east()) > 1000 ||
                 (currentView.max.north() - currentView.min.north() > 1000)) {
             JOptionPane.showMessageDialog(Main.parent,
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 15961)
@@ -29,7 +29,8 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.ProgressInputStream;
 /**
- * Grab the SVG administrative boundaries of the active commune layer (cadastre), 
+ * Grab the SVG administrative boundaries of the active commune layer (cadastre),
  * isolate the SVG path of the concerned commune (other municipalities are also
  * downloaded in the SVG data), convert to OSM nodes and way plus simplify.
@@ -43,5 +44,5 @@
     private String svg = null;
     private EastNorthBound viewBox = null;
-    
+
     public DownloadSVGTask(WMSLayer wmsLayer) {
         super(tr("Downloading {0}", wmsLayer.name));
@@ -52,5 +53,5 @@
 
     @Override
-    public void realRun() throws IOException {
+    public void realRun() throws IOException, OsmTransferException {
         Main.pleaseWaitDlg.currentAction.setText(tr("Contacting WMS Server..."));
         try {
@@ -83,5 +84,5 @@
         double[] box = new SVGParser().getViewBox(svg);
         if (box != null) {
-            viewBox = new EastNorthBound(new EastNorth(box[0], box[1]), 
+            viewBox = new EastNorthBound(new EastNorth(box[0], box[1]),
                     new EastNorth(box[0]+box[2], box[1]+box[3]));
             return true;
@@ -90,5 +91,5 @@
         return false;
     }
-    
+
     /**
      *  The svg contains more than one commune boundary defined by path elements. So detect
@@ -97,5 +98,5 @@
     private void createWay(String svg) {
         String[] SVGpaths = new SVGParser().getClosedPaths(svg);
-        ArrayList<Double> fitViewBox = new ArrayList<Double>();  
+        ArrayList<Double> fitViewBox = new ArrayList<Double>();
         ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<ArrayList<EastNorth>>();
         for (int i=0; i< SVGpaths.length; i++) {
@@ -118,14 +119,14 @@
         }
         wayToAdd.nodes.add(wayToAdd.nodes.get(0)); // close the circle
-        
+
         // simplify the way
         double threshold = Double.parseDouble(Main.pref.get("cadastrewms.simplify-way-boundary", "1.0"));
         new SimplifyWay().simplifyWay(wayToAdd, Main.ds, threshold);
-        
+
         cmds.add(new AddCommand(wayToAdd));
         Main.main.undoRedo.add(new SequenceCommand(tr("Create boundary"), cmds));
         Main.map.repaint();
     }
-    
+
     private double createNodes(String SVGpath, ArrayList<EastNorth> eastNorth) {
         // looks like "M981283.38 368690.15l143.81 72.46 155.86 ..."
@@ -139,12 +140,12 @@
         for (int i=3; i<coor.length; i+=2){
             double east = dx+=Double.parseDouble(coor[i]);
-            double north = dy+=Double.parseDouble(coor[i+1]); 
+            double north = dy+=Double.parseDouble(coor[i+1]);
             eastNorth.add(new EastNorth(east,north));
-            minX = minX > east ? east : minX; 
-            minY = minY > north ? north : minY; 
-            maxX = maxX < east ? east : maxX; 
-            maxY = maxY < north ? north : maxY; 
-        }
-        // flip the image (svg using a reversed Y coordinate system)            
+            minX = minX > east ? east : minX;
+            minY = minY > north ? north : minY;
+            maxX = maxX < east ? east : maxX;
+            maxY = maxY < north ? north : maxY;
+        }
+        // flip the image (svg using a reversed Y coordinate system)
         double pivot = viewBox.min.getY() + (viewBox.max.getY() - viewBox.min.getY()) / 2;
         for (EastNorth en : eastNorth) {
@@ -154,7 +155,6 @@
         +Math.abs(minY - viewBox.min.getY())+Math.abs(maxY - viewBox.max.getY());
     }
-    
-    private String grabBoundary(EastNorthBound bbox) throws IOException {
-
+
+    private String grabBoundary(EastNorthBound bbox) throws IOException, OsmTransferException {
         try {
             URL url = null;
@@ -166,5 +166,5 @@
         }
     }
-    
+
     private URL getURLsvg(EastNorthBound bbox) throws MalformedURLException {
         String str = new String(wmsInterface.baseURL+"/scpc/wms?version=1.1&request=GetMap");
@@ -183,5 +183,5 @@
     }
 
-    private String grabSVG(URL url) throws IOException {
+    private String grabSVG(URL url) throws IOException, OsmTransferException {
         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
         wmsInterface.urlConn.setRequestMethod("GET");
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSTask.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSTask.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSTask.java	(revision 15961)
@@ -38,5 +38,5 @@
                     }
                     if (wmsLayer.isRaster())
-                        // set raster image commune bounding box based on current view (before adjustment) 
+                        // set raster image commune bounding box based on current view (before adjustment)
                         wmsLayer.setRasterBounds(bounds);
                     else
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java	(revision 15961)
@@ -8,5 +8,5 @@
 
     private static final long serialVersionUID = 8451650309216472069L;
-    
+
     public EastNorth min, max;
     public EastNorthBound(EastNorth min, EastNorth max) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java	(revision 15961)
@@ -28,7 +28,7 @@
 
     public BufferedImage image;
-    
+
     private double angle = 0; // in radian
-    
+
     private BufferedImage rotated_image; // only if angle <> 0
 
@@ -47,5 +47,5 @@
         max = new EastNorth(max.east() + dx, max.north() + dy);
     }
-    
+
     public void resize(EastNorth rasterCenter, double proportion) {
         min = min.interpolate(rasterCenter, proportion);
@@ -53,12 +53,12 @@
         updatePixelPer();
     }
-    
+
     public void rotate(EastNorth pivot, double delta) {
         if (angle == 0) {
-            org_min = min; 
+            org_min = min;
             org_max = max;
         }
         this.angle += delta;
-        
+
         EastNorth imageCenter = org_min.interpolate(org_max, 0.5);
         EastNorth newimageCenter = imageCenter.rotate(pivot, angle);
@@ -74,8 +74,8 @@
         max2 = max2.rotate(newimageCenter, angle);
         getNewBounding(min, max, min2, max2);
-        
+
         rotated_image = tilt(image, angle);
     }
-    
+
     public static BufferedImage tilt(BufferedImage image, double angle) {
         double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle));
@@ -96,5 +96,5 @@
         return gd.getDefaultConfiguration();
     }
-    
+
     private void getNewBounding(EastNorth min, EastNorth max, EastNorth c, EastNorth d) {
         EastNorth pt[] = new EastNorth[4];
@@ -116,5 +116,5 @@
         max.setLocation(highestEast, highestNorth);
     }
-    
+
     public boolean contains(EastNorth en) {
         return min.east() <= en.east() && en.east() <= max.east() && min.north() <= en.north()
@@ -165,5 +165,5 @@
     /**
      * Make all pixels masked by the given georefImage transparent in this image
-     * 
+     *
      * @param georefImage
      */
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java	(revision 15961)
@@ -18,5 +18,5 @@
     public static final int cadastreBackground = -1; // white
 
-    public static final int cadastreBackgroundTransp = 1; // original white but transparent 
+    public static final int cadastreBackgroundTransp = 1; // original white but transparent
 
     public BufferedImage bufferedImage;
@@ -25,5 +25,5 @@
 
     private int backgroundPixel = 0;
-    
+
     private int backgroundSampleX, backgroundSampleY;
 
@@ -34,5 +34,5 @@
         else if (Main.pref.getBoolean("cadastrewms.alterColors"))
             replaceBackground();
-        
+
         if (Main.pref.getBoolean("cadastrewms.invertGrey"))
             invertGrey();
@@ -59,5 +59,5 @@
         }
     }
-    
+
     /**
      * Invert black/white/grey pixels (to change original black characters to white).
@@ -78,5 +78,5 @@
     /**
      * Reverse the grey value if the pixel is grey (light grey becomes dark grey)
-     * Used for texts. 
+     * Used for texts.
      * @param pixel
      * @return
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 15961)
@@ -21,5 +21,5 @@
     public MenuActionGrab() {
         super(tr(name), "cadastre_small", tr("Download Image from french Cadastre WMS"),
-                Shortcut.registerShortcut("cadastre:grab", tr("Cadastre: {0}", tr("Download Image from french Cadastre WMS")), 
+                Shortcut.registerShortcut("cadastre:grab", tr("Cadastre: {0}", tr("Download Image from french Cadastre WMS")),
                 KeyEvent.VK_F11, Shortcut.GROUP_DIRECT), false);
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 15961)
@@ -31,5 +31,5 @@
             String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length());
             String location = filename.substring(0, filename.lastIndexOf("."));
-            // check the extension and its Lambert zone consistency 
+            // check the extension and its Lambert zone consistency
             try {
                 int cacheZone = Integer.parseInt(ext) - 1;
@@ -63,5 +63,5 @@
                 Main.main.addLayer(wmsLayer);
         }
-        
+
     }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 15961)
@@ -21,17 +21,17 @@
 public class MenuActionNewLocation extends JosmAction {
 
-	private static final long serialVersionUID = 1L;
-	
-	public MenuActionNewLocation() {
-		super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false);
-	}
+    private static final long serialVersionUID = 1L;
 
-	public void actionPerformed(ActionEvent e) {
+    public MenuActionNewLocation() {
+        super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false);
+    }
+
+    public void actionPerformed(ActionEvent e) {
         WMSLayer wmsLayer = addNewLayer(new ArrayList<WMSLayer>());
         if (wmsLayer != null)
             DownloadWMSTask.download(wmsLayer);
     }
-	
-	public WMSLayer addNewLayer(ArrayList<WMSLayer> existingLayers) {
+
+    public WMSLayer addNewLayer(ArrayList<WMSLayer> existingLayers) {
         if (Main.map == null) {
             JOptionPane.showMessageDialog(Main.parent,
@@ -88,5 +88,5 @@
                 System.out.println("Add new layer with Location:" + inputTown.getText());
             } else if (existingLayers != null && existingLayers.size() > 0 && inputWMSList.getSelectedIndex() > 0) {
-                wmsLayer = existingLayers.get(inputWMSList.getSelectedIndex()-1);            
+                wmsLayer = existingLayers.get(inputWMSList.getSelectedIndex()-1);
                 resetCookie = true;
             }
@@ -97,4 +97,4 @@
         }
     }
-	
+
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 15961)
@@ -10,5 +10,5 @@
 
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 1L;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Scale.java	(revision 15961)
@@ -6,9 +6,9 @@
  * view is split in 2x2 bounding boxes and X3 is 3x3 boxes.
  * SQUARE_100M is a special value where bounding boxes have a fixed size of 100x100 meters
- * and east,north are rounded to the lowest 100 meter as well, thus none of the bounding boxes 
+ * and east,north are rounded to the lowest 100 meter as well, thus none of the bounding boxes
  * are overlapping each others.
  */
-public enum Scale { 
-    X1("1"), 
+public enum Scale {
+    X1("1"),
     X2("2"),
     X3("3"),
@@ -19,5 +19,5 @@
      */
     public final String value;
-    
+
     Scale(String value) {
         this.value = value;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 15961)
@@ -1,3 +1,3 @@
-package cadastre_fr; 
+package cadastre_fr;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -20,27 +20,27 @@
 
 public class WMSAdjustAction extends MapMode implements
-		MouseListener, MouseMotionListener{
+        MouseListener, MouseMotionListener{
 
     private static final long serialVersionUID = 1L;
     GeorefImage selectedImage;
     private ArrayList<WMSLayer> modifiedLayers = new ArrayList<WMSLayer>();
-	WMSLayer selectedLayer;
-	private boolean rasterMoved;
-	private EastNorth prevEastNorth;
+    WMSLayer selectedLayer;
+    private boolean rasterMoved;
+    private EastNorth prevEastNorth;
     enum Mode { moveXY, moveZ, rotate}
     private Mode mode = null;
 
-	public WMSAdjustAction(MapFrame mapFrame) {
-		super(tr("Adjust WMS"), "adjustxywms", 
-						tr("Adjust the position of the WMS layer (raster images only)"), mapFrame, 
-						ImageProvider.getCursor("normal", "move"));
-	}
+    public WMSAdjustAction(MapFrame mapFrame) {
+        super(tr("Adjust WMS"), "adjustxywms",
+                        tr("Adjust the position of the WMS layer (raster images only)"), mapFrame,
+                        ImageProvider.getCursor("normal", "move"));
+    }
 
-	@Override public void enterMode() {
-		super.enterMode();
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-		rasterMoved = false;
-		/*/ FOR TEST
+    @Override public void enterMode() {
+        super.enterMode();
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+        rasterMoved = false;
+        /*/ FOR TEST
         for (Layer layer : Main.map.mapView.getAllLayers()) {
             if (layer.visible && layer instanceof WMSLayer) {
@@ -50,23 +50,23 @@
         }
         Main.map.mapView.repaint();*/
-	}
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
-		Main.map.mapView.removeMouseMotionListener(this);
-		if (rasterMoved && CacheControl.cacheEnabled) {
-            int reply = JOptionPane.showConfirmDialog(null, 
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+        if (rasterMoved && CacheControl.cacheEnabled) {
+            int reply = JOptionPane.showConfirmDialog(null,
                     "Save the changes in cache ?",
                     "Update cache",
-                    JOptionPane.YES_NO_OPTION);		    
+                    JOptionPane.YES_NO_OPTION);
             if (reply == JOptionPane.OK_OPTION) {
                 saveModifiedLayers();
             }
-		}
-		modifiedLayers.clear();
-	}
+        }
+        modifiedLayers.clear();
+    }
 
-	@Override
+    @Override
     public void mousePressed(MouseEvent e) {
         if (e.getButton() != MouseEvent.BUTTON1)
@@ -93,14 +93,14 @@
     }
 
-	@Override public void mouseDragged(MouseEvent e) {
-		if(selectedImage != null && (mode == Mode.moveXY || mode == Mode.moveZ || mode == Mode.rotate)) {
+    @Override public void mouseDragged(MouseEvent e) {
+        if(selectedImage != null && (mode == Mode.moveXY || mode == Mode.moveZ || mode == Mode.rotate)) {
             EastNorth newEastNorth = Main.map.mapView.getEastNorth(e.getX(),e.getY());
-		    if (mode == Mode.moveXY) {
-		        displace(prevEastNorth, newEastNorth);
-	        } else if (mode == Mode.moveZ) {
-	            resize(newEastNorth);
-	        } else if (mode == Mode.rotate) {
-	            rotate(prevEastNorth, newEastNorth);
-	        }
+            if (mode == Mode.moveXY) {
+                displace(prevEastNorth, newEastNorth);
+            } else if (mode == Mode.moveZ) {
+                resize(newEastNorth);
+            } else if (mode == Mode.rotate) {
+                rotate(prevEastNorth, newEastNorth);
+            }
             rasterMoved = true;
             if (!modifiedLayers.contains(selectedLayer))
@@ -108,48 +108,48 @@
             Main.map.mapView.repaint();
             prevEastNorth = newEastNorth;
-		}
-	}
-	
-	private void displace(EastNorth start, EastNorth end) {
+        }
+    }
+
+    private void displace(EastNorth start, EastNorth end) {
         selectedLayer.displace(end.east()-start.east(), end.north()-start.north());
-	}
-	
-	private void resize(EastNorth newEastNorth) {
+    }
+
+    private void resize(EastNorth newEastNorth) {
         double dPrev = prevEastNorth.distance(selectedLayer.getRasterCenter().east(), selectedLayer.getRasterCenter().north());
         double dNew = newEastNorth.distance(selectedLayer.getRasterCenter().east(), selectedLayer.getRasterCenter().north());
         selectedLayer.resize(1 - dNew/dPrev);
-	}
-	
-	private void rotate(EastNorth start, EastNorth end) {
-	    EastNorth pivot = selectedLayer.getRasterCenter();
-	    double startAngle = Math.atan2(start.east()-pivot.east(), start.north()-pivot.north());
-	    double endAngle = Math.atan2(end.east()-pivot.east(), end.north()-pivot.north());
+    }
+
+    private void rotate(EastNorth start, EastNorth end) {
+        EastNorth pivot = selectedLayer.getRasterCenter();
+        double startAngle = Math.atan2(start.east()-pivot.east(), start.north()-pivot.north());
+        double endAngle = Math.atan2(end.east()-pivot.east(), end.north()-pivot.north());
         double rotationAngle = endAngle - startAngle;
-        selectedLayer.rotate(rotationAngle);              	    
-	}
+        selectedLayer.rotate(rotationAngle);
+    }
 
-	@Override public void mouseReleased(MouseEvent e) {
-		//Main.map.mapView.repaint();
-		Main.map.mapView.setCursor(Cursor.getDefaultCursor());
-		selectedImage = null;	
-		prevEastNorth = null;
-		selectedLayer = null;
-		mode = null;
-	}
+    @Override public void mouseReleased(MouseEvent e) {
+        //Main.map.mapView.repaint();
+        Main.map.mapView.setCursor(Cursor.getDefaultCursor());
+        selectedImage = null;
+        prevEastNorth = null;
+        selectedLayer = null;
+        mode = null;
+    }
 
-	public void mouseEntered(MouseEvent e) {
-	}
-	public void mouseExited(MouseEvent e) {
-	}
-	public void mouseMoved(MouseEvent e) {
-	}
+    public void mouseEntered(MouseEvent e) {
+    }
+    public void mouseExited(MouseEvent e) {
+    }
+    public void mouseMoved(MouseEvent e) {
+    }
 
-	@Override public void mouseClicked(MouseEvent e) {
-	}
-	
-	private void saveModifiedLayers() {
+    @Override public void mouseClicked(MouseEvent e) {
+    }
+
+    private void saveModifiedLayers() {
         for (WMSLayer wmsLayer : modifiedLayers) {
             wmsLayer.saveNewCache();
         }
-	}
+    }
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 15960)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 15961)
@@ -16,14 +16,14 @@
     private static final long serialVersionUID = 1L;
 
-	public WMSDownloadAction(String layerName) {
-		super(layerName, "wmsmenu", tr("Download WMS tile from {0}",layerName), null, false);
-	}
-	
-	public void actionPerformed(ActionEvent e) {		
-		DownloadWMSTask.download(getLayer());
-	}
+    public WMSDownloadAction(String layerName) {
+        super(layerName, "wmsmenu", tr("Download WMS tile from {0}",layerName), null, false);
+    }
 
-	public static WMSLayer getLayer() {
-		// check if we already have a layer created. if not, create; if yes, reuse.
+    public void actionPerformed(ActionEvent e) {
+        DownloadWMSTask.download(getLayer());
+    }
+
+    public static WMSLayer getLayer() {
+        // check if we already have a layer created. if not, create; if yes, reuse.
         if (Main.map != null) {
             Layer activeLayer = Main.map.mapView.getActiveLayer();
@@ -44,5 +44,5 @@
         }
         return null;
-	}
+    }
 };
 
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 15960)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 15961)
@@ -200,5 +200,5 @@
     setStatus(tr("Running Douglas-Peucker approximation..."));
 
-    nodelist = lw.douglasPeucker(nodelist, epsilon);
+    nodelist = lw.douglasPeucker(nodelist, epsilon, 0);
 
     //System.out.println("After Douglas-Peucker approximation "+nodelist.size()+" nodes remain.");
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 15960)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 15961)
@@ -27,4 +27,5 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.io.CacheFiles;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.ProgressInputStream;
 
@@ -124,5 +125,5 @@
     }
 
-    protected BufferedImage grab(URL url) throws IOException {
+    protected BufferedImage grab(URL url) throws IOException, OsmTransferException {
         BufferedImage cached = cache.getImg(url.toString());
         if(cached != null) return cached;
