Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 5897)
@@ -753,5 +753,5 @@
                 Collection<Layer> layers = new ArrayList<Layer>(Main.map.mapView.getAllLayers());
                 for (Layer l: layers) {
-                    Main.map.mapView.removeLayer(l);
+                    Main.main.removeLayer(l);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java	(revision 5897)
@@ -47,5 +47,5 @@
                         }
                         targetLayer.mergeFrom(sourceLayer);
-                        Main.map.mapView.removeLayer(sourceLayer);
+                        Main.main.removeLayer(sourceLayer);
                         layerMerged = true;
                     }
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 5897)
@@ -309,5 +309,5 @@
         if (Main.map.mapView.getLayersOfType(OsmDataLayer.class).isEmpty()) {
             if (errorLayer != null) {
-                Main.map.mapView.removeLayer(errorLayer);
+                Main.main.removeLayer(errorLayer);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 5897)
@@ -91,5 +91,5 @@
      * The view control displayed.
      */
-    public MapView mapView;
+    public final MapView mapView;
     /**
      * The toolbar with the action icons. To add new toggle dialog actions, use addToggleDialog
@@ -155,5 +155,4 @@
         setSize(400,400);
         setLayout(new BorderLayout());
-
 
         mapView = new MapView(contentPane, viewportData);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 5897)
@@ -57,5 +57,4 @@
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.help.HelpUtil;
-import org.openstreetmap.josm.gui.io.SaveLayersDialog;
 import org.openstreetmap.josm.gui.layer.JumpToMarkerActions;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -63,4 +62,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -71,5 +71,4 @@
 import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
@@ -92,5 +91,4 @@
             throw new IllegalStateException("Dialog was already created");
         instance = new LayerListDialog(mapFrame);
-
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 5896)
+++ trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 5897)
@@ -157,5 +157,5 @@
     public void layerRemoved(Layer oldLayer) {
         if (oldLayer instanceof OsmDataLayer &&  Main.map.mapView.getEditLayer() == null) {
-            Main.map.mapView.removeLayer(this);
+            Main.main.removeLayer(this);
         } else if (oldLayer == this) {
             MapView.removeLayerChangeListener(this);
