Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java	(revision 32453)
@@ -22,4 +22,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.IconToggleButton;
@@ -147,5 +148,5 @@
                 reasoner.update(street);
 
-            org.openstreetmap.josm.data.osm.DataSet dataSet = Main.main.getCurrentDataSet();
+            DataSet dataSet = Main.getLayerManager().getEditDataSet();
             if (dataSet != null) {
                 for (OsmPrimitive prim : dataSet.allPrimitives()) {
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java	(revision 32453)
@@ -22,5 +22,5 @@
      */
     public static void zoomToMany(Collection<OsmPrimitive> primitives) {
-        Main.main.getCurrentDataSet().setSelected(primitives);
+        Main.getLayerManager().getEditDataSet().setSelected(primitives);
         (new AutoScaleAction("selection")).actionPerformed(null);
     }
@@ -30,5 +30,5 @@
      */
     public static void zoomTo(OsmPrimitive primitive) {
-        Main.main.getCurrentDataSet().setSelected(primitive);
+        Main.getLayerManager().getEditDataSet().setSelected(primitive);
         (new AutoScaleAction("selection")).actionPerformed(null);
     }
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/FactoryAction.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/FactoryAction.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/FactoryAction.java	(revision 32453)
@@ -107,6 +107,6 @@
         FactoryDialog.getInstance().selectionListenerActivated = false;
         FactoryDialog.getInstance().selectNextUnmatchedHouseByCheckBox();
-        Main.main.getCurrentDataSet().addPrimitive(newNode);
-        Main.main.getCurrentDataSet().setSelected(newNode);
+        Main.getLayerManager().getEditDataSet().addPrimitive(newNode);
+        Main.getLayerManager().getEditDataSet().setSelected(newNode);
         FactoryDialog.getInstance().selectionListenerActivated = true;
     }
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/PointManipulatorAction.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/PointManipulatorAction.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/PointManipulatorAction.java	(revision 32453)
@@ -43,5 +43,5 @@
      */
     public void actionPerformed(ActionEvent e) {
-        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.main.getCurrentDataSet();
+        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet();
         if (dataSet == null) return;
         Collection<OsmPrimitive> data = dataSet.getSelected();
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java	(revision 32453)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -53,12 +54,12 @@
      */
     public void actionPerformed(ActionEvent e) {
-
-        Collection<Way> selectedWays = Main.main.getCurrentDataSet().getSelectedWays();
-        Collection<Way> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays());
+        DataSet ds = Main.getLayerManager().getEditDataSet();
+        Collection<Way> selectedWays = ds.getSelectedWays();
+        Collection<Way> newSelection = new LinkedList<>(ds.getSelectedWays());
 
         for (Way area : selectedWays) {
             if (! area.isClosed()) continue;
 
-            for (OsmPrimitive prim2 : Main.main.getCurrentDataSet().allNonDeletedPrimitives()) {
+            for (OsmPrimitive prim2 : ds.allNonDeletedPrimitives()) {
                 if (!(prim2 instanceof Way)) continue;
                 if (prim2.equals(area))      continue;
@@ -82,6 +83,6 @@
 
                 if (errorCode == 0) {
-                    Main.main.getCurrentDataSet().addPrimitive(newArea1);
-                    Main.main.getCurrentDataSet().addPrimitive(newArea2);
+                    ds.addPrimitive(newArea1);
+                    ds.addPrimitive(newArea2);
 
                     area.setDeleted(true);
@@ -98,5 +99,5 @@
         }
 
-        Main.main.getCurrentDataSet().setSelected(newSelection);
+        ds.setSelected(newSelection);
     }
 
@@ -113,5 +114,5 @@
     private int splitArea(Way area, Way border, Way newArea1, Way newArea2) {
 
-        for (Relation r : Main.main.getCurrentDataSet().getRelations())
+        for (Relation r : Main.getLayerManager().getEditDataSet().getRelations())
             for (RelationMember rm : r.getMembers())
                 if (rm.refersTo(area) || rm.refersTo(border))
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 32453)
@@ -87,5 +87,5 @@
 
         BoundingXYVisitor visitor = new BoundingXYVisitor();
-        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.main.getCurrentDataSet();
+        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet();
         if (dataSet == null) return;
 
@@ -110,5 +110,5 @@
             System.out.println("AUTO: Center is " + center);
 
-        for (OsmPrimitive op : Main.main.getCurrentDataSet().allPrimitives()) {
+        for (OsmPrimitive op : Main.getLayerManager().getEditDataSet().allPrimitives()) {
 
             if (!(op instanceof Node)) {
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java	(revision 32453)
@@ -47,5 +47,5 @@
         dbEditButton.setIcon(ImageProvider.get("actions", "edit.png"));
 
-        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.main.getCurrentDataSet();
+        org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet();
         if (dataSet != null) {
             Capitalizator cap = new Capitalizator(dataSet.allPrimitives(),
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java	(revision 32453)
@@ -104,6 +104,6 @@
             proposalContainer.applyAll();
 
-            Main.main.getCurrentDataSet().setSelected((Node) null); // TODO: This is an ugly hack.
-            Main.main.getCurrentDataSet().setSelected(proposalContainer.getTarget());
+            Main.getLayerManager().getEditDataSet().setSelected((Node) null); // TODO: This is an ugly hack.
+            Main.getLayerManager().getEditDataSet().setSelected(proposalContainer.getTarget());
 
             AddressElement elem = (AddressElement) matchesComboBox.getSelectedItem();
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalListRenderer.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalListRenderer.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalListRenderer.java	(revision 32453)
@@ -13,5 +13,5 @@
 
     @Override
-    public Component getListCellRendererComponent(JList list, Object value,
+    public Component getListCellRendererComponent(JList<?> list, Object value,
                           int index, boolean isSelected, boolean cellHasFocus) {
 
Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java	(revision 31665)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java	(revision 32453)
@@ -66,5 +66,5 @@
            way.remove(key);
 
-        Main.main.getCurrentDataSet().addPrimitive(addrNode);
+        Main.getLayerManager().getEditDataSet().addPrimitive(addrNode);
     }
 
@@ -78,6 +78,3 @@
         return "Vytvořit z budovy samostatný adresní uzel.";
     }
-
-
-
 }
