Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 30671)
@@ -28,5 +28,12 @@
     public boolean asynchronous;
 
-    public Command () {	parameters = new ArrayList<Parameter>(); optParameters = new ArrayList<Parameter>(); currentParameterNum = 0; tracks = false; asynchronous = false; icon = ""; }
+    public Command () {
+        parameters = new ArrayList<>();
+        optParameters = new ArrayList<>();
+        currentParameterNum = 0;
+        tracks = false;
+        asynchronous = false;
+        icon = "";
+    }
 
     @SuppressWarnings("unchecked")
@@ -53,15 +60,10 @@
                         multiValue.add((OsmPrimitive)obj);
                         return true;
-                    }
-                    else {
-                        if (nextParameter() && multiValue.size() > 0) {
-                            return loadObject(obj);
-                        }
-                    }
-                }
-                else {
-                    if (nextParameter()) {
+                    } else if (nextParameter() && multiValue.size() > 0) {
                         return loadObject(obj);
                     }
+                }
+                else if (nextParameter()) {
+                    return loadObject(obj);
                 }
             }
@@ -167,5 +169,5 @@
 
     public Collection<OsmPrimitive> getDepsObjects() {
-        ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
+        ArrayList<OsmPrimitive> depsObjects = new ArrayList<>();
         for (Parameter parameter : parameters) {
             if (!parameter.isOsm())
@@ -184,5 +186,5 @@
 
     public Collection<OsmPrimitive> getDepsObjects(Collection<OsmPrimitive> currentObjects, OsmPrimitive primitive) {
-        ArrayList<OsmPrimitive> depsObjects = new ArrayList<OsmPrimitive>();
+        ArrayList<OsmPrimitive> depsObjects = new ArrayList<>();
         if (!currentObjects.contains(primitive)) {
             if (primitive instanceof Way) {
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 30671)
@@ -314,7 +314,5 @@
                 Layer layer = Main.map.mapView.getActiveLayer();
                 if (layer != null) {
-                    if (layer instanceof ImageryLayer) {
-                    }
-                    else {
+                    if (!(layer instanceof ImageryLayer)) {
                         List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
                         if (imageryLayers.size() == 1) {
@@ -501,5 +499,5 @@
                 Collection<OsmPrimitive> pObjects;
                 osmWriter.header();
-                Collection<OsmPrimitive> contents = new ArrayList<OsmPrimitive>();
+                Collection<OsmPrimitive> contents = new ArrayList<>();
                 for (OsmPrimitive primitive : refObjects) {
                     contents.add(primitive);
@@ -518,5 +516,5 @@
                     if (!parameter.isOsm())
                         continue;
-                    contents = new ArrayList<OsmPrimitive>();
+                    contents = new ArrayList<>();
                     osmWriter.header();
                     pObjects = parameter.getParameterObjects();
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 30671)
@@ -36,7 +36,7 @@
         Collection<WayPoint> currentSegment;
         for (GpxTrack track : data.tracks) {
-            currentTrack = new ArrayList<Collection<WayPoint>>();
+            currentTrack = new ArrayList<>();
             for (GpxTrackSegment segment : track.getSegments()) {
-                currentSegment = new ArrayList<WayPoint>();
+                currentSegment = new ArrayList<>();
                 for (WayPoint wp : segment.getWayPoints()) {
                     if ( bbox.bounds(wp.getCoor()) ) {
@@ -45,5 +45,5 @@
                         if (currentSegment.size() > 1) {
                             currentTrack.add(currentSegment);
-                            currentSegment = new ArrayList<WayPoint>();
+                            currentSegment = new ArrayList<>();
                         }
                     }
@@ -51,5 +51,5 @@
                 if (currentSegment.size() > 1) {
                     currentTrack.add(currentSegment);
-                    currentSegment = new ArrayList<WayPoint>();
+                    currentSegment = new ArrayList<>();
                 }
             }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java	(revision 30671)
@@ -1,9 +1,9 @@
 /*
  *      History.java
- *      
+ *
  *      Copyright 2010 Hind <foxhind@gmail.com>
- *      
+ *
  */
- 
+
 package CommandLine;
 
@@ -11,57 +11,57 @@
 
 public class History {
-	private LinkedList<String> historyList;
-	private int maxLen;
-	private int num;
-	
-	public History(int len) {
-		num = 0;
-		maxLen = len;
-		historyList = new LinkedList<String>();
-	}
-	
-	public void addItem(String item) {
-		if (!item.equals("")) {
-			String prevItem = historyList.peekFirst();
-			if (prevItem == null) {
-				historyList.addFirst(item);
-			}
-			else {
-				if (!prevItem.equalsIgnoreCase(item))
-					historyList.addFirst(item);
-			}
-			if (historyList.size() > maxLen) {
-				historyList.removeLast();
-			}
-		}
-		num = -1;
-	}
-	
-	public String getPrevItem() {
-		num += 1;
-		if (num >= historyList.size()) {
-			num = historyList.size() - 1;
-		}
-		if (num < 0) {
-			num = -1;
-			return "";
-		}
-		return historyList.get(num);
-	}
-	
-	public String getLastItem() {
-		if (historyList.size() > 0)
-			return historyList.get(0);
-		return "";
-	}
+    private final LinkedList<String> historyList;
+    private final int maxLen;
+    private int num;
 
-	public String getNextItem() {
-		num -= 1;
-		if (num < 0) {
-			num = -1;
-			return "";
-		}
-		return historyList.get(num);
-	}
+    public History(int len) {
+        num = 0;
+        maxLen = len;
+        historyList = new LinkedList<>();
+    }
+
+    public void addItem(String item) {
+        if (!item.equals("")) {
+            String prevItem = historyList.peekFirst();
+            if (prevItem == null) {
+                historyList.addFirst(item);
+            }
+            else {
+                if (!prevItem.equalsIgnoreCase(item))
+                    historyList.addFirst(item);
+            }
+            if (historyList.size() > maxLen) {
+                historyList.removeLast();
+            }
+        }
+        num = -1;
+    }
+
+    public String getPrevItem() {
+        num += 1;
+        if (num >= historyList.size()) {
+            num = historyList.size() - 1;
+        }
+        if (num < 0) {
+            num = -1;
+            return "";
+        }
+        return historyList.get(num);
+    }
+
+    public String getLastItem() {
+        if (historyList.size() > 0)
+            return historyList.get(0);
+        return "";
+    }
+
+    public String getNextItem() {
+        num -= 1;
+        if (num < 0) {
+            num = -1;
+            return "";
+        }
+        return historyList.get(num);
+    }
 }
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 30671)
@@ -31,5 +31,5 @@
         dirToScan = dir;
         currentTag = "";
-        loadingCommands = new ArrayList<Command>();
+        loadingCommands = new ArrayList<>();
     }
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 30671)
@@ -54,5 +54,5 @@
     private final CommandLine parentPlugin;
     private final DataSet targetDataSet;
-    private final LinkedList<Command> cmds = new LinkedList<Command>();
+    private final LinkedList<Command> cmds = new LinkedList<>();
     private final HashMap<PrimitiveId, OsmPrimitive> externalIdMap; // Maps external ids to internal primitives
 
@@ -60,5 +60,5 @@
         this.parentPlugin = parentPlugin;
         this.targetDataSet = targetDataSet;
-        externalIdMap = new HashMap<PrimitiveId, OsmPrimitive>();
+        externalIdMap = new HashMap<>();
     }
 
@@ -99,6 +99,6 @@
         private OsmPrimitive currentPrimitive;
         //private long currentExternalId;
-        private final List<Node> currentWayNodes = new ArrayList<Node>();
-        private final List<RelationMember> currentRelationMembers = new ArrayList<RelationMember>();
+        private final List<Node> currentWayNodes = new ArrayList<>();
+        private final List<RelationMember> currentRelationMembers = new ArrayList<>();
 
         @Override
@@ -108,11 +108,14 @@
                     if (atts == null) {
                         throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm"));
+                        return;
                     }
                     String v = atts.getValue("version");
                     if (v == null) {
                         throwException(tr("Missing mandatory attribute ''{0}''.", "version"));
+                        return;
                     }
                     if ( !(v.equals("0.6")) ) {
                         throwException(tr("Unsupported version: {0}", v));
+                        return;
                     }
 
@@ -224,4 +227,5 @@
                     if (key == null || value == null) {
                         throwException(tr("Missing key or value attribute in tag."));
+                        return;
                     }
                     currentPrimitive.put(key.intern(), value.intern());
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 30671)
@@ -1,9 +1,9 @@
 /*
  *      Parameter.java
- *      
+ *
  *      Copyright 2011 Hind <foxhind@gmail.com>
- *      
+ *
  */
- 
+
 package CommandLine;
 
@@ -16,89 +16,97 @@
 
 public class Parameter {
-	public boolean required;
-	public Type type;
-	public String name;
-	public String description;
-	private Object value;
-	private ArrayList<OsmPrimitive> valueList;
-	protected float maxVal;
-	protected float minVal;
-	protected int maxInstances;
-	
-	public Parameter () { required = false; maxInstances = 1; maxVal = 0; minVal = 0; value = ""; valueList = new ArrayList<OsmPrimitive>(); }
-	public String getValue() {
-		String out = "";
-		switch (type) {
-			case POINT:
-				out = (String)value;
-				break;
-			case LENGTH:
-				out = String.valueOf(value);
-				break;
-			case NATURAL:
-				out = String.valueOf(value);
-				break;
-			case STRING:
-				out = String.valueOf(value);
-				break;
-			case RELAY:
-				out = String.valueOf(((Relay)value).getValue());
-				break;
-			case NODE:
-				out = String.valueOf(valueList.size()) + " " + tr("nodes");
-				break;
-			case WAY:
-				out = String.valueOf(valueList.size()) + " " + tr("ways");
-				break;
-			case RELATION:
-				out = String.valueOf(valueList.size()) + " " + tr("relations");
-				break;
-			case ANY:
-				out = String.valueOf(valueList.size()) + " " + tr("OSM objects");
-				break;
-			case USERNAME:
-				out = String.valueOf(value);
-				break;
-			case IMAGERYURL:
-				out = String.valueOf(value);
-				break;
-			case IMAGERYOFFSET:
-				out = String.valueOf(value);
-				break;
-		}
-		return out;
-	}
+    public boolean required;
+    public Type type;
+    public String name;
+    public String description;
+    private Object value;
+    private final ArrayList<OsmPrimitive> valueList;
+    protected float maxVal;
+    protected float minVal;
+    protected int maxInstances;
 
-	public Object getRawValue() {
-		return value;
-	}
+    public Parameter() {
+        required = false;
+        maxInstances = 1;
+        maxVal = 0;
+        minVal = 0;
+        value = "";
+        valueList = new ArrayList<>();
+    }
 
-	public ArrayList<OsmPrimitive> getValueList() {
-		return valueList;
-	}
+    public String getValue() {
+        String out = "";
+        switch (type) {
+        case POINT:
+            out = (String)value;
+            break;
+        case LENGTH:
+            out = String.valueOf(value);
+            break;
+        case NATURAL:
+            out = String.valueOf(value);
+            break;
+        case STRING:
+            out = String.valueOf(value);
+            break;
+        case RELAY:
+            out = String.valueOf(((Relay)value).getValue());
+            break;
+        case NODE:
+            out = String.valueOf(valueList.size()) + " " + tr("nodes");
+            break;
+        case WAY:
+            out = String.valueOf(valueList.size()) + " " + tr("ways");
+            break;
+        case RELATION:
+            out = String.valueOf(valueList.size()) + " " + tr("relations");
+            break;
+        case ANY:
+            out = String.valueOf(valueList.size()) + " " + tr("OSM objects");
+            break;
+        case USERNAME:
+            out = String.valueOf(value);
+            break;
+        case IMAGERYURL:
+            out = String.valueOf(value);
+            break;
+        case IMAGERYOFFSET:
+            out = String.valueOf(value);
+            break;
+        }
+        return out;
+    }
 
-	public void setValue(Object obj) {
-		if (type == Type.RELAY && obj instanceof String && value instanceof Relay) {
-			((Relay)value).setValue((String)obj);
-		}
-		else
-			value = obj;
-	}
+    public Object getRawValue() {
+        return value;
+    }
 
-	public Collection<OsmPrimitive> getParameterObjects() {
-		ArrayList<OsmPrimitive> pObjects = new ArrayList<OsmPrimitive>();
-		if (isOsm()) {
-			if (maxInstances == 1) {
-				pObjects.add((OsmPrimitive)value);
-			}
-			else {
-				return valueList;
-			}
-		}
-		return pObjects;
-	}
+    public ArrayList<OsmPrimitive> getValueList() {
+        return valueList;
+    }
 
-	public boolean isOsm() {
-		return type == Type.NODE || type == Type.WAY || type == Type.RELATION || type == Type.ANY;
-	}
+    public void setValue(Object obj) {
+        if (type == Type.RELAY && obj instanceof String && value instanceof Relay) {
+            ((Relay)value).setValue((String)obj);
+        }
+        else
+            value = obj;
+    }
+
+    public Collection<OsmPrimitive> getParameterObjects() {
+        ArrayList<OsmPrimitive> pObjects = new ArrayList<>();
+        if (isOsm()) {
+            if (maxInstances == 1) {
+                pObjects.add((OsmPrimitive)value);
+            }
+            else {
+                return valueList;
+            }
+        }
+        return pObjects;
+    }
+
+    public boolean isOsm() {
+        return type == Type.NODE || type == Type.WAY || type == Type.RELATION || type == Type.ANY;
+    }
 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 30671)
@@ -47,5 +47,5 @@
         currentCursor = cursorCrosshair;
         nearestNode = null;
-        pointList = new ArrayList<String>();
+        pointList = new ArrayList<>();
     }
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java	(revision 30670)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java	(revision 30671)
@@ -1,7 +1,7 @@
 /*
  *      Relay.java
- *      
+ *
  *      Copyright 2010 Hind <foxhind@gmail.com>
- *      
+ *
  */
 
@@ -11,52 +11,52 @@
 
 public class Relay {
-  static String marker = "\u0332";
-  private String optionsString;
-  private HashMap<String, String> options;
-  private String value;
+    static String marker = "\u0332";
+    private String optionsString;
+    private final HashMap<String, String> options;
+    private String value;
 
-  public Relay() {
-    optionsString = "";
-    value = "";
-    options = new HashMap<String, String>();
-  }
+    public Relay() {
+        optionsString = "";
+        value = "";
+        options = new HashMap<>();
+    }
 
-  public void setValue(String value) {
-    if (options.containsKey(value))
-      this.value = options.get(value);
-    else if (options.containsValue(value))
-      this.value = value;
-  }
+    public void setValue(String value) {
+        if (options.containsKey(value))
+            this.value = options.get(value);
+        else if (options.containsValue(value))
+            this.value = value;
+    }
 
-  public void addValue(String value) {
-    String letter = null;
-    if (!(options.containsValue(value))) {
-      int i = 0;
-      for (; i < value.length() ; i++) {
-        letter = value.substring(i, i + 1).toLowerCase();
-        if (!options.containsKey(letter))
-          break;
-      }
-      if (i == value.length()) {
-        letter = String.valueOf(System.currentTimeMillis());
-        optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value;
-      }
-      else
-        optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value.substring(0, i) + marker + value.substring(i);
-      options.put(letter, value);
+    public void addValue(String value) {
+        String letter = null;
+        if (!(options.containsValue(value))) {
+            int i = 0;
+            for (; i < value.length() ; i++) {
+                letter = value.substring(i, i + 1).toLowerCase();
+                if (!options.containsKey(letter))
+                    break;
+            }
+            if (i == value.length()) {
+                letter = String.valueOf(System.currentTimeMillis());
+                optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value;
+            }
+            else
+                optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value.substring(0, i) + marker + value.substring(i);
+            options.put(letter, value);
+        }
+        this.value = value;
     }
-    this.value = value;
-  }
 
-  public String getValue() {
-    return value;
-  }
+    public String getValue() {
+        return value;
+    }
 
-  public boolean isCorrectValue(String value) {
-    return options.containsValue(value) || options.containsKey(value.toLowerCase());
-  }
+    public boolean isCorrectValue(String value) {
+        return options.containsValue(value) || options.containsKey(value.toLowerCase());
+    }
 
-  public String getOptionsString() {
-    return optionsString;
-  }
+    public String getOptionsString() {
+        return optionsString;
+    }
 }
