Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 30669)
@@ -1,7 +1,7 @@
 /*
  *      AnyAction.java
- *      
+ *
  *      Copyright 2010 Hind <foxhind@gmail.com>
- *      
+ *
  */
 
@@ -24,5 +24,5 @@
 
 public class AnyAction extends MapMode implements AWTEventListener {
-	private CommandLine parentPlugin;
+    private final CommandLine parentPlugin;
     final private Cursor cursorNormal, cursorActive;
     private Cursor currentCursor;
@@ -31,15 +31,15 @@
     private boolean isCtrlDown;
 
-	public AnyAction(MapFrame mapFrame, CommandLine parentPlugin) {
-		super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", "selection"));
-		this.parentPlugin = parentPlugin;
-	cursorNormal = ImageProvider.getCursor("normal", "selection");
-	cursorActive = ImageProvider.getCursor("normal", "joinnode");
+    public AnyAction(MapFrame mapFrame, CommandLine parentPlugin) {
+        super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", "selection"));
+        this.parentPlugin = parentPlugin;
+        cursorNormal = ImageProvider.getCursor("normal", "selection");
+        cursorActive = ImageProvider.getCursor("normal", "joinnode");
         currentCursor = cursorNormal;
         nearestPrimitive = null;
-	}
+    }
 
-	@Override public void enterMode() {
-		super.enterMode();
+    @Override public void enterMode() {
+        super.enterMode();
         currentCursor = cursorNormal;
         Main.map.mapView.addMouseListener(this);
@@ -49,9 +49,9 @@
         } catch (SecurityException ex) {
         }
-	}
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
         Main.map.mapView.removeMouseMotionListener(this);
         try {
@@ -59,5 +59,5 @@
         } catch (SecurityException ex) {
         }
-	}
+    }
 
     @Override
@@ -77,38 +77,38 @@
         processMouseEvent(e);
         if (nearestPrimitive != null) {
-			if (isCtrlDown) {
-				Main.main.getCurrentDataSet().clearSelection(nearestPrimitive);
-				Main.map.mapView.repaint();
-			}
-			else {
-				int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
-				switch (maxInstances) {
-				case 0:
-					Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
-					Main.map.mapView.repaint();
-					break;
-				case 1:
-					Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
-					Main.map.mapView.repaint();
-					parentPlugin.loadParameter(nearestPrimitive, true);
-					exitMode();
-					break;
-				default:
-					if (Main.main.getCurrentDataSet().getSelected().size() < maxInstances) {
-						Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
-						Main.map.mapView.repaint();
-					}
-					else
-						System.out.println("Maximum instances!");
-				}
-			}
-		}
+            if (isCtrlDown) {
+                Main.main.getCurrentDataSet().clearSelection(nearestPrimitive);
+                Main.map.mapView.repaint();
+            }
+            else {
+                int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
+                switch (maxInstances) {
+                case 0:
+                    Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
+                    Main.map.mapView.repaint();
+                    break;
+                case 1:
+                    Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
+                    Main.map.mapView.repaint();
+                    parentPlugin.loadParameter(nearestPrimitive, true);
+                    exitMode();
+                    break;
+                default:
+                    if (Main.main.getCurrentDataSet().getSelected().size() < maxInstances) {
+                        Main.main.getCurrentDataSet().addSelected(nearestPrimitive);
+                        Main.map.mapView.repaint();
+                    }
+                    else
+                        Main.info("Maximum instances!");
+                }
+            }
+        }
         super.mousePressed(e);
     }
 
-        @Override
-	public void eventDispatched(AWTEvent arg0) {
+    @Override
+    public void eventDispatched(AWTEvent arg0) {
         if (!(arg0 instanceof KeyEvent))
-                return;
+            return;
         KeyEvent ev = (KeyEvent) arg0;
         isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
@@ -121,19 +121,19 @@
     private void updCursor() {
         if (mousePos != null) {
-			if (!Main.isDisplayingMapView())
-				return;
-			nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive.isUsablePredicate, false);
-			if (nearestPrimitive != null) {
-				setCursor(cursorActive);
-			}
-			else {
-				setCursor(cursorNormal);
-			}
-		}
+            if (!Main.isDisplayingMapView())
+                return;
+            nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive.isUsablePredicate, false);
+            if (nearestPrimitive != null) {
+                setCursor(cursorActive);
+            }
+            else {
+                setCursor(cursorNormal);
+            }
+        }
     }
 
-	private void processMouseEvent(MouseEvent e) {
-		if (e != null) { mousePos = e.getPoint(); }
-	}
+    private void processMouseEvent(MouseEvent e) {
+        if (e != null) { mousePos = e.getPoint(); }
+    }
 
     private void setCursor(final Cursor c) {
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 30669)
@@ -1,7 +1,7 @@
 /*
  *      Command.java
- * 
+ *
  *      Copyright 2011 Hind <foxhind@gmail.com>
- * 
+ *
  */
 
@@ -33,21 +33,15 @@
     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);
@@ -56,13 +50,10 @@
             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);
                         }
@@ -71,5 +62,4 @@
                 else {
                     if (nextParameter()) {
-                        //System.out.println("Not accepted but considering for next Parameter");
                         return loadObject(obj);
                     }
@@ -77,8 +67,6 @@
             }
             else if (obj instanceof String) {
-                //System.out.println("Candidate: " + (String)obj);
                 if (isPair(obj, currentParameter)) {
                     currentParameter.setValue(obj);
-                    //System.out.println("Accepted");
                     return true;
                 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30669)
@@ -223,6 +223,5 @@
 
     @Override
-    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame)
-    {
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
         currentMapFrame = newFrame;
         if (oldFrame == null && newFrame != null) {
@@ -411,5 +410,5 @@
         }
         else {
-            System.out.println("Invalid argument");
+            Main.info("Invalid argument");
             endInput();
         }
@@ -429,5 +428,4 @@
             currentCommand.resetLoading();
         }
-        //System.out.println("Selected before " + String.valueOf(currentCommand.currentParameterNum) + "\n");
     }
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 30669)
@@ -1,7 +1,7 @@
 /*
  *      GpxFilter.java
- *      
+ *
  *      Copyright 2011 Hind <foxhind@gmail.com>
- *      
+ *
  */
 
@@ -20,47 +20,44 @@
 
 public class GpxFilter {
-	private BBox bbox;
-	private GpxData data;
+    private BBox bbox;
+    private final GpxData data;
 
-	public GpxFilter() {
-		bbox = new BBox(0.0, 0.0, 0.0, 0.0);
-		data = new GpxData();
-	}
+    public GpxFilter() {
+        bbox = new BBox(0.0, 0.0, 0.0, 0.0);
+        data = new GpxData();
+    }
 
-	public void initBboxFilter(BBox bbox) {
-		this.bbox = bbox;
-	}
+    public void initBboxFilter(BBox bbox) {
+        this.bbox = bbox;
+    }
 
-	public void addGpxData(GpxData data) {
-		Collection<Collection<WayPoint>> currentTrack;
-		Collection<WayPoint> currentSegment;
-		for (GpxTrack track : data.tracks) {
-			//System.out.println("New track");
-			currentTrack = new ArrayList<Collection<WayPoint>>();
-			for (GpxTrackSegment segment : track.getSegments()) {
-				//System.out.println("New segment");
-				currentSegment = new ArrayList<WayPoint>();
-				for (WayPoint wp : segment.getWayPoints()) {
-					//System.out.println("Point " + String.valueOf(wp.getCoor().getX()) + ", " + String.valueOf(wp.getCoor().getY()) + " situaded in bbox? " + String.valueOf(bbox.bounds(wp.getCoor())) );
-					if ( bbox.bounds(wp.getCoor()) ) {
-						currentSegment.add(wp);
-					} else {
-						if (currentSegment.size() > 1) {
-							currentTrack.add(currentSegment);
-							currentSegment = new ArrayList<WayPoint>();
-						}
-					}
-				}
-				if (currentSegment.size() > 1) {
-					currentTrack.add(currentSegment);
-					currentSegment = new ArrayList<WayPoint>();
-				}
-			}
-			this.data.tracks.add( new ImmutableGpxTrack( currentTrack, Collections.<String, Object>emptyMap()) );
-		}
-	}
+    public void addGpxData(GpxData data) {
+        Collection<Collection<WayPoint>> currentTrack;
+        Collection<WayPoint> currentSegment;
+        for (GpxTrack track : data.tracks) {
+            currentTrack = new ArrayList<Collection<WayPoint>>();
+            for (GpxTrackSegment segment : track.getSegments()) {
+                currentSegment = new ArrayList<WayPoint>();
+                for (WayPoint wp : segment.getWayPoints()) {
+                    if ( bbox.bounds(wp.getCoor()) ) {
+                        currentSegment.add(wp);
+                    } else {
+                        if (currentSegment.size() > 1) {
+                            currentTrack.add(currentSegment);
+                            currentSegment = new ArrayList<WayPoint>();
+                        }
+                    }
+                }
+                if (currentSegment.size() > 1) {
+                    currentTrack.add(currentSegment);
+                    currentSegment = new ArrayList<WayPoint>();
+                }
+            }
+            this.data.tracks.add( new ImmutableGpxTrack( currentTrack, Collections.<String, Object>emptyMap()) );
+        }
+    }
 
-	public GpxData getGpxData() {
-		return data;
-	}
+    public GpxData getGpxData() {
+        return data;
+    }
 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 30669)
@@ -1,9 +1,9 @@
 /*
  *	  Loader.java
- *	  
+ *
  *	  Copyright 2011 Hind <foxhind@gmail.com>
- *	  
+ *
  */
- 
+
 package CommandLine;
 
@@ -14,4 +14,5 @@
 import javax.xml.parsers.SAXParserFactory;
 
+import org.openstreetmap.josm.Main;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -20,166 +21,167 @@
 
 public class Loader extends DefaultHandler {
-	private String dirToScan;
-	private String currentFile; // For debug XML-files
-	private String currentTag;
-	private Command currentCommand;
-	private Parameter currentParameter;
-	private ArrayList<Command> loadingCommands;
+    private final String dirToScan;
+    private String currentFile; // For debug XML-files
+    private String currentTag;
+    private Command currentCommand;
+    private Parameter currentParameter;
+    private final ArrayList<Command> loadingCommands;
 
-	public Loader (String dir) {
-		dirToScan = dir;
-		currentTag = "";
-		loadingCommands = new ArrayList<Command>();
-	}
+    public Loader (String dir) {
+        dirToScan = dir;
+        currentTag = "";
+        loadingCommands = new ArrayList<Command>();
+    }
 
-	public ArrayList<Command> load() {
-		try {
-			// Creating parser
-			SAXParserFactory spf = SAXParserFactory.newInstance();
-			SAXParser sp = spf.newSAXParser();
-			
-			// Files loading
-			File path = new File(dirToScan + "/");
-			String[] list;
-			list = path.list();
-			for(int i = 0; i < list.length; i++)
-				if (list[i].endsWith(".xml")) {
-					currentFile = dirToScan + "/" + list[i];
-					loadFile(sp, currentFile);
-				}
-		}
-		catch (Exception e) {
-			System.err.println(e);
-		}
-		return loadingCommands;
-	}
+    public ArrayList<Command> load() {
+        try {
+            // Creating parser
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            SAXParser sp = spf.newSAXParser();
 
-	private void loadFile(SAXParser parser, String fileName) {
-		try {
-			String a = new File(fileName).toURI().toString().replace("file:/", "file:///");
-			System.out.println(a);
-			parser.parse(a, this);
-		}
-		catch (Exception e) {
-			System.err.println(e);
-		}
-		// TODO: Create links for each argument
-	}
+            // Files loading
+            File path = new File(dirToScan + "/");
+            String[] list;
+            list = path.list();
+            for(int i = 0; i < list.length; i++)
+                if (list[i].endsWith(".xml")) {
+                    currentFile = dirToScan + "/" + list[i];
+                    loadFile(sp, currentFile);
+                }
+        }
+        catch (Exception e) {
+            System.err.println(e);
+        }
+        return loadingCommands;
+    }
 
-        @Override
-	public void startElement(String namespaceURI, String localName, String rawName, Attributes attrs) {
-		int len = attrs.getLength();
-		String Name, Value;
-		currentTag = rawName;
+    private void loadFile(SAXParser parser, String fileName) {
+        try {
+            String a = new File(fileName).toURI().toString().replace("file:/", "file:///");
+            Main.info(a);
+            parser.parse(a, this);
+        }
+        catch (Exception e) {
+            Main.error(e);
+        }
+        // TODO: Create links for each argument
+    }
 
-		if (rawName.equals("command")) {
-			currentCommand = new Command();
-			for (int i = 0; i < len; i++) {
-				Name = attrs.getQName(i);
-				Value = attrs.getValue(i);
-				if (Name.equals("name"))
-					currentCommand.name = Value;
-				else if (Name.equals("run"))
-					currentCommand.run = Value;
-				else if (Name.equals("tracks")) {
-					if (Value.equals("bbox"))
-						currentCommand.tracks = true;
-				} else if (Name.equals("icon")) {
-					currentCommand.icon = Value;
-				} else if (Name.equals("asynchronous")) {
-					currentCommand.asynchronous = Value.equals("true") ? true : false;
-				}
-			}
-		}
-		else if (rawName.equals("parameter")) {
-			currentParameter = new Parameter();
-			for (int i = 0; i < len; i++) {
-				Name = attrs.getQName(i);
-				Value = attrs.getValue(i);
-				if (Name.equals("required")) {
-					currentParameter.required = Value.equals("true") ? true : false;
-				}
-				else if (Name.equals("type")) {
-					if (Value.equals("node")) currentParameter.type = Type.NODE;
-					else if (Value.equals("way")) currentParameter.type = Type.WAY;
-					else if (Value.equals("relation")) currentParameter.type = Type.RELATION;
-					else if (Value.equals("point")) currentParameter.type = Type.POINT;
-					else if (Value.equals("length")) currentParameter.type = Type.LENGTH;
-					else if (Value.equals("natural")) currentParameter.type = Type.NATURAL;
-					else if (Value.equals("any")) currentParameter.type = Type.ANY;
-					else if (Value.equals("string")) currentParameter.type = Type.STRING;
-					else if (Value.equals("relay")) currentParameter.type = Type.RELAY;
-					else if (Value.equals("username")) currentParameter.type = Type.USERNAME;
-					else if (Value.equals("imageryurl")) currentParameter.type = Type.IMAGERYURL;
-					else if (Value.equals("imageryoffset")) currentParameter.type = Type.IMAGERYOFFSET;
-				}
-				else if (Name.equals("maxinstances")) {
-					currentParameter.maxInstances = Integer.parseInt(Value);
-				}
-				else if (Name.equals("maxvalue")) {
-					currentParameter.maxVal = Float.parseFloat(Value);
-				}
-				else if (Name.equals("minvalue")) {
-					currentParameter.minVal = Float.parseFloat(Value);
-				}
-			}
-		}
-	}
+    @Override
+    public void startElement(String namespaceURI, String localName, String rawName, Attributes attrs) {
+        int len = attrs.getLength();
+        String Name, Value;
+        currentTag = rawName;
 
-	@Override
-	public void characters(char ch[], int start, int length) 
-	{
-		String text = (new String(ch, start, length)).trim();
-		if (currentParameter != null) {
-			if (currentTag.equals("name")) {
-				currentParameter.name = text;
-			}
-			else if (currentTag.equals("description")) {
-				currentParameter.description = text;
-			}
-			else if (currentTag.equals("value")) {
-				if (currentParameter.type == Type.RELAY) {
-					if (!(currentParameter.getRawValue() instanceof Relay))
-						currentParameter.setValue(new Relay());
-					((Relay)(currentParameter.getRawValue())).addValue(text);
-				}
-				else {
-					currentParameter.setValue(text);
-				}
-			}
-		}
-	}
+        if (rawName.equals("command")) {
+            currentCommand = new Command();
+            for (int i = 0; i < len; i++) {
+                Name = attrs.getQName(i);
+                Value = attrs.getValue(i);
+                if (Name.equals("name"))
+                    currentCommand.name = Value;
+                else if (Name.equals("run"))
+                    currentCommand.run = Value;
+                else if (Name.equals("tracks")) {
+                    if (Value.equals("bbox"))
+                        currentCommand.tracks = true;
+                } else if (Name.equals("icon")) {
+                    currentCommand.icon = Value;
+                } else if (Name.equals("asynchronous")) {
+                    currentCommand.asynchronous = Value.equals("true") ? true : false;
+                }
+            }
+        }
+        else if (rawName.equals("parameter")) {
+            currentParameter = new Parameter();
+            for (int i = 0; i < len; i++) {
+                Name = attrs.getQName(i);
+                Value = attrs.getValue(i);
+                if (Name.equals("required")) {
+                    currentParameter.required = Value.equals("true") ? true : false;
+                }
+                else if (Name.equals("type")) {
+                    if (Value.equals("node")) currentParameter.type = Type.NODE;
+                    else if (Value.equals("way")) currentParameter.type = Type.WAY;
+                    else if (Value.equals("relation")) currentParameter.type = Type.RELATION;
+                    else if (Value.equals("point")) currentParameter.type = Type.POINT;
+                    else if (Value.equals("length")) currentParameter.type = Type.LENGTH;
+                    else if (Value.equals("natural")) currentParameter.type = Type.NATURAL;
+                    else if (Value.equals("any")) currentParameter.type = Type.ANY;
+                    else if (Value.equals("string")) currentParameter.type = Type.STRING;
+                    else if (Value.equals("relay")) currentParameter.type = Type.RELAY;
+                    else if (Value.equals("username")) currentParameter.type = Type.USERNAME;
+                    else if (Value.equals("imageryurl")) currentParameter.type = Type.IMAGERYURL;
+                    else if (Value.equals("imageryoffset")) currentParameter.type = Type.IMAGERYOFFSET;
+                }
+                else if (Name.equals("maxinstances")) {
+                    currentParameter.maxInstances = Integer.parseInt(Value);
+                }
+                else if (Name.equals("maxvalue")) {
+                    currentParameter.maxVal = Float.parseFloat(Value);
+                }
+                else if (Name.equals("minvalue")) {
+                    currentParameter.minVal = Float.parseFloat(Value);
+                }
+            }
+        }
+    }
 
-	public void endElement(String namespaceURI, String localName, String rawName) {
-		if (rawName.equals("command")) {
-			loadingCommands.add(currentCommand);
-			currentCommand = null;
-		}
-		else if (rawName.equals("parameter")) {
-			if(currentParameter.required)
-				currentCommand.parameters.add(currentParameter);
-			else
-				currentCommand.optParameters.add(currentParameter);
-			currentParameter = null;
-		}
-		else {
-			currentTag = "";
-		}
-	}
+    @Override
+    public void characters(char ch[], int start, int length)
+    {
+        String text = (new String(ch, start, length)).trim();
+        if (currentParameter != null) {
+            if (currentTag.equals("name")) {
+                currentParameter.name = text;
+            }
+            else if (currentTag.equals("description")) {
+                currentParameter.description = text;
+            }
+            else if (currentTag.equals("value")) {
+                if (currentParameter.type == Type.RELAY) {
+                    if (!(currentParameter.getRawValue() instanceof Relay))
+                        currentParameter.setValue(new Relay());
+                    ((Relay)(currentParameter.getRawValue())).addValue(text);
+                }
+                else {
+                    currentParameter.setValue(text);
+                }
+            }
+        }
+    }
 
-	@Override
-	public void warning(SAXParseException ex) {
-		System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage());
-	}
+    @Override
+    public void endElement(String namespaceURI, String localName, String rawName) {
+        if (rawName.equals("command")) {
+            loadingCommands.add(currentCommand);
+            currentCommand = null;
+        }
+        else if (rawName.equals("parameter")) {
+            if(currentParameter.required)
+                currentCommand.parameters.add(currentParameter);
+            else
+                currentCommand.optParameters.add(currentParameter);
+            currentParameter = null;
+        }
+        else {
+            currentTag = "";
+        }
+    }
 
-	@Override
-	public void error(SAXParseException ex) {
-		System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
-	}
+    @Override
+    public void warning(SAXParseException ex) {
+        System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage());
+    }
 
-	@Override
-	public void fatalError(SAXParseException ex) throws SAXException {
-		System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
-		throw ex;
-	}
+    @Override
+    public void error(SAXParseException ex) {
+        System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
+    }
+
+    @Override
+    public void fatalError(SAXParseException ex) throws SAXException {
+        System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
+        throw ex;
+    }
 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 30669)
@@ -135,5 +135,4 @@
                     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")) {
@@ -153,5 +152,4 @@
                     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")) {
@@ -161,5 +159,4 @@
                     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()) {
@@ -188,5 +185,4 @@
                     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")) {
@@ -211,5 +207,4 @@
                     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) {
@@ -233,5 +228,5 @@
                 }
                 else {
-                    System.out.println(tr("Undefined element ''{0}'' found in input stream. Skipping.", qName));
+                    Main.warn(tr("Undefined element ''{0}'' found in input stream. Skipping.", qName));
                 }
             }
@@ -248,5 +243,4 @@
                 }
                 else if (currentPrimitive.isModified()) {
-                    //System.out.println(String.valueOf(currentPrimitive.getUniqueId()) + " IS MODIFIED BY SCRIPT");
                     cmds.add(new ChangeCommand(Main.main.getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
                 }
@@ -393,5 +387,5 @@
                 } 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()));
+                        Main.warn(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
                         current.setChangesetId(0);
                     } else {
@@ -401,5 +395,5 @@
                 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()));
+                        Main.warn(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
                         current.setChangesetId(0);
                     } else {
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 30669)
@@ -1,7 +1,7 @@
 /*
  *	  PointAction.java
- *	  
+ *
  *	  Copyright 2011 Hind <foxhind@gmail.com>
- *	  
+ *
  */
 
@@ -31,172 +31,172 @@
 
 public class PointAction extends MapMode implements AWTEventListener {
-	private CommandLine parentPlugin;
-	final private Cursor cursorCrosshair;
-	final private Cursor cursorJoinNode;
-	private Cursor currentCursor;
-	private Point mousePos;
-	private Node nearestNode;
-	private ArrayList<String> pointList;
-	private boolean isCtrlDown;
-
-	public PointAction(MapFrame mapFrame, CommandLine parentPlugin) {
-		super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("crosshair", null));
-		this.parentPlugin = parentPlugin;
-		cursorCrosshair = ImageProvider.getCursor("crosshair", null);
-		cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode");
-		currentCursor = cursorCrosshair;
-		nearestNode = null;
-		pointList = new ArrayList<String>();
-	}
-
-	@Override public void enterMode() {
-		super.enterMode();
-		if (getCurrentDataSet() == null) {
-			Main.map.selectSelectTool(false);
-			return;
-		}
-		currentCursor = cursorCrosshair;
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-		try {
-			Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
-		} catch (SecurityException ex) {
-		}
-	}
-
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
-		Main.map.mapView.removeMouseMotionListener(this);
-		try {
-			Toolkit.getDefaultToolkit().removeAWTEventListener(this);
-		} catch (SecurityException ex) {
-		}
-	}
-
-	@Override public void mousePressed(MouseEvent e) {
-		if (e.getButton() == MouseEvent.BUTTON1) {
-			if (isCtrlDown) {
-				if (pointList.size() > 0) {
-					pointList.remove(pointList.size() - 1);
-					updateTextEdit();
-				}
-			}
-			else {
-				LatLon coor;
-				if (nearestNode == null)
-					coor = Main.map.mapView.getLatLon(e.getX(), e.getY());
-				else
-					coor = nearestNode.getCoor();
-				if (coor.isOutSideWorld()) {
-					JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
-					return;
-				}
-				String point = String.valueOf(coor.getX()) + "," + String.valueOf(coor.getY());
-				int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
-				if (maxInstances == 1) {
-					parentPlugin.loadParameter(point, true);
-					exitMode();
-				}
-				else {
-					if (pointList.size() < maxInstances || maxInstances == 0) {
-						pointList.add(point);
-						updateTextEdit();
-					}
-					else
-						System.out.println("Maximum instances!");
-				}
-			}
-		}
-	}
-
-	@Override
-	public void mouseMoved(MouseEvent e) {
-		if (!Main.map.mapView.isActiveLayerDrawable())
-			return;
-		processMouseEvent(e);
-		updCursor();
-		Main.map.mapView.repaint();
-	}
-
-        @Override
-	public void eventDispatched(AWTEvent arg0) {
-		if (!(arg0 instanceof KeyEvent))
-			return;
-		KeyEvent ev = (KeyEvent) arg0;
-		isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
-		if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
-			ev.consume();
-			cancelDrawing();
-		}
-	}
-
-	private void updCursor() {
-		if (mousePos != null) {
-			if (!Main.isDisplayingMapView())
-				return;
-			nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isUsablePredicate);
-			if (nearestNode != null) {
-				setCursor(cursorJoinNode);
-			}
-			else {
-				setCursor(cursorCrosshair);
-			}
-		}
-	}
-
-	private void processMouseEvent(MouseEvent e) {
-		if (e != null) {
-			mousePos = e.getPoint();
-		}
-	}
-
-	private void setCursor(final Cursor c) {
-		if (currentCursor.equals(c))
-			return;
-		try {
-			// We invoke this to prevent strange things from happening
-			EventQueue.invokeLater(new Runnable() {
-                                @Override
-				public void run() {
-					// Don't change cursor when mode has changed already
-					if (!(Main.map.mapMode instanceof PointAction))
-						return;
-					Main.map.mapView.setCursor(c);
-				}
-			});
-			currentCursor = c;
-		} catch (Exception e) {
-		}
-	}
-
-	public void cancelDrawing() {
-		if (Main.map == null || Main.map.mapView == null)
-			return;
-		Main.map.statusLine.setHeading(-1);
-		Main.map.statusLine.setAngle(-1);
-		Main.map.mapView.repaint();
-		updateStatusLine();
-		parentPlugin.abortInput();
-	}
-
-	public String currentValue() {
-		String out = "";
-		boolean first = true;
-		for (String point : pointList) {
-			if (!first)
-				out += ";";
-			out += point;
-			first = false;
-		}
-		return out;
-	}
-	
-	private void updateTextEdit() {
-		Parameter currentParameter = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum);
-		String prefix = tr(currentParameter.description);
-		prefix += parentPlugin.commandSymbol;
-		String value = currentValue();
-		parentPlugin.textField.setText(prefix + value);
-	}
+    private final CommandLine parentPlugin;
+    final private Cursor cursorCrosshair;
+    final private Cursor cursorJoinNode;
+    private Cursor currentCursor;
+    private Point mousePos;
+    private Node nearestNode;
+    private final ArrayList<String> pointList;
+    private boolean isCtrlDown;
+
+    public PointAction(MapFrame mapFrame, CommandLine parentPlugin) {
+        super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("crosshair", null));
+        this.parentPlugin = parentPlugin;
+        cursorCrosshair = ImageProvider.getCursor("crosshair", null);
+        cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode");
+        currentCursor = cursorCrosshair;
+        nearestNode = null;
+        pointList = new ArrayList<String>();
+    }
+
+    @Override public void enterMode() {
+        super.enterMode();
+        if (getCurrentDataSet() == null) {
+            Main.map.selectSelectTool(false);
+            return;
+        }
+        currentCursor = cursorCrosshair;
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+        try {
+            Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
+        } catch (SecurityException ex) {
+        }
+    }
+
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+        try {
+            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
+        } catch (SecurityException ex) {
+        }
+    }
+
+    @Override public void mousePressed(MouseEvent e) {
+        if (e.getButton() == MouseEvent.BUTTON1) {
+            if (isCtrlDown) {
+                if (pointList.size() > 0) {
+                    pointList.remove(pointList.size() - 1);
+                    updateTextEdit();
+                }
+            }
+            else {
+                LatLon coor;
+                if (nearestNode == null)
+                    coor = Main.map.mapView.getLatLon(e.getX(), e.getY());
+                else
+                    coor = nearestNode.getCoor();
+                if (coor.isOutSideWorld()) {
+                    JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
+                    return;
+                }
+                String point = String.valueOf(coor.getX()) + "," + String.valueOf(coor.getY());
+                int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
+                if (maxInstances == 1) {
+                    parentPlugin.loadParameter(point, true);
+                    exitMode();
+                }
+                else {
+                    if (pointList.size() < maxInstances || maxInstances == 0) {
+                        pointList.add(point);
+                        updateTextEdit();
+                    }
+                    else
+                        Main.info("Maximum instances!");
+                }
+            }
+        }
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) {
+        if (!Main.map.mapView.isActiveLayerDrawable())
+            return;
+        processMouseEvent(e);
+        updCursor();
+        Main.map.mapView.repaint();
+    }
+
+    @Override
+    public void eventDispatched(AWTEvent arg0) {
+        if (!(arg0 instanceof KeyEvent))
+            return;
+        KeyEvent ev = (KeyEvent) arg0;
+        isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
+        if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
+            ev.consume();
+            cancelDrawing();
+        }
+    }
+
+    private void updCursor() {
+        if (mousePos != null) {
+            if (!Main.isDisplayingMapView())
+                return;
+            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isUsablePredicate);
+            if (nearestNode != null) {
+                setCursor(cursorJoinNode);
+            }
+            else {
+                setCursor(cursorCrosshair);
+            }
+        }
+    }
+
+    private void processMouseEvent(MouseEvent e) {
+        if (e != null) {
+            mousePos = e.getPoint();
+        }
+    }
+
+    private void setCursor(final Cursor c) {
+        if (currentCursor.equals(c))
+            return;
+        try {
+            // We invoke this to prevent strange things from happening
+            EventQueue.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                    // Don't change cursor when mode has changed already
+                    if (!(Main.map.mapMode instanceof PointAction))
+                        return;
+                    Main.map.mapView.setCursor(c);
+                }
+            });
+            currentCursor = c;
+        } catch (Exception e) {
+        }
+    }
+
+    public void cancelDrawing() {
+        if (Main.map == null || Main.map.mapView == null)
+            return;
+        Main.map.statusLine.setHeading(-1);
+        Main.map.statusLine.setAngle(-1);
+        Main.map.mapView.repaint();
+        updateStatusLine();
+        parentPlugin.abortInput();
+    }
+
+    public String currentValue() {
+        String out = "";
+        boolean first = true;
+        for (String point : pointList) {
+            if (!first)
+                out += ";";
+            out += point;
+            first = false;
+        }
+        return out;
+    }
+
+    private void updateTextEdit() {
+        Parameter currentParameter = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum);
+        String prefix = tr(currentParameter.description);
+        prefix += parentPlugin.commandSymbol;
+        String value = currentValue();
+        parentPlugin.textField.setText(prefix + value);
+    }
 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 30668)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 30669)
@@ -1,7 +1,7 @@
 /*
  *      WayAction.java
- *      
+ *
  *      Copyright 2011 Hind <foxhind@gmail.com>
- *      
+ *
  */
 
@@ -25,5 +25,5 @@
 
 public class WayAction extends MapMode implements AWTEventListener {
-	private CommandLine parentPlugin;
+    private final CommandLine parentPlugin;
     final private Cursor cursorNormal, cursorActive;
     private Cursor currentCursor;
@@ -33,8 +33,8 @@
     // private Type type;
 
-	public WayAction(MapFrame mapFrame, CommandLine parentPlugin) {
-		super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", "selection"));
-		this.parentPlugin = parentPlugin;
-/*
+    public WayAction(MapFrame mapFrame, CommandLine parentPlugin) {
+        super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", "selection"));
+        this.parentPlugin = parentPlugin;
+        /*
 		this.type = type;
 		switch (type) {
@@ -48,8 +48,8 @@
 				break;
 			case WAY:
-*/
-				cursorNormal = ImageProvider.getCursor("normal", "selection");
-				cursorActive = ImageProvider.getCursor("normal", "joinway");
-/*
+         */
+        cursorNormal = ImageProvider.getCursor("normal", "selection");
+        cursorActive = ImageProvider.getCursor("normal", "joinway");
+        /*
 				break;
 			default:
@@ -58,11 +58,11 @@
 				break;
 		}
-*/
+         */
         currentCursor = cursorNormal;
         nearestWay = null;
-	}
+    }
 
-	@Override public void enterMode() {
-		super.enterMode();
+    @Override public void enterMode() {
+        super.enterMode();
         currentCursor = cursorNormal;
         Main.map.mapView.addMouseListener(this);
@@ -72,9 +72,9 @@
         } catch (SecurityException ex) {
         }
-	}
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
         Main.map.mapView.removeMouseMotionListener(this);
         try {
@@ -82,5 +82,5 @@
         } catch (SecurityException ex) {
         }
-	}
+    }
 
     @Override
@@ -100,38 +100,38 @@
         processMouseEvent(e);
         if (nearestWay != null) {
-			if (isCtrlDown) {
-				Main.main.getCurrentDataSet().clearSelection(nearestWay);
-				Main.map.mapView.repaint();
-			}
-			else {
-				int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
-				switch (maxInstances) {
-				case 0:
-					Main.main.getCurrentDataSet().addSelected(nearestWay);
-					Main.map.mapView.repaint();
-					break;
-				case 1:
-					Main.main.getCurrentDataSet().addSelected(nearestWay);
-					Main.map.mapView.repaint();
-					parentPlugin.loadParameter(nearestWay, true);
-					exitMode();
-					break;
-				default:
-					if (Main.main.getCurrentDataSet().getSelected().size() < maxInstances) {
-						Main.main.getCurrentDataSet().addSelected(nearestWay);
-						Main.map.mapView.repaint();
-					}
-					else
-						System.out.println("Maximum instances!");
-				}
-			}
-		}
+            if (isCtrlDown) {
+                Main.main.getCurrentDataSet().clearSelection(nearestWay);
+                Main.map.mapView.repaint();
+            }
+            else {
+                int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
+                switch (maxInstances) {
+                case 0:
+                    Main.main.getCurrentDataSet().addSelected(nearestWay);
+                    Main.map.mapView.repaint();
+                    break;
+                case 1:
+                    Main.main.getCurrentDataSet().addSelected(nearestWay);
+                    Main.map.mapView.repaint();
+                    parentPlugin.loadParameter(nearestWay, true);
+                    exitMode();
+                    break;
+                default:
+                    if (Main.main.getCurrentDataSet().getSelected().size() < maxInstances) {
+                        Main.main.getCurrentDataSet().addSelected(nearestWay);
+                        Main.map.mapView.repaint();
+                    }
+                    else
+                        Main.info("Maximum instances!");
+                }
+            }
+        }
         super.mousePressed(e);
     }
 
-        @Override
-	public void eventDispatched(AWTEvent arg0) {
+    @Override
+    public void eventDispatched(AWTEvent arg0) {
         if (!(arg0 instanceof KeyEvent))
-                return;
+            return;
         KeyEvent ev = (KeyEvent) arg0;
         isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
@@ -145,5 +145,5 @@
         if (mousePos != null) {
             if (!Main.isDisplayingMapView())
-                    return;
+                return;
             nearestWay = Main.map.mapView.getNearestWay(mousePos, OsmPrimitive.isUsablePredicate);
             if (nearestWay != null) {
