Index: applications/editors/josm/plugins/mapdust/.project
===================================================================
--- applications/editors/josm/plugins/mapdust/.project	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/.project	(revision 33786)
@@ -1,28 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-    <name>JOSM-mapdust</name>
-    <comment></comment>
-    <projects>
-    </projects>
-    <buildSpec>
-        <buildCommand>
-            <name>org.eclipse.jdt.core.javabuilder</name>
-            <arguments>
-            </arguments>
-        </buildCommand>
-        <buildCommand>
-            <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
-            <arguments>
-            </arguments>
-        </buildCommand>
-        <buildCommand>
-            <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
-            <arguments>
-            </arguments>
-        </buildCommand>
-    </buildSpec>
-    <natures>
-        <nature>org.eclipse.jdt.core.javanature</nature>
-        <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
-    </natures>
+	<name>JOSM-mapdust</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+	</natures>
 </projectDescription>
Index: applications/editors/josm/plugins/mapdust/build.xml
===================================================================
--- applications/editors/josm/plugins/mapdust/build.xml	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/build.xml	(revision 33786)
@@ -3,5 +3,5 @@
     <!-- properties -->
     <property name="commit.message" value="MapDust bug reporter plugin"/>
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="12881"/>
     <property name="apidoc.dir" value="doc"/>
 
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 33786)
@@ -42,7 +42,6 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
-import org.openstreetmap.josm.gui.JosmUserIdentityManager;
+import org.openstreetmap.josm.data.UserIdentityManager;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
@@ -66,4 +65,6 @@
 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter;
 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance;
+import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
+import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -131,5 +132,5 @@
         Main.pref.put("mapdust.pluginState", MapdustPluginState.ONLINE.getValue());
         Main.pref.put("mapdust.nickname", "");
-        Main.pref.put("mapdust.showError", true);
+        Main.pref.putBoolean("mapdust.showError", true);
         Main.pref.put("mapdust.version", getPluginInformation().version);
         Main.pref.put("mapdust.localVersion", getPluginInformation().localversion);
@@ -157,12 +158,12 @@
             /* add Listeners */
             NavigatableComponent.addZoomChangeListener(this);
-            Main.getLayerManager().addLayerChangeListener(this);
+            MainApplication.getLayerManager().addLayerChangeListener(this);
             newMapFrame.mapView.addMouseListener(this);
             /* put username to preferences */
-            Main.pref.put("mapdust.josmUserName", JosmUserIdentityManager.getInstance().getUserName());
+            Main.pref.put("mapdust.josmUserName", UserIdentityManager.getInstance().getUserName());
         } else {
             /* if new MapFrame is null, remove listener */
             oldMapFrame.mapView.removeMouseListener(this);
-            Main.getLayerManager().removeLayerChangeListener(this);
+            MainApplication.getLayerManager().removeLayerChangeListener(this);
             NavigatableComponent.removeZoomChangeListener(this);
             mapdustGUI.removeObserver(this);
@@ -186,5 +187,5 @@
                 && mapdustLayer.isVisible()) {
             if (event.getKey().equals("osm-server.username")) {
-                String newUserName = JosmUserIdentityManager.getInstance().getUserName();
+                String newUserName = UserIdentityManager.getInstance().getUserName();
                 String oldUserName = Main.pref.get("mapdust.josmUserName");
                 String nickname = Main.pref.get("mapdust.nickname");
@@ -222,5 +223,5 @@
         }
         if (getMapdustGUI().isDialogShowing()) {
-            if (Main.map != null && Main.map.mapView != null) {
+            if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
                 MapdustBug oldBug = null;
                 for (MapdustBug bug : mapdustBugList) {
@@ -251,5 +252,5 @@
                     mapdustLayer.setBugSelected(null);
                     mapdustGUI.enableBtnPanel(true);
-                    Main.map.mapView.repaint();
+                    MainApplication.getMap().mapView.repaint();
                     String title = "MapDust";
                     String message = "The operation was successful.";
@@ -368,5 +369,5 @@
             if (event.getButton() == MouseEvent.BUTTON1) {
                 if (event.getClickCount() == 2 && !event.isConsumed()) {
-                    if (Main.getLayerManager().getActiveLayer() == getMapdustLayer()) {
+                    if (MainApplication.getLayerManager().getActiveLayer() == getMapdustLayer()) {
                         /* show add bug dialog */
                         MapdustBug bug = mapdustGUI.getSelectedBug();
@@ -394,5 +395,5 @@
                         /* set also in the list of bugs the element */
                         mapdustGUI.setSelectedBug(nearestBug);
-                        Main.map.mapView.repaint();
+                        MainApplication.getMap().mapView.repaint();
                     }
                     return;
@@ -414,5 +415,5 @@
         MapdustBug nearestBug = null;
         for (MapdustBug bug : mapdustBugList) {
-            Point sp = Main.map.mapView.getPoint(bug.getLatLon());
+            Point sp = MainApplication.getMap().mapView.getPoint(bug.getLatLon());
             double dist = p.distanceSq(sp);
             if (minDistanceSq > dist && p.distance(sp) < snapDistance) {
@@ -454,5 +455,5 @@
             NavigatableComponent.removeZoomChangeListener(this);
             if (mapdustGUI != null) {
-                Main.map.remove(mapdustGUI);
+                MainApplication.getMap().remove(mapdustGUI);
                 mapdustGUI.destroy();
             }
@@ -518,5 +519,5 @@
      */
     private BoundingBox getBBox() {
-        MapView mapView = Main.map.mapView;
+        MapView mapView = MainApplication.getMap().mapView;
         Bounds bounds = new Bounds(mapView.getLatLon(0, mapView.getHeight()),
                 mapView.getLatLon(mapView.getWidth(), 0));
@@ -531,5 +532,5 @@
      */
     private void updatePluginData() {
-        Main.worker.execute(new Runnable() {
+        MainApplication.worker.execute(new Runnable() {
             @Override
             public void run() {
@@ -537,5 +538,4 @@
             }
         });
-
     }
 
@@ -546,6 +546,6 @@
      */
     protected synchronized void updateMapdustData() {
-        if (Main.map != null && Main.map.mapView != null) {
-            /* Down-loads the MapDust data */
+        if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
+            /* Downloads the MapDust data */
             try {
                 MapdustServiceHandler handler = new MapdustServiceHandler();
@@ -568,8 +568,6 @@
                 }
             });
-
-        }
-    }
-
+        }
+    }
 
     /**
@@ -578,5 +576,5 @@
      */
     protected void updateView() {
-        if (Main.map != null && Main.map.mapView != null) {
+        if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
             /* update the MapdustLayer */
             boolean needRepaint = false;
@@ -588,7 +586,7 @@
                     mapdustLayer = new MapdustLayer("MapDust", mapdustGUI,
                             mapdustBugList);
-                    Main.getLayerManager().addLayer(this.mapdustLayer);
-                    Main.map.mapView.moveLayer(this.mapdustLayer, 0);
-                    Main.map.mapView.addMouseListener(this);
+                    MainApplication.getLayerManager().addLayer(this.mapdustLayer);
+                    MainApplication.getMap().mapView.moveLayer(this.mapdustLayer, 0);
+                    MainApplication.getMap().mapView.addMouseListener(this);
                     NavigatableComponent.addZoomChangeListener(this);
                     needRepaint = true;
@@ -606,6 +604,6 @@
                 /* force repaint */
                 mapdustGUI.revalidate();
-                Main.map.mapView.revalidate();
-                Main.map.repaint();
+                MainApplication.getMap().mapView.revalidate();
+                MainApplication.getMap().repaint();
             }
         }
@@ -620,5 +618,5 @@
      */
     private boolean containsMapdustLayer() {
-        return mapdustLayer != null && Main.getLayerManager().containsLayer(mapdustLayer);
+        return mapdustLayer != null && MainApplication.getLayerManager().containsLayer(mapdustLayer);
     }
 
@@ -631,5 +629,5 @@
         if (showErrorMessage) {
             /* show errprMessage, and remove the layer */
-            Main.pref.put("mapdust.showError", false);
+            Main.pref.putBoolean("mapdust.showError", false);
             String errorMessage = "There was a Mapdust service error.";
             errorMessage += " Please try later.";
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java	(revision 33786)
@@ -37,4 +37,5 @@
 import javax.swing.JTabbedPane;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
@@ -194,6 +195,6 @@
         }
         revalidate();
-        Main.map.mapView.revalidate();
-        Main.map.repaint();
+        MainApplication.getMap().mapView.revalidate();
+        MainApplication.getMap().repaint();
     }
 
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java	(revision 33786)
@@ -37,4 +37,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CreateBugDialog;
@@ -120,5 +121,5 @@
             LatLon latlon = null;
             if (p != null) {
-                latlon = Main.map.mapView.getLatLon(p.x, p.y);
+                latlon = MainApplication.getMap().mapView.getLatLon(p.x, p.y);
             }
             MapdustBug bug = new MapdustBug(latlon, type, commentText,
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java	(revision 33786)
@@ -72,5 +72,5 @@
             JToggleButton btn = (JToggleButton) event.getSource();
             /* update the bugs */
-            Main.pref.put("mapdust.showError", true);
+            Main.pref.putBoolean("mapdust.showError", true);
             notifyObservers(null, false);
             btn.setSelected(false);
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java	(revision 33786)
@@ -43,4 +43,5 @@
 import javax.swing.event.ListSelectionListener;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
@@ -272,5 +273,5 @@
             }
             /* re-paint */
-            Main.map.mapView.repaint();
+            MainApplication.getMap().mapView.repaint();
             mapdustGUI.repaint();
         } else {
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java	(revision 33786)
@@ -44,4 +44,5 @@
 import org.openstreetmap.josm.plugins.mapdust.util.retry.RetryAgent;
 import org.openstreetmap.josm.plugins.mapdust.util.retry.RetrySetup;
+import org.openstreetmap.josm.tools.Logging;
 
 
@@ -234,5 +235,5 @@
                         postParameters.get(key), "utf-8"));
             } catch (UnsupportedEncodingException e) {
-                Main.error(e);
+                Logging.error(e);
             }
             i++;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java	(revision 33785)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java	(revision 33786)
@@ -29,4 +29,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -130,5 +131,5 @@
                         Thread.sleep(delay);
                     } catch (InterruptedException e1) {
-                        Main.error(e1);
+                        Logging.error(e1);
                         // throw e;
                     }
@@ -140,5 +141,5 @@
                 } catch (Exception e) {
                     /* if it can't be cleaned up, there's nothing to do */
-                    Main.error("Could not clean up", e);
+                    Logging.error("Could not clean up", e);
                 }
             }
@@ -157,6 +158,6 @@
         T result = null;
         boolean success = false;
-        int delay = setup.getBaseDelay();
-        int maxTime = setup.getStopCondition();
+        long delay = setup.getBaseDelay();
+        long maxTime = setup.getStopCondition();
         do {
             long time = System.currentTimeMillis();
@@ -173,5 +174,5 @@
                         Thread.sleep(delay);
                     } catch (InterruptedException e1) {
-                        Main.error(e1);
+                        Logging.error(e1);
                         throw e;
                     }
@@ -183,5 +184,5 @@
                 } catch (Exception e) {
                     /* if it can't be cleaned up, there's nothing to do */
-                    Main.error("Could not clean up", e);
+                    Logging.log(Logging.LEVEL_ERROR, "Could not clean up", e);
                 }
             }
