Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 2396)
@@ -229,7 +229,7 @@
         String lbl = "";
         switch(primitiveType) {
-            case NODE: lbl =  tr("Synchronize node {0} only", id); break;
-            case WAY: lbl =  tr("Synchronize way {0} only", id); break;
-            case RELATION: lbl =  tr("Synchronize relation {0} only", id); break;
+        case NODE: lbl =  tr("Synchronize node {0} only", id); break;
+        case WAY: lbl =  tr("Synchronize way {0} only", id); break;
+        case RELATION: lbl =  tr("Synchronize relation {0} only", id); break;
         }
         ButtonSpec[] spec = new ButtonSpec[] {
@@ -275,7 +275,7 @@
         );
         switch(ret) {
-            case 0: synchronizePrimitive(primitiveType, id); break;
-            case 1: synchronizeDataSet(); break;
-            default: return;
+        case 0: synchronizePrimitive(primitiveType, id); break;
+        case 1: synchronizeDataSet(); break;
+        default: return;
         }
     }
@@ -635,5 +635,5 @@
                     try {
                         getProgressMonitor().subTask(tr("Uploading {0} objects ...", toUpload.size()));
-                        writer.uploadOsm(layer.data.version, toUpload, changeset, getProgressMonitor().createSubTaskMonitor(1, false));
+                        writer.uploadOsm(layer.data.getVersion(), toUpload, changeset, getProgressMonitor().createSubTaskMonitor(1, false));
                         processedPrimitives.addAll(writer.getProcessedPrimitives());
                         // if we get here we've successfully uploaded the data. Exit the loop.
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2396)
@@ -52,14 +52,35 @@
      * The API version that created this data set, if any.
      */
-    public String version;
+    private String version;
+
+    /**
+     * Replies the API version this dataset was created from. May be null.
+     * 
+     * @return the API version this dataset was created from. May be null.
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the API version this dataset was created from.
+     * 
+     * @param version the API version, i.e. "0.5" or "0.6"
+     */
+    public void setVersion(String version) {
+        this.version = version;
+    }
 
     /**
      * All nodes goes here, even when included in other data (ways etc). This enables the instant
      * conversion of the whole DataSet by iterating over this data structure.
-     * @deprecated Use getNodes() for read-only operations, addPrimitive() and removePrimitive() for modifications
-     */
-    @Deprecated
-    public QuadBuckets<Node> nodes = new QuadBuckets<Node>();
-
+     */
+    private QuadBuckets<Node> nodes = new QuadBuckets<Node>();
+
+    /**
+     * Replies an unmodifiable collection of nodes in this dataset
+     * 
+     * @return an unmodifiable collection of nodes in this dataset
+     */
     public Collection<Node> getNodes() {
         return Collections.unmodifiableCollection(nodes);
@@ -74,9 +95,12 @@
      *
      * The way nodes are stored only in the way list.
-     * @deprecated Use getWays() for read-only operations, addPrimitive() and removePrimitive() for modifications
-     */
-    @Deprecated
-    public QuadBuckets<Way> ways = new QuadBuckets<Way>();
-
+     */
+    private QuadBuckets<Way> ways = new QuadBuckets<Way>();
+
+    /**
+     * Replies an unmodifiable collection of ways in this dataset
+     * 
+     * @return an unmodifiable collection of ways in this dataset
+     */
     public Collection<Way> getWays() {
         return Collections.unmodifiableCollection(ways);
@@ -89,9 +113,12 @@
     /**
      * All relations/relationships
-     * @deprecated Use getRelations() for read-only operations, addPrimitive() and removePrimitive() for modifications
-     */
-    @Deprecated
-    public Collection<Relation> relations = new LinkedList<Relation>();
-
+     */
+    private Collection<Relation> relations = new LinkedList<Relation>();
+
+    /**
+     * Replies an unmodifiable collection of relations in this dataset
+     * 
+     * @return an unmodifiable collection of relations in this dataset
+     */
     public Collection<Relation> getRelations() {
         return Collections.unmodifiableCollection(relations);
@@ -703,3 +730,18 @@
         }
     }
+
+    /**
+     * Removes all primitives from the dataset and resets the currently selected primitives
+     * to the empty collection. Also notifies selection change listeners if necessary.
+     * 
+     */
+    public void clear() {
+        if (!selectedPrimitives.isEmpty()) {
+            selectedPrimitives.clear();
+            fireSelectionChanged();
+        }
+        nodes.clear();
+        ways.clear();
+        relations.clear();
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java	(revision 2396)
@@ -10,5 +10,4 @@
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.osm.Changeset;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -121,5 +120,5 @@
                     ProgressMonitor m = monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
                     if (isCancelled()) return;
-                    writer.uploadOsm(layer.data.version, toUpload, changeset, m);
+                    writer.uploadOsm(layer.data.getVersion(), toUpload, changeset, m);
                     processedPrimitives.addAll(writer.getProcessedPrimitives());
                     break;
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 2396)
@@ -256,6 +256,6 @@
         tool += trn("{0} way", "{0} ways", ways, ways);
 
-        if (data.version != null) {
-            tool += ", " + tr("version {0}", data.version);
+        if (data.getVersion() != null) {
+            tool += ", " + tr("version {0}", data.getVersion());
         }
         File f = getAssociatedFile();
@@ -292,9 +292,9 @@
 
         // copy the merged layer's API version, downgrade if required
-        if (data.version == null) {
-            data.version = from.version;
-        } else if ("0.5".equals(data.version) ^ "0.5".equals(from.version)) {
+        if (data.getVersion() == null) {
+            data.setVersion(from.getVersion());
+        } else if ("0.5".equals(data.getVersion()) ^ "0.5".equals(from.getVersion())) {
             System.err.println(tr("Warning: mixing 0.6 and 0.5 data results in version 0.5"));
-            data.version = "0.5";
+            data.setVersion("0.5");
         }
 
@@ -522,5 +522,5 @@
         p.add(new JLabel(wayText, ImageProvider.get("data", "way"), JLabel.HORIZONTAL), GBC.eop().insets(15,0,0,0));
         p.add(new JLabel(relationText, ImageProvider.get("data", "relation"), JLabel.HORIZONTAL), GBC.eop().insets(15,0,0,0));
-        p.add(new JLabel(tr("API version: {0}", (data.version != null) ? data.version : tr("unset"))));
+        p.add(new JLabel(tr("API version: {0}", (data.getVersion() != null) ? data.getVersion() : tr("unset"))));
 
         return p;
Index: trunk/src/org/openstreetmap/josm/io/OsmExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 2396)
@@ -66,5 +66,5 @@
             Writer writer = new OutputStreamWriter(out, "UTF-8");
 
-            OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data.version);
+            OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data.getVersion());
             w.header();
             w.writeDataSources(layer.data);
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2395)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2396)
@@ -184,5 +184,5 @@
                 // save generator attribute for later use when creating DataSource objects
                 generator = atts.getValue("generator");
-                ds.version = v;
+                ds.setVersion(v);
 
             } else if (qName.equals("bounds")) {
@@ -348,5 +348,5 @@
                     throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version));
                 }
-                if (ds.version.equals("0.6")){
+                if (ds.getVersion().equals("0.6")){
                     if (current.version <= 0 && current.id > 0) {
                         throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version));
@@ -355,5 +355,5 @@
                         current.version = 0;
                     }
-                } else if (ds.version.equals("0.5")) {
+                } else if (ds.getVersion().equals("0.5")) {
                     if (current.version <= 0 && current.id > 0) {
                         System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5"));
@@ -365,16 +365,16 @@
                 } else {
                     // should not happen. API version has been checked before
-                    throwException(tr("Unknown or unsupported API version. Got {0}.", ds.version));
+                    throwException(tr("Unknown or unsupported API version. Got {0}.", ds.getVersion()));
                 }
             } else {
                 // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6
                 //
-                if (current.id > 0 && ds.version != null && ds.version.equals("0.6")) {
+                if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.6")) {
                     throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.id)));
-                } else if (current.id > 0 && ds.version != null && ds.version.equals("0.5")) {
+                } else if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
                     // default version in 0.5 files for existing primitives
                     System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5"));
                     current.version= 1;
-                } else if (current.id <= 0 && ds.version != null && ds.version.equals("0.5")) {
+                } else if (current.id <= 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
                     // default version in 0.5 files for new primitives
                     System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 0, "0.5"));
