Index: trunk/src/org/openstreetmap/josm/actions/CopyAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 1523)
@@ -8,8 +8,8 @@
 import java.awt.event.KeyEvent;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
-import java.util.LinkedList;
-import java.util.Collection;
 
 import javax.swing.JOptionPane;
@@ -19,10 +19,10 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.DataSource;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -65,5 +65,5 @@
         /* scan the selected objects, mapping them to copies; when copying a way or relation,
          * the copy references the copies of their child objects */
-        new Visitor(){
+        new AbstractVisitor() {
             public void visit(Node n) {
                 /* check if already in pasteBuffer - e.g. two ways are selected which share a node;
Index: trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java	(revision 1523)
@@ -12,9 +12,9 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
 import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -31,5 +31,5 @@
     public void actionPerformed(ActionEvent e) {
         final Collection<Object> sel = new LinkedList<Object>();
-        new Visitor() {
+        new AbstractVisitor() {
             public void visit(Node n) {
                 if(n.id <= 0) return;
Index: trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java	(revision 1523)
@@ -19,9 +19,9 @@
 import org.openstreetmap.josm.corrector.UserCancelException;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -35,5 +35,5 @@
     public void actionPerformed(ActionEvent e) {
         final Collection<Way> sel = new LinkedList<Way>();
-        new Visitor() {
+        new AbstractVisitor() {
             public void visit(Node n) {
             }
Index: trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1523)
@@ -6,8 +6,9 @@
 import java.awt.event.ActionEvent;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.PrintWriter;
 
 import javax.swing.JFileChooser;
@@ -18,9 +19,9 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.layer.GpxLayer;
+import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.GpxLayer;
+import org.openstreetmap.josm.io.GpxWriter;
 import org.openstreetmap.josm.io.OsmWriter;
-import org.openstreetmap.josm.io.GpxWriter;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -159,5 +160,10 @@
                     copy(file, tmpFile);
                 }
-                OsmWriter.output(new FileOutputStream(file), new OsmWriter.All(layer.data, false));
+                OsmWriter w = new OsmWriter(new PrintWriter(new FileOutputStream(file)), false, layer.data.version);
+                w.header();
+                w.writeDataSources(layer.data);
+                w.writeContent(layer.data);
+                w.footer();
+                // FIXME - how to close?
                 if (!Main.pref.getBoolean("save.keepbackup") && (tmpFile != null))
                     tmpFile.delete();
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 1523)
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
@@ -74,5 +75,5 @@
         selectedNodes = null;
 
-        Visitor splitVisitor = new Visitor(){
+        Visitor splitVisitor = new AbstractVisitor() {
             public void visit(Node n) {
                 if (selectedNodes == null)
Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1520)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1523)
@@ -154,5 +154,5 @@
         PleaseWaitRunnable uploadTask = new PleaseWaitRunnable(tr("Uploading data")){
             @Override protected void realRun() throws SAXException {
-                server.uploadOsm(all);
+                server.uploadOsm(Main.ds.version, all);
             }
             @Override protected void finish() {
@@ -160,5 +160,5 @@
             }
             @Override protected void cancel() {
-                server.cancel();
+                // FIXME server.cancel();
             }
         };
