Index: trunk/src/org/openstreetmap/josm/actions/CopyAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 10448)
@@ -64,5 +64,5 @@
     }
 
-    public static String getCopyString(Collection<? extends OsmPrimitive> primitives) {
+    static String getCopyString(Collection<? extends OsmPrimitive> primitives) {
         StringBuilder idsBuilder = new StringBuilder();
         for (OsmPrimitive p : primitives) {
@@ -82,6 +82,6 @@
     }
 
-    private static boolean isEmptySelection() {
-        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
+    private boolean isEmptySelection() {
+        Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected();
         if (sel.isEmpty()) {
             JOptionPane.showMessageDialog(
Index: trunk/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/CopyCoordinatesAction.java	(revision 10448)
@@ -9,4 +9,5 @@
 import java.util.Collections;
 
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -47,9 +48,10 @@
     }
 
-    private static Collection<Node> getSelectedNodes() {
-        if (getCurrentDataSet() == null || getCurrentDataSet().getSelected() == null) {
+    private Collection<Node> getSelectedNodes() {
+        DataSet ds = getLayerManager().getEditDataSet();
+        if (ds == null || ds.getSelected() == null) {
             return Collections.emptyList();
         } else {
-            return Utils.filteredCollection(getCurrentDataSet().getSelected(), Node.class);
+            return Utils.filteredCollection(ds.getSelected(), Node.class);
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 10448)
@@ -176,6 +176,7 @@
     }
 
-    private static Relation getSelectedMultipolygonRelation() {
-        return getSelectedMultipolygonRelation(getCurrentDataSet().getSelectedWays(), getCurrentDataSet().getSelectedRelations());
+    private Relation getSelectedMultipolygonRelation() {
+        DataSet ds = getLayerManager().getEditDataSet();
+        return getSelectedMultipolygonRelation(ds.getSelectedWays(), ds.getSelectedRelations());
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 10448)
@@ -272,5 +272,5 @@
         if (cmd != null) {
             Main.main.undoRedo.add(cmd);
-            getCurrentDataSet().setSelected(target);
+            layer.data.setSelected(target);
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java	(revision 10448)
@@ -89,5 +89,5 @@
      * @return true if the user wants to cancel, false if they want to continue
      */
-    public static final boolean warnMergingUploadDiscouragedObjects(Layer targetLayer) {
+    public final boolean warnMergingUploadDiscouragedObjects(Layer targetLayer) {
         return GuiHelper.warnUser(tr("Merging too many objects with different upload policies"),
                 "<html>" +
@@ -96,5 +96,5 @@
                         "You should instead check and merge each object, <b>one by one</b>.<br /><br />"+
                         "Are you sure you want to continue?",
-                        getEditLayer().getName(), targetLayer.getName(), targetLayer.getName())+
+                        getLayerManager().getEditLayer().getName(), targetLayer.getName(), targetLayer.getName())+
                 "</html>",
                 ImageProvider.get("dialogs", "mergedown"), tr("Ignore this hint and merge anyway"));
Index: trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java	(revision 10448)
@@ -38,5 +38,5 @@
      */
     public static Collection<OsmPrimitive> getSurroundingObjects(EastNorth internalPoint) {
-        final DataSet ds = JosmAction.getCurrentDataSet();
+        final DataSet ds = Main.getLayerManager().getEditDataSet();
         if (ds == null) {
             return Collections.emptySet();
@@ -87,5 +87,5 @@
     public static void performSelection(EastNorth internalPoint, boolean doAdd, boolean doRemove) {
         final Collection<OsmPrimitive> surroundingObjects = getSurroundingObjects(internalPoint);
-        final DataSet ds = JosmAction.getCurrentDataSet();
+        final DataSet ds = Main.getLayerManager().getEditDataSet();
         if (surroundingObjects.isEmpty()) {
             return;
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 10448)
@@ -196,6 +196,5 @@
         final List<List<Node>> wayChunks = buildSplitChunks(selectedWay, selectedNodes);
         if (wayChunks != null) {
-            List<Relation> selectedRelations =
-                    OsmPrimitive.getFilteredList(selection, Relation.class);
+            List<Relation> selectedRelations = OsmPrimitive.getFilteredList(selection, Relation.class);
             final List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size() + selectedRelations.size());
             sel.addAll(selectedWays);
@@ -308,8 +307,8 @@
             toggleSaveState(); // necessary since #showDialog() does not handle it due to the non-modal dialog
             if (getValue() == 1) {
-                final Way wayToKeep = list.getSelectedValue();
-                final SplitWayResult result = doSplitWay(getEditLayer(), selectedWay, wayToKeep, newWays, selection);
+                SplitWayResult result = doSplitWay(Main.getLayerManager().getEditLayer(),
+                        selectedWay, list.getSelectedValue(), newWays, selection);
                 Main.main.undoRedo.add(result.getCommand());
-                getCurrentDataSet().setSelected(result.getNewSelection());
+                Main.getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
             }
         }
Index: trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 10448)
@@ -560,9 +560,9 @@
      * @param newNodes New created nodes by this set of command
      */
-    private static void execCommands(List<Command> cmds, List<Node> newNodes) {
+    private void execCommands(List<Command> cmds, List<Node> newNodes) {
         Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
                 trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1L, newNodes.size() + 1L), cmds));
         // select one of the new nodes
-        getCurrentDataSet().setSelected(newNodes.get(0));
+        getLayerManager().getEditDataSet().setSelected(newNodes.get(0));
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java	(revision 10448)
@@ -41,5 +41,5 @@
     public static void handlePrimitiveGoneException(long id, OsmPrimitiveType type) {
         MultiFetchServerObjectReader reader = MultiFetchServerObjectReader.create();
-        reader.append(getCurrentDataSet(), id, type);
+        reader.append(Main.getLayerManager().getEditDataSet(), id, type);
         try {
             DataSet ds = reader.parseOsm(NullProgressMonitor.INSTANCE);
@@ -58,6 +58,5 @@
      */
     public static void updatePrimitives(final Collection<OsmPrimitive> selection) {
-        UpdatePrimitivesTask task = new UpdatePrimitivesTask(Main.getLayerManager().getEditLayer(), selection);
-        Main.worker.submit(task);
+        Main.worker.submit(new UpdatePrimitivesTask(Main.getLayerManager().getEditLayer(), selection));
     }
 
@@ -73,7 +72,7 @@
     public static void updatePrimitive(PrimitiveId id) {
         ensureParameterNotNull(id, "id");
-        if (getEditLayer() == null)
+        if (Main.getLayerManager().getEditLayer() == null)
             throw new IllegalStateException(tr("No current dataset found"));
-        OsmPrimitive primitive = getEditLayer().data.getPrimitiveById(id);
+        OsmPrimitive primitive = Main.getLayerManager().getEditLayer().data.getPrimitiveById(id);
         if (primitive == null)
             throw new IllegalStateException(tr("Did not find an object with id {0} in the current dataset", id));
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 10448)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.MainLayerManager;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.HighlightHelper;
@@ -138,14 +139,15 @@
         boolean alt = (e.getModifiers() & (ActionEvent.ALT_MASK | InputEvent.ALT_GRAPH_MASK)) != 0;
 
+        MainLayerManager lm = Main.getLayerManager();
         Command c;
         if (ctrl) {
-            c = DeleteCommand.deleteWithReferences(getEditLayer(), getCurrentDataSet().getSelected());
+            c = DeleteCommand.deleteWithReferences(lm.getEditLayer(), lm.getEditDataSet().getSelected());
         } else {
-            c = DeleteCommand.delete(getEditLayer(), getCurrentDataSet().getSelected(), !alt /* also delete nodes in way */);
+            c = DeleteCommand.delete(lm.getEditLayer(), lm.getEditDataSet().getSelected(), !alt /* also delete nodes in way */);
         }
         // if c is null, an error occurred or the user aborted. Don't do anything in that case.
         if (c != null) {
             Main.main.undoRedo.add(c);
-            getCurrentDataSet().setSelected();
+            lm.getEditDataSet().setSelected();
             Main.map.repaint();
         }
@@ -170,7 +172,7 @@
      * removes any highlighting that may have been set beforehand.
      */
-    private static void removeHighlighting() {
+    private void removeHighlighting() {
         highlightHelper.clear();
-        DataSet ds = getCurrentDataSet();
+        DataSet ds = getLayerManager().getEditDataSet();
         if (ds != null) {
             ds.clearHighlightedWaySegments();
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 10448)
@@ -870,7 +870,8 @@
     }
 
-    private static boolean movesHiddenWay() {
-        final Collection<OsmPrimitive> elementsToTest = new HashSet<>(getCurrentDataSet().getSelected());
-        for (Way osm : Utils.filteredCollection(getCurrentDataSet().getSelected(), Way.class)) {
+    private boolean movesHiddenWay() {
+        DataSet ds = getLayerManager().getEditDataSet();
+        final Collection<OsmPrimitive> elementsToTest = new HashSet<>(ds.getSelected());
+        for (Way osm : Utils.filteredCollection(ds.getSelected(), Way.class)) {
             elementsToTest.addAll(osm.getNodes());
         }
Index: trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 10446)
+++ trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 10448)
@@ -14,5 +14,4 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -73,5 +72,5 @@
             }
         }
-        OsmDataLayer editLayer = JosmAction.getEditLayer();
+        OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
         if (editLayer != null) {
             editLayer.validationErrors.clear();
