Index: /applications/editors/josm/plugins/CommandLine/build.xml
===================================================================
--- /applications/editors/josm/plugins/CommandLine/build.xml	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/build.xml	(revision 29505)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Moar bugfixes"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="5737"/>
+    <property name="plugin.main.version" value="5874"/>
 
     <!-- Configure these properties (replace "..." accordingly).
@@ -14,7 +14,4 @@
     <property name="plugin.icon" value="images/commandline.png"/>
     <property name="plugin.link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/CommandLine"/>
-    <!--<property name="plugin.early" value="..."/>-->
-    <!--<property name="plugin.requires" value="..."/>-->
-    <!--<property name="plugin.stage" value="..."/>-->
 
     <!-- ** include targets that all plugins have in common ** -->
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 29505)
@@ -8,24 +8,16 @@
 package CommandLine;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.AWTEvent;
 import java.awt.Cursor;
 import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 29505)
@@ -1,7 +1,7 @@
 /*
  *      Command.java
- *      
+ * 
  *      Copyright 2011 Hind <foxhind@gmail.com>
- *      
+ * 
  */
 
@@ -10,6 +10,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
-import java.util.regex.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -17,198 +17,197 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.DataSet;
 
 public class Command {
-	public String name;						// Command name
-	public String run;						// Executable file with arguments ("nya.exe {arg1} {arg2} ... {argn}")
-	public String icon;						// Icon file name
-	public ArrayList<Parameter> parameters;	// Required parameters list
-	public ArrayList<Parameter> optParameters;	// Optional parameters list
-	public int currentParameterNum;
-	public boolean tracks;
-	
-	public Command () {	parameters = new ArrayList<Parameter>(); optParameters = new ArrayList<Parameter>(); currentParameterNum = 0; tracks = false; icon = ""; }
-
-	public boolean loadObject(Object obj) {
-		Parameter currentParameter = parameters.get(currentParameterNum);
-		//System.out.println("Parameter " + String.valueOf(currentParameterNum) + " (" + currentParameter.name + ")");
-		if (currentParameter.maxInstances == 1) {
-			//System.out.println("mI = 1");
-			//System.out.println("Candidate: " + String.valueOf(obj));
-			if (isPair(obj, currentParameter)) {
-				currentParameter.setValue(obj);
-				//System.out.println("Accepted");
-				return true;
-			}
-		}
-		else {
-			//System.out.println("mI = " + String.valueOf(currentParameter.maxInstances));
-			ArrayList<OsmPrimitive> multiValue = currentParameter.getValueList();
-			if (obj instanceof Collection) {
-				if ( ((Collection)obj).size() > currentParameter.maxInstances && currentParameter.maxInstances != 0)
-					return false;
-				//System.out.println("Candidate (selected) accepted");
-				multiValue.clear();
-				multiValue.addAll((Collection<OsmPrimitive>)obj);
-				return true;
-			}
-			else if (obj instanceof OsmPrimitive) {
-				if (multiValue.size() < currentParameter.maxInstances || currentParameter.maxInstances == 0) {
-					//System.out.println("Candidate: " + String.valueOf(obj));
-					if (isPair(obj, currentParameter)) {
-						multiValue.add((OsmPrimitive)obj);
-						//System.out.println("Accepted, added to list");
-						return true;
-					}
-					else {
-						if (nextParameter() && multiValue.size() > 0) {
-							//System.out.println("Not accepted but considering for next Parameter");
-							return loadObject(obj);
-						}
-					}
-				}
-				else {
-					if (nextParameter()) {
-						//System.out.println("Not accepted but considering for next Parameter");
-						return loadObject(obj);
-					}
-				}
-			}
-			else if (obj instanceof String) {
-				//System.out.println("Candidate: " + (String)obj);
-				if (isPair(obj, currentParameter)) {
-					currentParameter.setValue(obj);
-					//System.out.println("Accepted");
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	public boolean nextParameter() {
-		currentParameterNum++;
-		return (currentParameterNum < parameters.size()) ? true : false;
-	}
-
-	public boolean hasNextParameter() {
-		return ((currentParameterNum + 1) < parameters.size()) ? true : false;
-	}
-
-	public void resetLoading() {
-		currentParameterNum = 0;
-		for (Parameter parameter : parameters) {
-			if (parameter.maxInstances != 1)
-				parameter.getValueList().clear();
-		}
-	}
-
-	private static boolean isPair(Object obj, Parameter parameter) {
-		switch (parameter.type) {
-			case POINT:
-				if (obj instanceof String) {
-					Pattern p = Pattern.compile("(-?\\d*\\.?\\d*,-?\\d*\\.?\\d*;?)*");
-					Matcher m = p.matcher((String)obj);
-					return m.matches();
-				}
-				break;
-			case NODE:
-				if (obj instanceof Node) return true;
-				break;
-			case WAY:
-				if (obj instanceof Way) return true;
-				break;
-			case RELATION:
-				if (obj instanceof Relation) return true;
-				break;
-			case ANY:
-				if (obj instanceof Node || obj instanceof Way || obj instanceof Relation) return true;
-				break;
-			case LENGTH:
-				if (obj instanceof String) {
-					Pattern p = Pattern.compile("\\d*\\.?\\d*");
-					Matcher m = p.matcher((String)obj);
-					if (m.matches()) {
-						Float value = Float.parseFloat((String)obj);
-						if (parameter.minVal != 0 && value < parameter.minVal)
-							break;
-						if (parameter.maxVal != 0 && value > parameter.maxVal)
-							break;
-						return true;
-					}
-				}
-				break;
-			case NATURAL:
-				if (obj instanceof String) {
-					Pattern p = Pattern.compile("\\d*");
-					Matcher m = p.matcher((String)obj);
-					if (m.matches()) {
-						Integer value = Integer.parseInt((String)obj);
-						if (parameter.minVal != 0 && value < parameter.minVal)
-							break;
-						if (parameter.maxVal != 0 && value > parameter.maxVal)
-							break;
-						return true;
-					}
-				}
-				break;
-			case STRING:
-				if (obj instanceof String) return true;
-				break;
-			case RELAY:
-				if (obj instanceof String) {
-					if (parameter.getRawValue() instanceof Relay) {
-						if ( ((Relay)(parameter.getRawValue())).isCorrectValue((String)obj) )
-							return true;
-					}
-				}
-				break;
-			case USERNAME:
-				if (obj instanceof String) return true;
-				break;
-			case IMAGERYURL:
-				if (obj instanceof String) return true;
-				break;
-			case IMAGERYOFFSET:
-				if (obj instanceof String) return true;
-				break;
-		}
-		return false;
-	}
-
-	public Collection<OsmPrimitive> getDepsObjects() {
-		ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
-		for (Parameter parameter : parameters) {
-			if (!parameter.isOsm())
-						continue;
-			if (parameter.maxInstances == 1) {
-				depsObjects.addAll(getDepsObjects(depsObjects, (OsmPrimitive)parameter.getRawValue()));
-			}
-			else {
-				for (OsmPrimitive primitive : parameter.getValueList()) {
-					depsObjects.addAll(getDepsObjects(depsObjects, primitive));
-				}
-			}
-		}
-		return depsObjects;
-	}
-
-	public Collection<OsmPrimitive> getDepsObjects(Collection<OsmPrimitive> currentObjects, OsmPrimitive primitive) {
-		ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
-		if (!currentObjects.contains(primitive)) {
-			if (primitive instanceof Way) {
-				depsObjects.addAll(((Way)primitive).getNodes());
-			}
-			else if (primitive instanceof Relation) {
-				Collection<OsmPrimitive> relationMembers = ((Relation)primitive).getMemberPrimitives();
-				for (OsmPrimitive member : relationMembers) {
-					if (!currentObjects.contains(member)) {
-						depsObjects.add(member);
-						depsObjects.addAll(getDepsObjects(currentObjects, member));
-					}
-				}
-			}
-		}
-		return depsObjects;
-	}
+    public String name;						// Command name
+    public String run;						// Executable file with arguments ("nya.exe {arg1} {arg2} ... {argn}")
+    public String icon;						// Icon file name
+    public ArrayList<Parameter> parameters;	// Required parameters list
+    public ArrayList<Parameter> optParameters;	// Optional parameters list
+    public int currentParameterNum;
+    public boolean tracks;
+
+    public Command () {	parameters = new ArrayList<Parameter>(); optParameters = new ArrayList<Parameter>(); currentParameterNum = 0; tracks = false; icon = ""; }
+
+    public boolean loadObject(Object obj) {
+        Parameter currentParameter = parameters.get(currentParameterNum);
+        //System.out.println("Parameter " + String.valueOf(currentParameterNum) + " (" + currentParameter.name + ")");
+        if (currentParameter.maxInstances == 1) {
+            //System.out.println("mI = 1");
+            //System.out.println("Candidate: " + String.valueOf(obj));
+            if (isPair(obj, currentParameter)) {
+                currentParameter.setValue(obj);
+                //System.out.println("Accepted");
+                return true;
+            }
+        }
+        else {
+            //System.out.println("mI = " + String.valueOf(currentParameter.maxInstances));
+            ArrayList<OsmPrimitive> multiValue = currentParameter.getValueList();
+            if (obj instanceof Collection) {
+                if ( ((Collection<?>)obj).size() > currentParameter.maxInstances && currentParameter.maxInstances != 0)
+                    return false;
+                //System.out.println("Candidate (selected) accepted");
+                multiValue.clear();
+                multiValue.addAll((Collection<OsmPrimitive>)obj);
+                return true;
+            }
+            else if (obj instanceof OsmPrimitive) {
+                if (multiValue.size() < currentParameter.maxInstances || currentParameter.maxInstances == 0) {
+                    //System.out.println("Candidate: " + String.valueOf(obj));
+                    if (isPair(obj, currentParameter)) {
+                        multiValue.add((OsmPrimitive)obj);
+                        //System.out.println("Accepted, added to list");
+                        return true;
+                    }
+                    else {
+                        if (nextParameter() && multiValue.size() > 0) {
+                            //System.out.println("Not accepted but considering for next Parameter");
+                            return loadObject(obj);
+                        }
+                    }
+                }
+                else {
+                    if (nextParameter()) {
+                        //System.out.println("Not accepted but considering for next Parameter");
+                        return loadObject(obj);
+                    }
+                }
+            }
+            else if (obj instanceof String) {
+                //System.out.println("Candidate: " + (String)obj);
+                if (isPair(obj, currentParameter)) {
+                    currentParameter.setValue(obj);
+                    //System.out.println("Accepted");
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public boolean nextParameter() {
+        currentParameterNum++;
+        return (currentParameterNum < parameters.size()) ? true : false;
+    }
+
+    public boolean hasNextParameter() {
+        return ((currentParameterNum + 1) < parameters.size()) ? true : false;
+    }
+
+    public void resetLoading() {
+        currentParameterNum = 0;
+        for (Parameter parameter : parameters) {
+            if (parameter.maxInstances != 1)
+                parameter.getValueList().clear();
+        }
+    }
+
+    private static boolean isPair(Object obj, Parameter parameter) {
+        switch (parameter.type) {
+        case POINT:
+            if (obj instanceof String) {
+                Pattern p = Pattern.compile("(-?\\d*\\.?\\d*,-?\\d*\\.?\\d*;?)*");
+                Matcher m = p.matcher((String)obj);
+                return m.matches();
+            }
+            break;
+        case NODE:
+            if (obj instanceof Node) return true;
+            break;
+        case WAY:
+            if (obj instanceof Way) return true;
+            break;
+        case RELATION:
+            if (obj instanceof Relation) return true;
+            break;
+        case ANY:
+            if (obj instanceof Node || obj instanceof Way || obj instanceof Relation) return true;
+            break;
+        case LENGTH:
+            if (obj instanceof String) {
+                Pattern p = Pattern.compile("\\d*\\.?\\d*");
+                Matcher m = p.matcher((String)obj);
+                if (m.matches()) {
+                    Float value = Float.parseFloat((String)obj);
+                    if (parameter.minVal != 0 && value < parameter.minVal)
+                        break;
+                    if (parameter.maxVal != 0 && value > parameter.maxVal)
+                        break;
+                    return true;
+                }
+            }
+            break;
+        case NATURAL:
+            if (obj instanceof String) {
+                Pattern p = Pattern.compile("\\d*");
+                Matcher m = p.matcher((String)obj);
+                if (m.matches()) {
+                    Integer value = Integer.parseInt((String)obj);
+                    if (parameter.minVal != 0 && value < parameter.minVal)
+                        break;
+                    if (parameter.maxVal != 0 && value > parameter.maxVal)
+                        break;
+                    return true;
+                }
+            }
+            break;
+        case STRING:
+            if (obj instanceof String) return true;
+            break;
+        case RELAY:
+            if (obj instanceof String) {
+                if (parameter.getRawValue() instanceof Relay) {
+                    if ( ((Relay)(parameter.getRawValue())).isCorrectValue((String)obj) )
+                        return true;
+                }
+            }
+            break;
+        case USERNAME:
+            if (obj instanceof String) return true;
+            break;
+        case IMAGERYURL:
+            if (obj instanceof String) return true;
+            break;
+        case IMAGERYOFFSET:
+            if (obj instanceof String) return true;
+            break;
+        }
+        return false;
+    }
+
+    public Collection<OsmPrimitive> getDepsObjects() {
+        ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
+        for (Parameter parameter : parameters) {
+            if (!parameter.isOsm())
+                continue;
+            if (parameter.maxInstances == 1) {
+                depsObjects.addAll(getDepsObjects(depsObjects, (OsmPrimitive)parameter.getRawValue()));
+            }
+            else {
+                for (OsmPrimitive primitive : parameter.getValueList()) {
+                    depsObjects.addAll(getDepsObjects(depsObjects, primitive));
+                }
+            }
+        }
+        return depsObjects;
+    }
+
+    public Collection<OsmPrimitive> getDepsObjects(Collection<OsmPrimitive> currentObjects, OsmPrimitive primitive) {
+        ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
+        if (!currentObjects.contains(primitive)) {
+            if (primitive instanceof Way) {
+                depsObjects.addAll(((Way)primitive).getNodes());
+            }
+            else if (primitive instanceof Relation) {
+                Collection<OsmPrimitive> relationMembers = ((Relation)primitive).getMemberPrimitives();
+                for (OsmPrimitive member : relationMembers) {
+                    if (!currentObjects.contains(member)) {
+                        depsObjects.add(member);
+                        depsObjects.addAll(getDepsObjects(currentObjects, member));
+                    }
+                }
+            }
+        }
+        return depsObjects;
+    }
 }
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java	(revision 29505)
@@ -11,53 +11,38 @@
 
 import java.awt.event.ActionEvent;
-import java.awt.AWTEvent;
-import java.awt.Cursor;
-import java.awt.EventQueue;
-import java.awt.event.AWTEventListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
+
 import javax.swing.Action;
-import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
-import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 public class CommandAction extends JosmAction {
-	private CommandLine parentPlugin;
-	private Command parentCommand;
-	public CommandAction(Command parentCommand, CommandLine parentPlugin) {
-		super(tr(parentCommand.name), "blankmenu", tr(parentCommand.name), null, true, parentCommand.name, true);
-		if (!parentCommand.icon.equals("")) {
-			try {
-				putValue(Action.SMALL_ICON, ImageProvider.get(parentPlugin.pluginDir, parentCommand.icon));
-				putValue(Action.LARGE_ICON_KEY, ImageProvider.get(parentPlugin.pluginDir, parentCommand.icon));
-			}
-			catch (NullPointerException e) {
-				putValue(Action.SMALL_ICON, ImageProvider.get("blankmenu"));
-				putValue(Action.LARGE_ICON_KEY, ImageProvider.get("blankmenu"));
-			}
-			catch (RuntimeException e) {
-				putValue(Action.SMALL_ICON, ImageProvider.get("blankmenu"));
-				putValue(Action.LARGE_ICON_KEY, ImageProvider.get("blankmenu"));
-			}
-		}
+    private final CommandLine parentPlugin;
+    private final Command parentCommand;
+    public CommandAction(Command parentCommand, CommandLine parentPlugin) {
+        super(tr(parentCommand.name), "blankmenu", tr(parentCommand.name), null, true, parentCommand.name, true);
+        if (!parentCommand.icon.equals("")) {
+            try {
+                putValue(Action.SMALL_ICON, ImageProvider.get(CommandLine.pluginDir, parentCommand.icon));
+                putValue(Action.LARGE_ICON_KEY, ImageProvider.get(CommandLine.pluginDir, parentCommand.icon));
+            }
+            catch (NullPointerException e) {
+                putValue(Action.SMALL_ICON, ImageProvider.get("blankmenu"));
+                putValue(Action.LARGE_ICON_KEY, ImageProvider.get("blankmenu"));
+            }
+            catch (RuntimeException e) {
+                putValue(Action.SMALL_ICON, ImageProvider.get("blankmenu"));
+                putValue(Action.LARGE_ICON_KEY, ImageProvider.get("blankmenu"));
+            }
+        }
 
-		this.parentCommand = parentCommand;
-		this.parentPlugin = parentPlugin;
-	}
+        this.parentCommand = parentCommand;
+        this.parentPlugin = parentPlugin;
+    }
 
-	public void actionPerformed(ActionEvent e) {
-		parentPlugin.startCommand(parentCommand);
-		parentPlugin.history.addItem(parentCommand.name);
-	}
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        parentPlugin.startCommand(parentCommand);
+        parentPlugin.history.addItem(parentCommand.name);
+    }
 }
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 29505)
@@ -66,4 +66,5 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
+import org.openstreetmap.josm.tools.Utils;
 
 public class CommandLine extends Plugin {
@@ -541,6 +542,7 @@
                     }
                     gpxWriter.write(gpxFilter.getGpxData());
-                }
-                osmWriter.close();
+                    Utils.close(gpxWriter);
+                }
+                Utils.close(osmWriter);
                 synchronized (syncObj) {
                     tp.running = false;
@@ -548,5 +550,4 @@
                 }
             }
-
         });
 
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java	(revision 29505)
@@ -8,24 +8,10 @@
 package CommandLine;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.AWTEvent;
-import java.awt.Cursor;
-import java.awt.EventQueue;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 29505)
@@ -9,16 +9,13 @@
 
 import java.util.ArrayList;
-import java.util.List;
 import java.util.Collection;
 import java.util.Collections;
 
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.GpxTrack;
 import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
-import org.openstreetmap.josm.data.gpx.ImmutableGpxTrackSegment;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.data.osm.BBox;
 
 public class GpxFilter {
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java	(revision 29505)
@@ -18,5 +18,4 @@
 import java.awt.Graphics2D;
 import java.awt.Point;
-import java.awt.RenderingHints;
 import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
@@ -24,17 +23,11 @@
 import java.awt.event.MouseEvent;
 import java.awt.geom.GeneralPath;
-import java.awt.image.BufferedImage;
-import java.util.Collection;
-import java.util.LinkedList;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.SelectionChangedListener;
-import org.openstreetmap.josm.data.coor.*;
-import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.coor.LatLon;
 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.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
@@ -43,5 +36,4 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.Shortcut;
 
 public class LengthAction extends MapMode implements MapViewPaintable, AWTEventListener {
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 29505)
@@ -8,7 +8,7 @@
 package CommandLine;
 
+import java.io.File;
 import java.util.ArrayList;
-import java.io.File;
-import java.util.List;
+
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java	(revision 29505)
@@ -8,24 +8,17 @@
 package CommandLine;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.AWTEvent;
 import java.awt.Cursor;
 import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 29505)
@@ -1,7 +1,7 @@
 /*
  *	  OsmToCmd.java
- *	  
+ *	
  *	  Copyright 2011 Hind <foxhind@gmail.com>
- *	  
+ *	
  */
 
@@ -15,23 +15,33 @@
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.SAXParser;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.command.AddCommand;
 import org.openstreetmap.josm.command.ChangeCommand;
-import org.openstreetmap.josm.command.ChangeNodesCommand;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.*;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.NodeData;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.PrimitiveData;
+import org.openstreetmap.josm.data.osm.PrimitiveId;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationData;
+import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
+import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.osm.WayData;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmDataParsingException;
 import org.openstreetmap.josm.io.UTFInputStreamReader;
 import org.openstreetmap.josm.tools.DateUtils;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -39,359 +49,365 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
+import org.xml.sax.ext.LexicalHandler;
 import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.ext.LexicalHandler;
 
 final class OsmToCmd {
-	private CommandLine parentPlugin;
-	private final DataSet targetDataSet;
-	private final LinkedList<Command> cmds = new LinkedList<Command>();
-	private HashMap<PrimitiveId, OsmPrimitive> externalIdMap; // Maps external ids to internal primitives
-
-	public OsmToCmd(CommandLine parentPlugin, DataSet targetDataSet) {
-		this.parentPlugin = parentPlugin;
-		this.targetDataSet = targetDataSet;
-		externalIdMap = new HashMap<PrimitiveId, OsmPrimitive>();
-	}
-
-	public void parseStream(InputStream stream) throws IllegalDataException {
-		try {
-			InputSource inputSource = new InputSource(UTFInputStreamReader.create(stream, "UTF-8"));
-			SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-			Parser handler = new Parser();
-			parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
-			parser.parse(inputSource, handler);
-		} catch(ParserConfigurationException e) {
-			throw new IllegalDataException(e.getMessage(), e);
-		} catch (SAXParseException e) {
-			throw new IllegalDataException(tr("Line {0} column {1}: ", e.getLineNumber(), e.getColumnNumber()) + e.getMessage(), e);
-		} catch(SAXException e) {
-			throw new IllegalDataException(e.getMessage(), e);
-		} catch(Exception e) {
-			throw new IllegalDataException(e);
-		}
-	}
-
-	public LinkedList<Command> getCommandList() {
-		return cmds;
-	}
-	
-	private class Parser extends DefaultHandler implements LexicalHandler {
-		private Locator locator;
-		
-		@Override
-		public void setDocumentLocator(Locator locator) {
-			this.locator = locator;
-		}
-
-		protected void throwException(String msg) throws OsmDataParsingException {
-			throw new OsmDataParsingException(msg).rememberLocation(locator);
-		}
-
-		private OsmPrimitive currentPrimitive;
-		private long currentExternalId;
-		private List<Node> currentWayNodes = new ArrayList<Node>();
-		private List<RelationMember> currentRelationMembers = new ArrayList<RelationMember>();
-
-		@Override
-		public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
-			try {
-				if (qName.equals("osm")) {
-					if (atts == null) {
-						throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm"));
-					}
-					String v = atts.getValue("version");
-					if (v == null) {
-						throwException(tr("Missing mandatory attribute ''{0}''.", "version"));
-					}
-					if ( !(v.equals("0.6")) ) {
-						throwException(tr("Unsupported version: {0}", v));
-					}
-
-					// ---- PARSING NODES AND WAYS ----
-
-				} else if (qName.equals("node")) {
-					Node n = new Node();
-					NodeData source = new NodeData();
-					source.setCoor(new LatLon(getDouble(atts, "lat"), getDouble(atts, "lon")));
-					readCommon(atts, source);
-					Node target = (Node)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
-					
-					if (target == null || !(source.isModified() || source.isDeleted()) )
-						n.load(source);
-					else {
-						n.cloneFrom(target);
-						n.load(source);
-					}
-					
-					currentPrimitive = n;
-					externalIdMap.put(source.getPrimitiveId(), (OsmPrimitive)n);
-					//System.out.println("NODE " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(n.getUniqueId()) );
-				}
-				else if (qName.equals("way")) {
-					Way w = new Way();
-					WayData source = new WayData();
-					readCommon(atts, source);
-					Way target = (Way)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
-					
-					if (target == null || !(source.isModified() || source.isDeleted()) )
-						w.load(source);
-					else {
-						w.cloneFrom(target);
-						w.load(source);
-					}
-					
-					currentPrimitive = w;
-					currentWayNodes.clear();
-					externalIdMap.put(source.getPrimitiveId(), (OsmPrimitive)w);
-					//System.out.println("WAY " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(w.getUniqueId()) );
-				}
-				else if (qName.equals("nd")) {
-					if (atts.getValue("ref") == null)
-						throwException(tr("Missing mandatory attribute ''{0}'' on <nd> of way {1}.", "ref", currentPrimitive.getUniqueId()));
-					long id = getLong(atts, "ref");
-					if (id == 0)
-						throwException(tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id) );
-					//System.out.println("NODE " + String.valueOf(id) + " HAS ADDED TO WAY " + String.valueOf(currentPrimitive.getUniqueId()));
-					Node node = (Node)externalIdMap.get(new SimplePrimitiveId(id, OsmPrimitiveType.NODE));
-					if (node == null || node.isModified()) {
-						node = (Node)targetDataSet.getPrimitiveById( new SimplePrimitiveId(id, OsmPrimitiveType.NODE) );
-						if (node == null)
-							throwException(tr("Missing definition of new object with id {0}.", id));
-					}
-					currentWayNodes.add(node);
-				}
-					// ---- PARSING RELATIONS ----
-
-				else if (qName.equals("relation")) {
-					Relation r = new Relation();
-					RelationData source = new RelationData();
-					readCommon(atts, source);
-					Relation target = (Relation)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
-					
-					if (target == null || !(source.isModified() || source.isDeleted()) )
-						r.load(source);
-					else {
-						r.cloneFrom(target);
-						r.load(source);
-					}
-					
-					currentPrimitive = r;
-					currentRelationMembers.clear();
-					externalIdMap.put(source.getPrimitiveId(), (OsmPrimitive)r);
-					//System.out.println("RELATION " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(r.getUniqueId()) );
-				}
-				else if (qName.equals("member")) {
-					if (atts.getValue("ref") == null)
-						throwException(tr("Missing mandatory attribute ''{0}'' on <member> of relation {1}.", "ref", currentPrimitive.getUniqueId()));
-					long id = getLong(atts, "ref");
-					if (id == 0)
-						throwException(tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id) );
-
-					OsmPrimitiveType type = OsmPrimitiveType.NODE;
-					String value = atts.getValue("type");
-					if (value == null) {
-						throwException(tr("Missing attribute ''type'' on member {0} in relation {1}.", Long.toString(id), Long.toString(currentPrimitive.getUniqueId())));
-					}
-					try {
-						type = OsmPrimitiveType.fromApiTypeName(value);
-					}
-					catch(IllegalArgumentException e) {
-						throwException(tr("Illegal value for attribute ''type'' on member {0} in relation {1}. Got {2}.", Long.toString(id), Long.toString(currentPrimitive.getUniqueId()), value));
-					}
-
-					String role = atts.getValue("role");
-
-					//System.out.println("MEMBER " + value.toUpperCase() + " " +String.valueOf(id) + " HAS ADDED TO RELATION " + String.valueOf(currentPrimitive.getUniqueId()));
-					OsmPrimitive member = externalIdMap.get(new SimplePrimitiveId(id, type));
-					if (member == null) {
-						member = targetDataSet.getPrimitiveById(new SimplePrimitiveId(id, type));
-						if (member == null)
-							throwException(tr("Missing definition of new object with id {0}.", id));
-					}
-					RelationMember relationMember = new RelationMember(role, member);
-					currentRelationMembers.add(relationMember);
-				}
-
-					// ---- PARSING TAGS (applicable to all objects) ----
-
-				else if (qName.equals("tag")) {
-					String key = atts.getValue("k");
-					String value = atts.getValue("v");
-					if (key == null || value == null) {
-						throwException(tr("Missing key or value attribute in tag."));
-					}
-					currentPrimitive.put(key.intern(), value.intern());
-				}
-				else {
-					System.out.println(tr("Undefined element ''{0}'' found in input stream. Skipping.", qName));
-				}
-			}
-			catch (Exception e) {
-				throw new SAXParseException(e.getMessage(), locator, e);
-			}
-		}
-
-		@Override
-		public void endElement(String namespaceURI, String localName, String qName) {
-			if (qName.equals("node")) {
-				if (currentPrimitive.isDeleted()) {
-					cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
-				}
-				else if (currentPrimitive.isModified()) {
-					//System.out.println(String.valueOf(currentPrimitive.getUniqueId()) + " IS MODIFIED BY SCRIPT");
-					cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), (Node)targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-				}
-				else if (currentPrimitive.isNew()) {
-					cmds.add(new AddCommand(currentPrimitive));
-				}
-			}
-			else if (qName.equals("way")) {
-				((Way)currentPrimitive).setNodes(currentWayNodes);
-				if (currentPrimitive.isDeleted()) {
-					cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
-				}
-				else if (currentPrimitive.isModified()) {
-					cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), (Way)targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-				}
-				else if (currentPrimitive.isNew()) {
-					cmds.add(new AddCommand(currentPrimitive));
-				}
-			}
-			else if (qName.equals("relation")) {
-				((Relation)currentPrimitive).setMembers(currentRelationMembers);
-				if (currentPrimitive.isDeleted()) {
-					cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
-				}
-				else if (currentPrimitive.isModified()) {
-					cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), (Relation)targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-				}
-				else if (currentPrimitive.isNew()) {
-					cmds.add(new AddCommand(currentPrimitive));
-				}
-			}
-		}
-
-		@Override
-		public void comment(char[] ch, int start, int length) {
-			parentPlugin.printHistory(String.valueOf(ch));
-		}
-		
-		public void startCDATA() {
-		}
-		
-		public void endCDATA() {
-		}
-		
-		public void startEntity(String name) {
-		}
-		
-		public void endEntity(String name) {
-		}
-		
-		public void startDTD(String name, String publicId, String systemId) {
-		}
-		
-		public void endDTD() {
-		}
-		
-		private double getDouble(Attributes atts, String value) {
-			return Double.parseDouble(atts.getValue(value));
-		}
-
-		private long getLong(Attributes atts, String name) throws SAXException {
-			String value = atts.getValue(name);
-			if (value == null) {
-					throwException(tr("Missing required attribute ''{0}''.",name));
-				}
-				try {
-					return Long.parseLong(value);
-				}
-				catch(NumberFormatException e) {
-					throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.",name, value));
-			}
-			return 0; // should not happen
-		}
-
-		private User createUser(String uid, String name) throws SAXException {
-			if (uid == null) {
-				if (name == null)
-					return null;
-				return User.createLocalUser(name);
-			}
-			try {
-				long id = Long.parseLong(uid);
-				return User.createOsmUser(id, name);
-			}
-			catch(NumberFormatException e) {
-				throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''.", uid));
-			}
-			return null;
-		}
-
-		void readCommon(Attributes atts, PrimitiveData current) throws SAXException {
-			current.setId(getLong(atts, "id"));
-			if (current.getUniqueId() == 0) {
-				throwException(tr("Illegal object with ID=0."));
-			}
-
-			String time = atts.getValue("timestamp");
-			if (time != null && time.length() != 0) {
-				current.setTimestamp(DateUtils.fromString(time));
-			}
-
-			String user = atts.getValue("user");
-			String uid = atts.getValue("uid");
-			current.setUser(createUser(uid, user));
-
-			String visible = atts.getValue("visible");
-			if (visible != null) {
-				current.setVisible(Boolean.parseBoolean(visible));
-			}
-
-			String versionString = atts.getValue("version");
-			int version = 0;
-			if (versionString != null) {
-				try {
-					version = Integer.parseInt(versionString);
-				} catch(NumberFormatException e) {
-					throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString));
-				}
-			}
-			current.setVersion(version);
-
-			String action = atts.getValue("action");
-			if (action == null) {
-				// do nothing
-			} else if (action.equals("delete")) {
-				current.setDeleted(true);
-				current.setModified(current.isVisible());
-			} else if (action.equals("modify")) {
-				current.setModified(true);
-			}
-
-			String v = atts.getValue("changeset");
-			if (v == null) {
-				current.setChangesetId(0);
-			} else {
-				try {
-					current.setChangesetId(Integer.parseInt(v));
-				} catch(NumberFormatException e) {
-					if (current.getUniqueId() <= 0) {
-						System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
-						current.setChangesetId(0);
-					} else {
-						throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
-					}
-				}
-				if (current.getChangesetId() <=0) {
-					if (current.getUniqueId() <= 0) {
-						System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
-						current.setChangesetId(0);
-					} else {
-						throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
-					}
-				}
-			}
-		}
-	}
+    private final CommandLine parentPlugin;
+    private final DataSet targetDataSet;
+    private final LinkedList<Command> cmds = new LinkedList<Command>();
+    private final HashMap<PrimitiveId, OsmPrimitive> externalIdMap; // Maps external ids to internal primitives
+
+    public OsmToCmd(CommandLine parentPlugin, DataSet targetDataSet) {
+        this.parentPlugin = parentPlugin;
+        this.targetDataSet = targetDataSet;
+        externalIdMap = new HashMap<PrimitiveId, OsmPrimitive>();
+    }
+
+    public void parseStream(InputStream stream) throws IllegalDataException {
+        try {
+            InputSource inputSource = new InputSource(UTFInputStreamReader.create(stream, "UTF-8"));
+            SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+            Parser handler = new Parser();
+            parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
+            parser.parse(inputSource, handler);
+        } catch(ParserConfigurationException e) {
+            throw new IllegalDataException(e.getMessage(), e);
+        } catch (SAXParseException e) {
+            throw new IllegalDataException(tr("Line {0} column {1}: ", e.getLineNumber(), e.getColumnNumber()) + e.getMessage(), e);
+        } catch(SAXException e) {
+            throw new IllegalDataException(e.getMessage(), e);
+        } catch(Exception e) {
+            throw new IllegalDataException(e);
+        }
+    }
+
+    public LinkedList<Command> getCommandList() {
+        return cmds;
+    }
+
+    private class Parser extends DefaultHandler implements LexicalHandler {
+        private Locator locator;
+
+        @Override
+        public void setDocumentLocator(Locator locator) {
+            this.locator = locator;
+        }
+
+        protected void throwException(String msg) throws OsmDataParsingException {
+            throw new OsmDataParsingException(msg).rememberLocation(locator);
+        }
+
+        private OsmPrimitive currentPrimitive;
+        //private long currentExternalId;
+        private final List<Node> currentWayNodes = new ArrayList<Node>();
+        private final List<RelationMember> currentRelationMembers = new ArrayList<RelationMember>();
+
+        @Override
+        public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+            try {
+                if (qName.equals("osm")) {
+                    if (atts == null) {
+                        throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm"));
+                    }
+                    String v = atts.getValue("version");
+                    if (v == null) {
+                        throwException(tr("Missing mandatory attribute ''{0}''.", "version"));
+                    }
+                    if ( !(v.equals("0.6")) ) {
+                        throwException(tr("Unsupported version: {0}", v));
+                    }
+
+                    // ---- PARSING NODES AND WAYS ----
+
+                } else if (qName.equals("node")) {
+                    Node n = new Node();
+                    NodeData source = new NodeData();
+                    source.setCoor(new LatLon(getDouble(atts, "lat"), getDouble(atts, "lon")));
+                    readCommon(atts, source);
+                    Node target = (Node)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
+
+                    if (target == null || !(source.isModified() || source.isDeleted()) )
+                        n.load(source);
+                    else {
+                        n.cloneFrom(target);
+                        n.load(source);
+                    }
+
+                    currentPrimitive = n;
+                    externalIdMap.put(source.getPrimitiveId(), n);
+                    //System.out.println("NODE " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(n.getUniqueId()) );
+                }
+                else if (qName.equals("way")) {
+                    Way w = new Way();
+                    WayData source = new WayData();
+                    readCommon(atts, source);
+                    Way target = (Way)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
+
+                    if (target == null || !(source.isModified() || source.isDeleted()) )
+                        w.load(source);
+                    else {
+                        w.cloneFrom(target);
+                        w.load(source);
+                    }
+
+                    currentPrimitive = w;
+                    currentWayNodes.clear();
+                    externalIdMap.put(source.getPrimitiveId(), w);
+                    //System.out.println("WAY " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(w.getUniqueId()) );
+                }
+                else if (qName.equals("nd")) {
+                    if (atts.getValue("ref") == null)
+                        throwException(tr("Missing mandatory attribute ''{0}'' on <nd> of way {1}.", "ref", currentPrimitive.getUniqueId()));
+                    long id = getLong(atts, "ref");
+                    if (id == 0)
+                        throwException(tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id) );
+                    //System.out.println("NODE " + String.valueOf(id) + " HAS ADDED TO WAY " + String.valueOf(currentPrimitive.getUniqueId()));
+                    Node node = (Node)externalIdMap.get(new SimplePrimitiveId(id, OsmPrimitiveType.NODE));
+                    if (node == null || node.isModified()) {
+                        node = (Node)targetDataSet.getPrimitiveById( new SimplePrimitiveId(id, OsmPrimitiveType.NODE) );
+                        if (node == null)
+                            throwException(tr("Missing definition of new object with id {0}.", id));
+                    }
+                    currentWayNodes.add(node);
+                }
+                // ---- PARSING RELATIONS ----
+
+                else if (qName.equals("relation")) {
+                    Relation r = new Relation();
+                    RelationData source = new RelationData();
+                    readCommon(atts, source);
+                    Relation target = (Relation)targetDataSet.getPrimitiveById( source.getUniqueId(), source.getType() );
+
+                    if (target == null || !(source.isModified() || source.isDeleted()) )
+                        r.load(source);
+                    else {
+                        r.cloneFrom(target);
+                        r.load(source);
+                    }
+
+                    currentPrimitive = r;
+                    currentRelationMembers.clear();
+                    externalIdMap.put(source.getPrimitiveId(), r);
+                    //System.out.println("RELATION " + String.valueOf(source.getUniqueId()) + " HAS MAPPED TO INNER " + String.valueOf(r.getUniqueId()) );
+                }
+                else if (qName.equals("member")) {
+                    if (atts.getValue("ref") == null)
+                        throwException(tr("Missing mandatory attribute ''{0}'' on <member> of relation {1}.", "ref", currentPrimitive.getUniqueId()));
+                    long id = getLong(atts, "ref");
+                    if (id == 0)
+                        throwException(tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id) );
+
+                    OsmPrimitiveType type = OsmPrimitiveType.NODE;
+                    String value = atts.getValue("type");
+                    if (value == null) {
+                        throwException(tr("Missing attribute ''type'' on member {0} in relation {1}.", Long.toString(id), Long.toString(currentPrimitive.getUniqueId())));
+                    }
+                    try {
+                        type = OsmPrimitiveType.fromApiTypeName(value);
+                    }
+                    catch(IllegalArgumentException e) {
+                        throwException(tr("Illegal value for attribute ''type'' on member {0} in relation {1}. Got {2}.", Long.toString(id), Long.toString(currentPrimitive.getUniqueId()), value));
+                    }
+
+                    String role = atts.getValue("role");
+
+                    //System.out.println("MEMBER " + value.toUpperCase() + " " +String.valueOf(id) + " HAS ADDED TO RELATION " + String.valueOf(currentPrimitive.getUniqueId()));
+                    OsmPrimitive member = externalIdMap.get(new SimplePrimitiveId(id, type));
+                    if (member == null) {
+                        member = targetDataSet.getPrimitiveById(new SimplePrimitiveId(id, type));
+                        if (member == null)
+                            throwException(tr("Missing definition of new object with id {0}.", id));
+                    }
+                    RelationMember relationMember = new RelationMember(role, member);
+                    currentRelationMembers.add(relationMember);
+                }
+
+                // ---- PARSING TAGS (applicable to all objects) ----
+
+                else if (qName.equals("tag")) {
+                    String key = atts.getValue("k");
+                    String value = atts.getValue("v");
+                    if (key == null || value == null) {
+                        throwException(tr("Missing key or value attribute in tag."));
+                    }
+                    currentPrimitive.put(key.intern(), value.intern());
+                }
+                else {
+                    System.out.println(tr("Undefined element ''{0}'' found in input stream. Skipping.", qName));
+                }
+            }
+            catch (Exception e) {
+                throw new SAXParseException(e.getMessage(), locator, e);
+            }
+        }
+
+        @Override
+        public void endElement(String namespaceURI, String localName, String qName) {
+            if (qName.equals("node")) {
+                if (currentPrimitive.isDeleted()) {
+                    cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
+                }
+                else if (currentPrimitive.isModified()) {
+                    //System.out.println(String.valueOf(currentPrimitive.getUniqueId()) + " IS MODIFIED BY SCRIPT");
+                    cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                }
+                else if (currentPrimitive.isNew()) {
+                    cmds.add(new AddCommand(currentPrimitive));
+                }
+            }
+            else if (qName.equals("way")) {
+                ((Way)currentPrimitive).setNodes(currentWayNodes);
+                if (currentPrimitive.isDeleted()) {
+                    cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
+                }
+                else if (currentPrimitive.isModified()) {
+                    cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                }
+                else if (currentPrimitive.isNew()) {
+                    cmds.add(new AddCommand(currentPrimitive));
+                }
+            }
+            else if (qName.equals("relation")) {
+                ((Relation)currentPrimitive).setMembers(currentRelationMembers);
+                if (currentPrimitive.isDeleted()) {
+                    cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
+                }
+                else if (currentPrimitive.isModified()) {
+                    cmds.add(new ChangeCommand(Main.map.mapView.getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                }
+                else if (currentPrimitive.isNew()) {
+                    cmds.add(new AddCommand(currentPrimitive));
+                }
+            }
+        }
+
+        @Override
+        public void comment(char[] ch, int start, int length) {
+            parentPlugin.printHistory(String.valueOf(ch));
+        }
+
+        @Override
+        public void startCDATA() {
+        }
+
+        @Override
+        public void endCDATA() {
+        }
+
+        @Override
+        public void startEntity(String name) {
+        }
+
+        @Override
+        public void endEntity(String name) {
+        }
+
+        @Override
+        public void startDTD(String name, String publicId, String systemId) {
+        }
+
+        @Override
+        public void endDTD() {
+        }
+
+        private double getDouble(Attributes atts, String value) {
+            return Double.parseDouble(atts.getValue(value));
+        }
+
+        private long getLong(Attributes atts, String name) throws SAXException {
+            String value = atts.getValue(name);
+            if (value == null) {
+                throwException(tr("Missing required attribute ''{0}''.",name));
+            }
+            try {
+                return Long.parseLong(value);
+            }
+            catch(NumberFormatException e) {
+                throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.",name, value));
+            }
+            return 0; // should not happen
+        }
+
+        private User createUser(String uid, String name) throws SAXException {
+            if (uid == null) {
+                if (name == null)
+                    return null;
+                return User.createLocalUser(name);
+            }
+            try {
+                long id = Long.parseLong(uid);
+                return User.createOsmUser(id, name);
+            }
+            catch(NumberFormatException e) {
+                throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''.", uid));
+            }
+            return null;
+        }
+
+        void readCommon(Attributes atts, PrimitiveData current) throws SAXException {
+            current.setId(getLong(atts, "id"));
+            if (current.getUniqueId() == 0) {
+                throwException(tr("Illegal object with ID=0."));
+            }
+
+            String time = atts.getValue("timestamp");
+            if (time != null && time.length() != 0) {
+                current.setTimestamp(DateUtils.fromString(time));
+            }
+
+            String user = atts.getValue("user");
+            String uid = atts.getValue("uid");
+            current.setUser(createUser(uid, user));
+
+            String visible = atts.getValue("visible");
+            if (visible != null) {
+                current.setVisible(Boolean.parseBoolean(visible));
+            }
+
+            String versionString = atts.getValue("version");
+            int version = 0;
+            if (versionString != null) {
+                try {
+                    version = Integer.parseInt(versionString);
+                } catch(NumberFormatException e) {
+                    throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString));
+                }
+            }
+            current.setVersion(version);
+
+            String action = atts.getValue("action");
+            if (action == null) {
+                // do nothing
+            } else if (action.equals("delete")) {
+                current.setDeleted(true);
+                current.setModified(current.isVisible());
+            } else if (action.equals("modify")) {
+                current.setModified(true);
+            }
+
+            String v = atts.getValue("changeset");
+            if (v == null) {
+                current.setChangesetId(0);
+            } else {
+                try {
+                    current.setChangesetId(Integer.parseInt(v));
+                } catch(NumberFormatException e) {
+                    if (current.getUniqueId() <= 0) {
+                        System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
+                        current.setChangesetId(0);
+                    } else {
+                        throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
+                    }
+                }
+                if (current.getChangesetId() <=0) {
+                    if (current.getUniqueId() <= 0) {
+                        System.out.println(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
+                        current.setChangesetId(0);
+                    } else {
+                        throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
+                    }
+                }
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 29505)
@@ -13,9 +13,5 @@
 import java.util.Collection;
 
-import org.openstreetmap.josm.data.coor.LatLon;
-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.Relation;
 
 public class Parameter {
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 29505)
@@ -13,11 +13,11 @@
 import java.awt.Cursor;
 import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
 import java.util.ArrayList;
-import java.util.Collection;
+
 import javax.swing.JOptionPane;
 
@@ -25,6 +25,4 @@
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.SelectionChangedListener;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java	(revision 29505)
@@ -8,24 +8,10 @@
 package CommandLine;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.AWTEvent;
-import java.awt.Cursor;
-import java.awt.EventQueue;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: /applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java
===================================================================
--- /applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 29505)
@@ -8,24 +8,17 @@
 package CommandLine;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import java.awt.AWTEvent;
 import java.awt.Cursor;
 import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.util.Collection;
-import javax.swing.JOptionPane;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: /applications/editors/josm/plugins/mirrored_download/.classpath
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/.classpath	(revision 29505)
+++ /applications/editors/josm/plugins/mirrored_download/.classpath	(revision 29505)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /applications/editors/josm/plugins/mirrored_download/.project
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/.project	(revision 29505)
+++ /applications/editors/josm/plugins/mirrored_download/.project	(revision 29505)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JOSM-mirrored_download</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /applications/editors/josm/plugins/mirrored_download/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/.settings/org.eclipse.jdt.core.prefs	(revision 29505)
+++ /applications/editors/josm/plugins/mirrored_download/.settings/org.eclipse.jdt.core.prefs	(revision 29505)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Index: /applications/editors/josm/plugins/mirrored_download/README
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/README	(revision 29504)
+++ /applications/editors/josm/plugins/mirrored_download/README	(revision 29505)
@@ -1,123 +1,0 @@
-
-The JOSM Plugin "Public Transport" is designed to simplify the mapping and editing of public transport routes according to the Oxmoa scheme (see USED NOTIONS). In the first section, we will describe how to create a line from scratch. If there exists already one or more lines running partly or completely parallel, you can take advantage of this (see third section). Also, you can easily convert lines from older mapping formats to the Oxmoa scheme (see fourth section). The last section contains a reference of all items in the plugin.
-
-This manual refers to the prototype version of 2010-01-30. This is not even a beta version, so DON'T FORGET TO SAVE YOUR WORK BEFORE you use this plugin. Later versions may simplify the steps explained below. Feel free to make suggestions for simplications or extra functionality or report bugs to me (mailto:roland.olbricht(at)gmx.de). From the first mature version on, the plugin source code should appear in the OSM SVN and thus the plugin won't any more require any special installation procedures.
-
-
-HOW TO INSTALL
-
-In JOSM: Bearbeiten > Einstellungen, dort Plugins (Stecker) -> Liste laden
-cp public_transport.jar ~/.josm/plugins/
-In JOSM: Bearbeiten > Einstellungen, dort Plugins (Stecker): Public Transport aus der Liste wählen
-JOSM neustarten, Aktualisierung überspringen
-
-
-MAP A BUS LINE FROM SCRATCH
-
-The Oxmoa schema consists of a relation per direction (details see USED NOTIONS) and contains the itinerary (the way a bus actually takes from its starting stop to its terminus) and the stops served by the bus. You need to specify one half of the itinerary, the stops and the back direction can mostly be derived by the software.
-
-Download the area where your bus route takes place. Create a new relation with the standard relation editor and set the tags "type=route", "route=bus" and "ref" set to the line number. Then choose the menue item "Public Transport > Route patterns". Now you can find your route in the list of the main window. Select it and change to the tab "Itinerary". Now select on the map the first way that belongs to your line and press "Add". Mark the second item and press "Add" again. You can select several ways at once and press "Add". If your ways are added in the wrong order or with wrong roles, mark them (click the first entry in the window, then shift-click the last entry in the window) and press "Sort". If there appear one or more lines "[gap]", then your ways don't fit together. If sorting won't solve that, there are gaps in your itinerary and you need to add the missing links or split ways (mark the way, the node where to split at and then use menu "Tools > Split Way") if your bus service only partly uses them. You can delete one or more items from the list by marking them and clicking on "Delete". You can also move one or more items by marking them, clicking on "Mark" (this copies them to the clipboard, like the middle mouse button on X servers), then "Delete", then mark the first item before which you want to insert the items and click "Add".
-
-Now you can add the bus stops in a convienient way: change to the tab "Meta" and press "Suggest Stops". This will compile a list of stops that are near the itinerary. You can choose up to which distance from the itinerary stops should be considered and whether stops only the right hand side, only on the left hand side or on both sides are possible. Now change to the tab "Stops". You can identify stops by marking them and then click "Mark" and/or "Show". Delete spurious stops by marking them and pressing "Delete". Add missing stops by marking them on the map, marking the entry before which you want to insert the stop (unmark all entries if you want to append stops to the end), then press "Add".
-
-
-REUSE A PARTLY PARALLEL LINE
-
-The plugin has an internal clipboard to simplify copying parts of the itinerary or the stops from one bus route to another. Data is put into the clipboard in the X server paradigm. Mark one or more entry from the itinerary list or stops list and click the respective button "Copy". The objects themselves are kept by they state being marked on the map. The plugin additionally saves their order and role. You can paste data from clipboard by using the respective button "Add".
-
-To do this, first choose the source relation at the tab "Overview" and change to the tab "Itinerary". Mark there the entries you want to copy and click "Mark". Then choose at the tab "Overview" your destination relation and mark at the tab "Itinerary" the entry before which you want to paste the entries or unmark all entries if you want to append the data from clipboard.
-
-Stops can be copied in the same way: first choose the source relation at the tab "Overview" and change to the tab "Stops". Mark there the entries you want to copy and click "Mark". Then choose at the tab "Overview" your destination relation and mark at the tab "Stops" the entry before which you want to paste the entries or unmark all entries if you want to append the data from clipboard.
-
-
-REUSE AN OLD RELATION
-
-If you have a bus route in an old format, you can with the help of the plugin spread it into separate relations for both (or more) directions. First, use the standard relation editor of JOSM to duplicate the relation: click on the most lower but one icon on the left toolbar. this opens the relation window on the right. Choose there the relation to duplicate. Click then there on the third button to duplicate the relation, then change "to" and "from" in the opening dialog.
-
-Now open "Public transport > Route patterns ..." and select there the new relation. Change to the tab "Itinerary" and click "Reflect" to reflect the itinerary. If this does not work properly, first click "Sort" to sort the itinerary, then if necessary again "Reflect" to bring them in their proper order.
-
-To edit the bus stops, use one of the functions described above: "Suggest Stops" to have a clean restart from scratch. Or use the buttons in the tab "Stops".
-
-
-USED NOTIONS
-
-Note: I'm not a native English speaker. So if you have suggestions for better wording, please send them to me (mailto:roland.olbricht(at)gmx.de).
-
-...
-http://wiki.openstreetmap.org/wiki/User:Oxomoa/Public_transport_schema#Network_information_.28lines_and_routes.29
-
-
-REFERENCE MANUAL
-
-* Tab "Overview"
-
-- List "Existing route patterns"
-The large list in the center contains all relations that are recognised as bus routes. They are listed with the value of their tag "ref" and the ID of their relation. A relation is considered as bus service if it has the tags "type=route" and "route=bus".
-
-- Button "Refresh"
-This button refreshes the list "Existing route patterns".
-
-
-* Tab "Tags"
-
-The content of this tag is not yet implemented.
-
-
-* Tab "Itinerary"
-
-- List of member ways
-This list contains all the current members of the relation you are editing that are ways. The intended format of a route relation (see Oxmoa scheme at USED NOTIONS above) expects a continuos list of ways that represents the itinerary the bus takes in reality. Whenever two ways don't fit head on tail, a marker "[gap]" is put between them in an extra line to make breaks clearly visible. This is not a member of the relation but just a marker. You can change the role of a way in the right column. To achieve maximum backward compability, you should choose "forward" or "backward". To properly display relations that don't follow the Oxmoa scheme, all other roles including the empty are also displayed and you can choose despite "forward" and "backward" also an empty role.
-
-- Button "Show"
-Ths button changes the view on the map such that all marked entries are visible.
-
-- Button "Mark"
-Ths button marks all entries that are marked in the list as objects on the map and unmarks all other ways. It also copies a list of the marked entries to the plugin's internal clipboard, such that roles and the order can be reconstructed.
-
-- Button "Add"
-This button adds all ways that are currently marked on the map as entries in the list. The entries are added in arbitrary order before the first marked entry. You can order the just added elements by marking them and clicking "Sort".
-
-- Button "Delete"
-This button deletes all currently marked entries.
-
-- Button "Sort"
-If one or more entries are marked, all marked entries are sorted. I.e. their order and role is changed such that they form a continuous itinerary. If this is not possible, the plugin tries to construct long series of continuous sections. If no entries are marked, the entire list are sorted.
-
-- Button "Reflect"
-If one or more entries are marked, their order is reflected and their roles get flipped. I.e. every entry it put after its successor and its role is changed from "backward" to "forward", from "forward" to "backward" or left unchanged if it is empty.
-
-
-* Tab "Stops"
-
-- List of member nodes
-This list contains all the current members of the relation you are editing that are nodes. The intended format of a route relation (see Oxmoa scheme at USED NOTIONS above) expects a list of nodes that represents the stops in the order the bus takes them in reality. The roles can be changed to "forward" or "backward" but due to Oxmoa scheme, they should remain empty.
-
-- Button "Show"
-Ths button changes the view on the map such that all marked entries are visible.
-
-- Button "Mark"
-Ths button marks all entries that are marked in the list as objects on the map and unmarks all other nodes. It also copies a list of the marked entries to the plugin's internal clipboard, such that roles and the order can be reconstructed.
-
-- Button "Add"
-This button adds all ways that are currently marked on the map as entries in the list. The entries are added in arbitrary order before the first marked entry. You can order the just added elements by marking them and clicking "Sort".
-
-- Button "Delete"
-This button deletes all currently marked entries.
-
-- Button "Sort"
-If one or more entries are marked, all marked entries are sorted. The sorting order depends on the itinerary and the settings for the distance limit, the right hand side and the left hand side in the meta "tab": the sorting algorithm attaches each stop to the nearest segment of the itinerary and then orders them in the order they are passed on the itinerary. Then all stops that can't be attached are added to the end of the list.
-
-- Button "Reflect"
-If one or more entries are marked, their order is reflected. I.e. every entry it put after its successor.
-
-
-* Tab "Meta"
-
-- Checkbox "Stops are possible"
-This checkbox controls the behaviour of the button "Suggest stops" and the button "Sort" in the tab "Stops". If you mark only one of the boxes "Right hand side" or "Left hand side", only stops on the respective side are taken into account. If you mark both boxes, stops on both sides are taken into account.
-
-- Text field "Maximum distance from route"
-This textfield also controls the behaviour of the button "Suggest stops" and the button "Sort" in the tab "Stops". Only stops that have a distance less or equal the limit set here are taken into account.
-
-- Button "Suggest stops"
-This button replaces the current list of stops by a list of all stops that are on the itinerary with regard to the setting of the checkboxes and the text field described above.
Index: plications/editors/josm/plugins/mirrored_download/README.template
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/README.template	(revision 29504)
+++ 	(revision )
@@ -1,75 +1,0 @@
-README 
-======
-
-This is a template project structure for a JOSM plugin.
-
-Layout
-======
-+--- src                                source of your plugin
-  |- images                             images your plugin needs
-  |- resources                          resources your plugin needs
-
-  LICENSE                               license file 
-  README                                README for your plugin
-  
-  README.template                       this file 
-  
-  
-Build
-=====  
-A JOSM plugin is built as a single jar. We use ant to build.
-
-See build.xml in this directory and update the plugin specific properties in the
-configuration section.
-  
-
-Maintaining versions
-====================
-There are two versions maintained with each plugin:
-   1) the main version
-      You have to manually set the plugins main version in the build script.
-      Set the property plugin.main.version in build.xml accordingly. 
-
-   2) the build version
-      The build version is unique for every build of the plugin. It is equal
-      to the SVN revision of your plugin directory. 
-
- Both the main version and the build version are included in properties of the plugins
- manifest:
-    Plugin-Version      the build version
-    Plugin-Mainversion  the main version
-
- JOSM automatically detects whether a plugin needs to be upgraded. It compares the build
- version of the currently installed plugin jar with the build version of the plugin jar in 
- the SVN. The main version is irrelevant for this process.  
- 
- Making your plugin available to JOSM users
- ===========================================
- When a plugin jar is checked into SVN a script updates the plugins list on the JOSM wiki:
-   http://josm.openstreetmap.de/wiki/Plugins
- JOSM retrieves the list of available plugins and their build versions from this list.
-
-            commit      publish               read
-                       meta data              meta data 
-      Build  ==>  SVN  =======>  JOSM Wiki   <======= JOSM 
-                   ^ 
-                   ==================================
-                            fetch current plugin jar 
- 
- Note that you have to manually publish (commit) your plugin jar. There is no nightly build
- in place. Everything else (pulishing meta data, updating plugins in the client) is then handled 
- by automatic processes. 
-
-See also
-========
-* Developing Plugins 
-  http://josm.openstreetmap.de/wiki/DevelopingPlugins
-  
-* List of JOSM Plugins
-  http://josm.openstreetmap.de/wiki/Plugins
-  
-  
- 
-     
-
- 
Index: /applications/editors/josm/plugins/mirrored_download/build.xml
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/build.xml	(revision 29504)
+++ /applications/editors/josm/plugins/mirrored_download/build.xml	(revision 29505)
@@ -1,28 +1,3 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-** This is the build file for the mirrored_download plugin
-**
-** Maintaining versions
-** ====================
-** see README.template
-**
-** Usage
-** =====
-** To build it run
-**
-**    > ant  dist
-**
-** To install the generated plugin locally (in your default plugin directory) run
-**
-**    > ant  install
-**
-** To build against the core in ../../core, create a correct manifest and deploy to
-** SVN,
-**    set the properties commit.message and plugin.main.version
-** and run
-**    > ant  publish
-**
-**
--->
 <project name="mirrored_download" default="dist" basedir=".">
 
@@ -30,55 +5,17 @@
     <property name="commit.message" value=""/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="5097"/>
+    <property name="plugin.main.version" value="5874"/>
 
-    <!--
-    **********************************************************
-    ** include targets that all plugins have in common
-    **********************************************************
+    <!-- Configure these properties (replace "..." accordingly).
+         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
     -->
+    <property name="plugin.author" value="Roland M. Olbricht"/>
+    <property name="plugin.class" value="mirrored_download.MirroredDownloadPlugin"/>
+    <property name="plugin.description" value="Simplifies download from different read-only APIs."/>
+    <property name="plugin.icon" value="images/download_mirror.png"/>
+    <property name="plugin.link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/mirrored_download"/>
+
+	<!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
 
-    <!--
-    **********************************************************
-    ** dist - creates the plugin jar
-    **********************************************************
-    -->
-    <target name="dist" depends="compile,revision">
-        <echo message="creating ${ant.project.name}.jar ... "/>
-        <copy todir="${plugin.build.dir}/resources">
-            <fileset dir="resources"/>
-        </copy>
-        <copy todir="${plugin.build.dir}/images">
-            <fileset dir="images"/>
-        </copy>
-        <copy todir="${plugin.build.dir}/data">
-            <fileset dir="data"/>
-        </copy>
-        <copy todir="${plugin.build.dir}">
-            <fileset dir=".">
-                <include name="README"/>
-                <include name="LICENSE"/>
-            </fileset>
-        </copy>
-        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
-            <!--
-            ************************************************
-            ** configure these properties. Most of them will be copied to the plugins
-            ** manifest file. Property values will also show up in the list available
-            ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
-            **
-            ************************************************
-            -->
-            <manifest>
-                <attribute name="Author" value="Roland M. Olbricht"/>
-                <attribute name="Plugin-Class" value="mirrored_download.MirroredDownloadPlugin"/>
-                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
-                <attribute name="Plugin-Description" value="Simplifies download from different read-only APIs."/>
-                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/mirrored_download"/>
-                <attribute name="Plugin-Icon" value="images/download_mirror.png"/>
-                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
-                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
-            </manifest>
-        </jar>
-    </target>
 </project>
Index: /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java	(revision 29505)
@@ -14,4 +14,5 @@
 import java.util.concurrent.Future;
 import java.util.regex.Pattern;
+
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
@@ -19,7 +20,6 @@
 import javax.swing.text.JTextComponent;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
Index: /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionAction.java
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionAction.java	(revision 29504)
+++ /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionAction.java	(revision 29505)
@@ -8,5 +8,4 @@
 
 import org.openstreetmap.josm.actions.JosmAction;
-
 
 /**
Index: /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java
===================================================================
--- /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java	(revision 29504)
+++ /applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java	(revision 29505)
@@ -2,8 +2,6 @@
 package mirrored_download;
 
-import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.Container;
 import java.awt.Frame;
 import java.awt.GridBagConstraints;
@@ -12,62 +10,21 @@
 import java.awt.event.ActionListener;
 import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.text.Format;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Vector;
-import java.util.zip.GZIPInputStream;
 
-import javax.swing.DefaultCellEditor;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
-import javax.swing.JComponent;
 import javax.swing.JDialog;
-import javax.swing.JFileChooser;
 import javax.swing.JLabel;
-import javax.swing.JList;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.KeyStroke;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.command.Command;
-import org.openstreetmap.josm.command.ChangeCommand;
-import org.openstreetmap.josm.command.DeleteCommand;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.gpx.GpxData;
-import org.openstreetmap.josm.data.gpx.GpxTrack;
-import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
-import org.openstreetmap.josm.data.gpx.WayPoint;
-import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
-import org.openstreetmap.josm.io.GpxReader;
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.tools.Utils;
-
-import org.xml.sax.SAXException;
 
 public class UrlSelectionDialog
@@ -160,8 +117,10 @@
         }
       }
+      Utils.close(reader);
     } catch (IOException e) {
       e.printStackTrace();
+    } finally {
+      Utils.close(in);
     }
-    Utils.close(in);
     for (String url : Main.pref.getCollection("plugin.mirrored_download.custom-urls")) {
       urls.add(url);
Index: /applications/editors/josm/plugins/opendata/build.xml
===================================================================
--- /applications/editors/josm/plugins/opendata/build.xml	(revision 29504)
+++ /applications/editors/josm/plugins/opendata/build.xml	(revision 29505)
@@ -1,5 +1,5 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <project name="opendata" default="dist" basedir=".">
-    <property name="plugin.main.version" value="5631"/>
+    <property name="plugin.main.version" value="5874"/>
     <property name="plugin.author" value="Don-vip"/>
     <property name="plugin.class" value="org.openstreetmap.josm.plugins.opendata.OdPlugin"/>
Index: /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java
===================================================================
--- /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java	(revision 29504)
+++ /applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java	(revision 29505)
@@ -60,5 +60,6 @@
 	}
 	
-	protected final BufferedReader getDataReader(File headerFile, String extension, Charset charset) throws FileNotFoundException {
+	@SuppressWarnings("resource")
+    protected final BufferedReader getDataReader(File headerFile, String extension, Charset charset) throws FileNotFoundException {
 		File dataFile = getDataFile(headerFile, extension);
 		return dataFile.exists() ? new BufferedReader(new InputStreamReader(new FileInputStream(dataFile), charset)) : null;
Index: /applications/editors/josm/plugins/piclayer/build.xml
===================================================================
--- /applications/editors/josm/plugins/piclayer/build.xml	(revision 29504)
+++ /applications/editors/josm/plugins/piclayer/build.xml	(revision 29505)
@@ -1,226 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-** This is a template build file for a JOSM  plugin.
-**
-** Maintaining versions
-** ====================
-** see README.template
-**
-** Usage
-** =====
-** To build it run
-**
-**    > ant  dist
-**
-** To install the generated plugin locally (in you default plugin directory) run
-**
-**    > ant  install
-**
-** The generated plugin jar is not automatically available in JOSMs plugin configuration
-** dialog. You have to check it in first.
-**
--->
 <project name="PicLayer" default="dist" basedir=".">
     <property name="commit.message" value="PicLayer - #7127 - added world file loading option"/>
-    <property name="plugin.main.version" value="4980"/>
-    <!--
-      ************************************************
-      ** should not be necessary to change the following properties
-     -->
-    <property name="josm" location="../../core/dist/josm-custom.jar"/>
-    <property name="plugin.build.dir" value="build"/>
-    <property name="plugin.src.dir" value="src"/>
-    <!-- this is the directory where the plugin jar is copied to -->
-    <property name="plugin.dist.dir" value="../../dist"/>
-    <property name="ant.build.javac.target" value="1.5"/>
-    <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
-    <!--
-    **********************************************************
-    ** init - initializes the build
-    **********************************************************
+    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
+    <property name="plugin.main.version" value="5874"/>
+	
+    <!-- Configure these properties (replace "..." accordingly).
+         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
     -->
-    <target name="init">
-        <mkdir dir="${plugin.build.dir}"/>
-    </target>
-    <!--
-    **********************************************************
-    ** compile - complies the source tree
-    **********************************************************
-    -->
-    <target name="compile" depends="init">
-        <echo message="compiling sources for ${ant.project.name} ... "/>
-        <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
-            <compilerarg value="-Xlint:deprecation"/>
-            <compilerarg value="-Xlint:unchecked"/>
-        </javac>
-    </target>
-    <!--
-    **********************************************************
-    ** dist - creates the plugin jar
-    **********************************************************
-    -->
-    <target name="dist" depends="compile,revision">
-        <echo message="creating ${plugin.jar} ... "/>
-        <copy todir="${plugin.build.dir}/resources">
-            <fileset dir="resources"/>
-        </copy>
-        <copy todir="${plugin.build.dir}/images">
-            <fileset dir="images"/>
-        </copy>
-        <copy todir="${plugin.build.dir}/data">
-            <fileset dir="data"/>
-        </copy>
-        <copy todir="${plugin.build.dir}">
-            <fileset dir=".">
-                <include name="README"/>
-                <include name="LICENSE"/>
-            </fileset>
-        </copy>
-        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
-            <manifest>
-                <attribute name="Author" value="Tomasz Stelmach"/>
-                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.piclayer.PicLayerPlugin"/>
-                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
-                <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/>
-                <attribute name="Plugin-Icon" value="images/layericon.png"/>
-                <attribute name="Plugin-Link" value="http://josm.openstreetmap.de/wiki/Help/Plugin/PicLayer"/>
-                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
-                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
-            </manifest>
-        </jar>
-    </target>
-    <!--
-    **********************************************************
-    ** revision - extracts the current revision number for the
-    **    file build.number and stores it in the XML property
-    **    version.*
-    **********************************************************
-    -->
-    <target name="revision">
-        <!-- extract the SVN revision information for file build.number -->
-        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="info"/>
-            <arg value="--xml"/>
-            <arg value="."/>
-        </exec>
-        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
-        <delete file="REVISION"/>
-    </target>
-    <!--
-    **********************************************************
-    ** clean - clean up the build environment
-    **********************************************************
-    -->
-    <target name="clean">
-        <delete dir="${plugin.build.dir}"/>
-        <delete file="${plugin.jar}"/>
-    </target>
-    <!--
-    **********************************************************
-    ** install - install the plugin in your local JOSM installation
-    **********************************************************
-    -->
-    <target name="install" depends="dist">
-        <property environment="env"/>
-        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
-            <and>
-                <os family="windows"/>
-            </and>
-        </condition>
-        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
-    </target>
-    <!--
-         ************************** Publishing the plugin ***********************************
-        -->
-    <!--
-        ** extracts the JOSM release for the JOSM version in ../core and saves it in the
-        ** property ${coreversion.info.entry.revision}
-        **
-        -->
-    <target name="core-info">
-        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="info"/>
-            <arg value="--xml"/>
-            <arg value="../../core"/>
-        </exec>
-        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
-        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
-        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
-        <delete file="core.info.xml"/>
-    </target>
-    <!--
-        ** commits the source tree for this plugin
-        -->
-    <target name="commit-current">
-        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
-        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="commit"/>
-            <arg value="-m '${commit.message}'"/>
-            <arg value="."/>
-        </exec>
-    </target>
-    <!--
-        ** updates (svn up) the source tree for this plugin
-        -->
-    <target name="update-current">
-        <echo>Updating plugin source ...</echo>
-        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="up"/>
-            <arg value="."/>
-        </exec>
-        <echo>Updating ${plugin.jar} ...</echo>
-        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="up"/>
-            <arg value="../dist/${plugin.jar}"/>
-        </exec>
-    </target>
-    <!--
-        ** commits the plugin.jar
-        -->
-    <target name="commit-dist">
-        <echo>
-    ***** Properties of published ${plugin.jar} *****
-    Commit message    : '${commit.message}'
-    Plugin-Mainversion: ${plugin.main.version}
-    JOSM build version: ${coreversion.info.entry.revision}
-    Plugin-Version    : ${version.entry.commit.revision}
-    ***** / Properties of published ${plugin.jar} *****
+    <property name="plugin.author" value="Tomasz Stelmach"/>
+    <property name="plugin.class" value="org.openstreetmap.josm.plugins.piclayer.PicLayerPlugin"/>
+    <property name="plugin.description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/>
+    <property name="plugin.icon" value="images/layericon.png"/>
+    <property name="plugin.link" value="http://josm.openstreetmap.de/wiki/Help/Plugin/PicLayer"/>
 
-    Now commiting ${plugin.jar} ...
-    </echo>
-        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="-m '${commit.message}'"/>
-            <arg value="commit"/>
-            <arg value="${plugin.jar}"/>
-        </exec>
-    </target>
-    <!-- ** make sure svn is present as a command line tool ** -->
-    <target name="ensure-svn-present">
-        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
-            <env key="LANG" value="C"/>
-            <arg value="--version"/>
-        </exec>
-        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
-            <!-- return code not set at all? Most likely svn isn't installed -->
-            <condition>
-                <not>
-                    <isset property="svn.exit.code"/>
-                </not>
-            </condition>
-        </fail>
-        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
-            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
-            <condition>
-                <isfailure code="${svn.exit.code}"/>
-            </condition>
-        </fail>
-    </target>
-    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
-    </target>
+    <!-- ** include targets that all plugins have in common ** -->
+    <import file="../build-common.xml"/>
+
 </project>
