Index: applications/editors/josm/plugins/CommandLine/.checkstyle
===================================================================
--- applications/editors/josm/plugins/CommandLine/.checkstyle	(revision 32779)
+++ applications/editors/josm/plugins/CommandLine/.checkstyle	(revision 32779)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: applications/editors/josm/plugins/CommandLine/.project
===================================================================
--- applications/editors/josm/plugins/CommandLine/.project	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/.project	(revision 32779)
@@ -16,7 +16,13 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: applications/editors/josm/plugins/CommandLine/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/CommandLine/.settings/org.eclipse.jdt.ui.prefs	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/.settings/org.eclipse.jdt.ui.prefs	(revision 32779)
@@ -1,3 +1,2 @@
-#Sat Jan 29 19:56:56 CET 2011
 eclipse.preferences.version=1
 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
@@ -15,8 +14,10 @@
 sp_cleanup.always_use_this_for_non_static_field_access=false
 sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
 sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=true
+sp_cleanup.correct_indentation=false
 sp_cleanup.format_source_code=false
 sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
 sp_cleanup.make_local_variable_final=false
 sp_cleanup.make_parameters_final=false
@@ -34,4 +35,5 @@
 sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
 sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
 sp_cleanup.remove_trailing_whitespaces=true
 sp_cleanup.remove_trailing_whitespaces_all=true
@@ -47,6 +49,8 @@
 sp_cleanup.sort_members=false
 sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
 sp_cleanup.use_blocks=false
 sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
 sp_cleanup.use_parentheses_in_expressions=false
 sp_cleanup.use_this_for_non_static_field_access=false
@@ -54,2 +58,3 @@
 sp_cleanup.use_this_for_non_static_method_access=false
 sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      AnyAction.java
- *
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -26,5 +20,5 @@
 public class AnyAction extends MapMode implements AWTEventListener {
     private final CommandLine parentPlugin;
-    final private Cursor cursorNormal, cursorActive;
+    private final Cursor cursorNormal, cursorActive;
     private Cursor currentCursor;
     private Point mousePos;
@@ -49,4 +43,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -59,4 +54,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -99,6 +95,5 @@
                         ds.addSelected(nearestPrimitive);
                         Main.map.mapView.repaint();
-                    }
-                    else
+                    } else
                         Main.info("Maximum instances!");
                 }
@@ -124,9 +119,8 @@
             if (!Main.isDisplayingMapView())
                 return;
-            nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive.isUsablePredicate, false);
+            nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive::isUsable, false);
             if (nearestPrimitive != null) {
                 setCursor(cursorActive);
-            }
-            else {
+            } else {
                 setCursor(cursorNormal);
             }
@@ -135,5 +129,7 @@
 
     private void processMouseEvent(MouseEvent e) {
-        if (e != null) { mousePos = e.getPoint(); }
+        if (e != null) {
+            mousePos = e.getPoint();
+        }
     }
 
@@ -154,4 +150,5 @@
             currentCursor = c;
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Command.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      Command.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -19,14 +13,14 @@
 
 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 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 boolean asynchronous;
 
-    public Command () {
+    public Command() {
         parameters = new ArrayList<>();
         optParameters = new ArrayList<>();
@@ -45,28 +39,24 @@
                 return true;
             }
-        }
-        else {
+        } else {
             ArrayList<OsmPrimitive> multiValue = currentParameter.getValueList();
             if (obj instanceof Collection) {
-                if ( ((Collection<?>)obj).size() > currentParameter.maxInstances && currentParameter.maxInstances != 0)
+                if (((Collection<?>) obj).size() > currentParameter.maxInstances && currentParameter.maxInstances != 0)
                     return false;
                 multiValue.clear();
-                multiValue.addAll((Collection<OsmPrimitive>)obj);
+                multiValue.addAll((Collection<OsmPrimitive>) obj);
                 return true;
-            }
-            else if (obj instanceof OsmPrimitive) {
+            } else if (obj instanceof OsmPrimitive) {
                 if (multiValue.size() < currentParameter.maxInstances || currentParameter.maxInstances == 0) {
                     if (isPair(obj, currentParameter)) {
-                        multiValue.add((OsmPrimitive)obj);
+                        multiValue.add((OsmPrimitive) obj);
                         return true;
                     } else if (nextParameter() && multiValue.size() > 0) {
                         return loadObject(obj);
                     }
-                }
-                else if (nextParameter()) {
+                } else if (nextParameter()) {
                     return loadObject(obj);
                 }
-            }
-            else if (obj instanceof String) {
+            } else if (obj instanceof String) {
                 if (isPair(obj, currentParameter)) {
                     currentParameter.setValue(obj);
@@ -100,5 +90,5 @@
             if (obj instanceof String) {
                 Pattern p = Pattern.compile("(-?\\d*\\.?\\d*,-?\\d*\\.?\\d*;?)*");
-                Matcher m = p.matcher((String)obj);
+                Matcher m = p.matcher((String) obj);
                 return m.matches();
             }
@@ -119,7 +109,7 @@
             if (obj instanceof String) {
                 Pattern p = Pattern.compile("\\d*\\.?\\d*");
-                Matcher m = p.matcher((String)obj);
+                Matcher m = p.matcher((String) obj);
                 if (m.matches()) {
-                    Float value = Float.parseFloat((String)obj);
+                    Float value = Float.parseFloat((String) obj);
                     if (parameter.minVal != 0 && value < parameter.minVal)
                         break;
@@ -133,7 +123,7 @@
             if (obj instanceof String) {
                 Pattern p = Pattern.compile("\\d*");
-                Matcher m = p.matcher((String)obj);
+                Matcher m = p.matcher((String) obj);
                 if (m.matches()) {
-                    Integer value = Integer.parseInt((String)obj);
+                    Integer value = Integer.parseInt((String) obj);
                     if (parameter.minVal != 0 && value < parameter.minVal)
                         break;
@@ -150,5 +140,5 @@
             if (obj instanceof String) {
                 if (parameter.getRawValue() instanceof Relay) {
-                    if ( ((Relay)(parameter.getRawValue())).isCorrectValue((String)obj) )
+                    if (((Relay) (parameter.getRawValue())).isCorrectValue((String) obj))
                         return true;
                 }
@@ -174,7 +164,6 @@
                 continue;
             if (parameter.maxInstances == 1) {
-                depsObjects.addAll(getDepsObjects(depsObjects, (OsmPrimitive)parameter.getRawValue()));
-            }
-            else {
+                depsObjects.addAll(getDepsObjects(depsObjects, (OsmPrimitive) parameter.getRawValue()));
+            } else {
                 for (OsmPrimitive primitive : parameter.getValueList()) {
                     depsObjects.addAll(getDepsObjects(depsObjects, primitive));
@@ -189,8 +178,7 @@
         if (!currentObjects.contains(primitive)) {
             if (primitive instanceof Way) {
-                depsObjects.addAll(((Way)primitive).getNodes());
-            }
-            else if (primitive instanceof Relation) {
-                Collection<OsmPrimitive> relationMembers = ((Relation)primitive).getMemberPrimitives();
+                depsObjects.addAll(((Way) primitive).getNodes());
+            } else if (primitive instanceof Relation) {
+                Collection<OsmPrimitive> relationMembers = ((Relation) primitive).getMemberPrimitives();
                 for (OsmPrimitive member : relationMembers) {
                     if (!currentObjects.contains(member)) {
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandAction.java	(revision 32779)
@@ -1,8 +1,3 @@
-/*
- *      CommandAction.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java	(revision 32779)
@@ -1,22 +1,3 @@
-/*
- *      CommandLine.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- */
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -121,10 +102,12 @@
                             break;
                         case SELECTION:
-                            if (currentMapFrame.mapMode instanceof WayAction || currentMapFrame.mapMode instanceof NodeAction || currentMapFrame.mapMode instanceof RelationAction || currentMapFrame.mapMode instanceof AnyAction) {
+                            if (currentMapFrame.mapMode instanceof WayAction
+                             || currentMapFrame.mapMode instanceof NodeAction
+                             || currentMapFrame.mapMode instanceof RelationAction
+                             || currentMapFrame.mapMode instanceof AnyAction) {
                                 Collection<OsmPrimitive> selected = Main.getLayerManager().getEditDataSet().getSelected();
                                 if (selected.size() > 0)
                                     loadParameter(selected, true);
-                            }
-                            else {
+                            } else {
                                 loadParameter(commandText, currentCommand.parameters.get(currentCommand.currentParameterNum).maxInstances == 1);
                             }
@@ -134,22 +117,17 @@
                         }
                         e.consume();
-                    }
-                    else if (code == KeyEvent.VK_UP) {
+                    } else if (code == KeyEvent.VK_UP) {
                         textField.setText(prefix + history.getPrevItem());
                         e.consume();
-                    }
-                    else if (code == KeyEvent.VK_DOWN) {
+                    } else if (code == KeyEvent.VK_DOWN) {
                         textField.setText(prefix + history.getNextItem());
                         e.consume();
-                    }
-                    else if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) {
+                    } else if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) {
                         if (textField.getCaretPosition() <= prefix.length())
                             e.consume();
-                    }
-                    else if (code == KeyEvent.VK_HOME) {
+                    } else if (code == KeyEvent.VK_HOME) {
                         setCaretPosition(prefix.length());
                         e.consume();
-                    }
-                    else if (code == KeyEvent.VK_ESCAPE) {
+                    } else if (code == KeyEvent.VK_ESCAPE) {
                         if (textField.getText().length() == prefix.length() && mode == Mode.IDLE)
                             deactivate();
@@ -157,15 +135,15 @@
                             endInput();
                         e.consume();
-                    }
-                    else if (code == KeyEvent.VK_DELETE || code == KeyEvent.VK_RIGHT || code == KeyEvent.VK_END) {
-                    }
-                    else {
-                        e.consume();
-                    }
-                    if (textField.getCaretPosition() < prefix.length() || (textField.getSelectionStart() < prefix.length() && textField.getSelectionStart() > 0) )
+                    } else if (code == KeyEvent.VK_DELETE || code == KeyEvent.VK_RIGHT || code == KeyEvent.VK_END) {
+                    } else {
+                        e.consume();
+                    }
+                    if (textField.getCaretPosition() < prefix.length() ||
+                            (textField.getSelectionStart() < prefix.length() && textField.getSelectionStart() > 0))
                         e.consume();
                 }
                 if (e.getID() == KeyEvent.KEY_TYPED)
-                    if (textField.getCaretPosition() < prefix.length() || (textField.getSelectionStart() < prefix.length() && textField.getSelectionStart() > 0) )
+                    if (textField.getCaretPosition() < prefix.length() ||
+                            (textField.getSelectionStart() < prefix.length() && textField.getSelectionStart() > 0))
                         e.consume();
                 super.processKeyEvent(e);
@@ -185,4 +163,5 @@
                 }
             }
+
             @Override
             protected void processMouseEvent(MouseEvent e) {
@@ -221,5 +200,11 @@
         currentCommand.resetLoading();
         parseSelection(ds.getSelected());
-        if (!(Main.map.mapMode instanceof AnyAction || Main.map.mapMode instanceof DummyAction || Main.map.mapMode instanceof LengthAction || Main.map.mapMode instanceof NodeAction || Main.map.mapMode instanceof PointAction || Main.map.mapMode instanceof RelationAction || Main.map.mapMode instanceof WayAction)) {
+        if (!(Main.map.mapMode instanceof AnyAction
+           || Main.map.mapMode instanceof DummyAction
+           || Main.map.mapMode instanceof LengthAction
+           || Main.map.mapMode instanceof NodeAction
+           || Main.map.mapMode instanceof PointAction
+           || Main.map.mapMode instanceof RelationAction
+           || Main.map.mapMode instanceof WayAction)) {
             previousMode = Main.map.mapMode;
         }
@@ -287,5 +272,5 @@
             }
             ZipEntry entry = null;
-            while ( (entry = zis.getNextEntry()) != null ) {
+            while ((entry = zis.getNextEntry()) != null) {
                 if (!entry.isDirectory()) {
                     String name = entry.getName();
@@ -313,8 +298,8 @@
         for (int i = 0; i < commands.size(); i++) {
             if (strict) {
-                if ( commands.get(i).name.equalsIgnoreCase(text) ) {
+                if (commands.get(i).name.equalsIgnoreCase(text)) {
                     return commands.get(i);
                 }
-            } else if ( commands.get(i).name.toLowerCase().startsWith( text.toLowerCase() ) && text.length() > 1 ) {
+            } else if (commands.get(i).name.toLowerCase().startsWith(text.toLowerCase()) && text.length() > 1) {
                 return commands.get(i);
             }
@@ -334,11 +319,10 @@
             prefix = tr("Command") + commandSymbol;
             textField.setText(prefix);
-        }
-        else if (targetMode == Mode.SELECTION) {
+        } else if (targetMode == Mode.SELECTION) {
             mode = Mode.SELECTION;
             Parameter currentParameter = currentCommand.parameters.get(currentCommand.currentParameterNum);
             prefix = tr(currentParameter.description == null ? currentParameter.name : currentParameter.description);
             if (currentParameter.getRawValue() instanceof Relay)
-                prefix = prefix + " (" + ((Relay)(currentParameter.getRawValue())).getOptionsString() + ")";
+                prefix = prefix + " (" + ((Relay) (currentParameter.getRawValue())).getOptionsString() + ")";
             prefix += commandSymbol;
             String value = currentParameter.getValue();
@@ -376,6 +360,5 @@
                         if (imageryLayers.size() == 1) {
                             layer = imageryLayers.get(0);
-                        }
-                        else {
+                        } else {
                             endInput();
                             return;
@@ -383,5 +366,5 @@
                     }
                 }
-                ImageryInfo info = ((ImageryLayer)layer).getInfo();
+                ImageryInfo info = ((ImageryLayer) layer).getInfo();
                 String url = info.getUrl();
                 String itype = info.getImageryType().getTypeString();
@@ -396,6 +379,5 @@
                         if (imageryLayers.size() == 1) {
                             olayer = imageryLayers.get(0);
-                        }
-                        else {
+                        } else {
                             endInput();
                             return;
@@ -403,5 +385,5 @@
                     }
                 }
-                loadParameter((String.valueOf(((ImageryLayer)olayer).getDx()) + "," + String.valueOf(((ImageryLayer)olayer).getDy())), true);
+                loadParameter((String.valueOf(((ImageryLayer) olayer).getDx()) + "," + String.valueOf(((ImageryLayer) olayer).getDy())), true);
                 action = new DummyAction(currentMapFrame, this);
                 break;
@@ -413,6 +395,5 @@
             activate();
             textField.select(prefix.length(), textField.getText().length());
-        }
-        else if (targetMode == Mode.PROCESSING) {
+        } else if (targetMode == Mode.PROCESSING) {
             mode = Mode.PROCESSING;
             prefix = tr("Processing...");
@@ -507,6 +488,7 @@
 
         // debug: print resulting cmdline
-        for (String s : builder.command())
+        for (String s : builder.command()) {
             debugstr.append(s + " ");
+        }
         debugstr.append("\n");
         Main.info(debugstr.toString());
@@ -540,4 +522,5 @@
                     }
                 } catch (IOException e) {
+                    Main.warn(e);
                 }
             }
@@ -639,6 +622,6 @@
                     }
                 } catch (Exception e) {
-                }
-                finally {
+                    Main.warn(e);
+                } finally {
                     synchronized (syncObj) {
                         tp.running = false;
@@ -657,4 +640,5 @@
                 syncObj.wait(Main.pref.getInteger("commandline.timeout", 20000));
             } catch (InterruptedException e) {
+                Main.warn(e);
             }
         }
@@ -670,4 +654,5 @@
                         }
                     } catch (InterruptedException e) {
+                        Main.warn(e);
                     }
                 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLineAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLineAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLineAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      CommandLineAction.java
- * 
- *      Copyright 2010 Hind <foxhind@gmail.com>
- * 
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -17,15 +11,15 @@
 
 public class CommandLineAction extends JosmAction {
-	private final CommandLine parentPlugin;
+    private final CommandLine parentPlugin;
 
-	public CommandLineAction(CommandLine parentPlugin) {
-		super(tr("Command line"), "commandline", tr("Set input focus to the command line."),
-				Shortcut.registerShortcut("tool:commandline", tr("Tool: {0}", tr("Command line")), KeyEvent.VK_ENTER, Shortcut.DIRECT), true, "commandline", true);
-		this.parentPlugin = parentPlugin;
-	}
+    public CommandLineAction(CommandLine parentPlugin) {
+        super(tr("Command line"), "commandline", tr("Set input focus to the command line."),
+                Shortcut.registerShortcut("tool:commandline", tr("Tool: {0}", tr("Command line")), KeyEvent.VK_ENTER, Shortcut.DIRECT), true, "commandline", true);
+        this.parentPlugin = parentPlugin;
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		parentPlugin.activate();
-	}
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        parentPlugin.activate();
+    }
 }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      DummyAction.java
- *
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -18,5 +12,5 @@
 
 public class DummyAction extends MapMode implements AWTEventListener {
-    private CommandLine parentPlugin;
+    private final CommandLine parentPlugin;
 
     public DummyAction(MapFrame mapFrame, CommandLine parentPlugin) {
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/GpxFilter.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      GpxFilter.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -40,5 +34,5 @@
                 currentSegment = new ArrayList<>();
                 for (WayPoint wp : segment.getWayPoints()) {
-                    if ( bbox.bounds(wp.getCoor()) ) {
+                    if (bbox.bounds(wp.getCoor())) {
                         currentSegment.add(wp);
                     } else {
@@ -54,5 +48,5 @@
                 }
             }
-            this.data.tracks.add( new ImmutableGpxTrack( currentTrack, Collections.<String, Object>emptyMap()) );
+            this.data.tracks.add(new ImmutableGpxTrack(currentTrack, Collections.<String, Object>emptyMap()));
         }
     }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/History.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      History.java
- *
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -26,6 +20,5 @@
             if (prevItem == null) {
                 historyList.addFirst(item);
-            }
-            else {
+            } else {
                 if (!prevItem.equalsIgnoreCase(item))
                     historyList.addFirst(item);
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/LengthAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *	  LengthAction.java
- *
- *	  Copyright 2010 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -39,6 +33,6 @@
 public class LengthAction extends MapMode implements MapViewPaintable, AWTEventListener {
     private final CommandLine parentPlugin;
-    final private Cursor cursorCrosshair;
-    final private Cursor cursorJoinNode;
+    private final Cursor cursorCrosshair;
+    private final Cursor cursorJoinNode;
     private Cursor currentCursor;
     private final Color selectedColor;
@@ -70,4 +64,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -82,4 +77,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
         if (drawing)
@@ -161,6 +157,5 @@
             requestFocusInMapView();
             drawingStart(e);
-        }
-        else
+        } else
             drawing = false;
     }
@@ -222,9 +217,8 @@
             if (!Main.isDisplayingMapView())
                 return;
-            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isUsablePredicate);
+            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isUsable);
             if (nearestNode != null) {
                 setCursor(cursorJoinNode);
-            }
-            else {
+            } else {
                 setCursor(cursorCrosshair);
             }
@@ -248,4 +242,5 @@
             currentCursor = c;
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *	  Loader.java
- *
- *	  Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -28,5 +22,5 @@
     private final ArrayList<Command> loadingCommands;
 
-    public Loader (String dir) {
+    public Loader(String dir) {
         dirToScan = dir;
         currentTag = "";
@@ -90,6 +84,5 @@
                 }
             }
-        }
-        else if (rawName.equals("parameter")) {
+        } else if (rawName.equals("parameter")) {
             currentParameter = new Parameter();
             for (int i = 0; i < len; i++) {
@@ -98,6 +91,5 @@
                 if (Name.equals("required")) {
                     currentParameter.required = Value.equals("true") ? true : false;
-                }
-                else if (Name.equals("type")) {
+                } else if (Name.equals("type")) {
                     if (Value.equals("node")) currentParameter.type = Type.NODE;
                     else if (Value.equals("way")) currentParameter.type = Type.WAY;
@@ -112,12 +104,9 @@
                     else if (Value.equals("imageryurl")) currentParameter.type = Type.IMAGERYURL;
                     else if (Value.equals("imageryoffset")) currentParameter.type = Type.IMAGERYOFFSET;
-                }
-                else if (Name.equals("maxinstances")) {
+                } else if (Name.equals("maxinstances")) {
                     currentParameter.maxInstances = Integer.parseInt(Value);
-                }
-                else if (Name.equals("maxvalue")) {
+                } else if (Name.equals("maxvalue")) {
                     currentParameter.maxVal = Float.parseFloat(Value);
-                }
-                else if (Name.equals("minvalue")) {
+                } else if (Name.equals("minvalue")) {
                     currentParameter.minVal = Float.parseFloat(Value);
                 }
@@ -127,20 +116,17 @@
 
     @Override
-    public void characters(char ch[], int start, int length) {
+    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")) {
+            } else if (currentTag.equals("description")) {
                 currentParameter.description = text;
-            }
-            else if (currentTag.equals("value")) {
+            } 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 {
+                    ((Relay) currentParameter.getRawValue()).addValue(text);
+                } else {
                     currentParameter.setValue(text);
                 }
@@ -154,13 +140,11 @@
             loadingCommands.add(currentCommand);
             currentCommand = null;
-        }
-        else if (rawName.equals("parameter")) {
-            if(currentParameter.required)
+        } else if (rawName.equals("parameter")) {
+            if (currentParameter.required)
                 currentCommand.parameters.add(currentParameter);
             else
                 currentCommand.optParameters.add(currentParameter);
             currentParameter = null;
-        }
-        else {
+        } else {
             currentTag = "";
         }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Mode.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Mode.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Mode.java	(revision 32779)
@@ -1,23 +1,3 @@
-/*
- *      Mode.java
- *      
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *      
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *      
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *      
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *      MA 02110-1301, USA.
- */
- 
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      NodeAction.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -27,5 +21,5 @@
 public class NodeAction extends MapMode implements AWTEventListener {
     private final CommandLine parentPlugin;
-    final private Cursor cursorNormal, cursorActive;
+    private final Cursor cursorNormal, cursorActive;
     private Cursor currentCursor;
     private Point mousePos;
@@ -51,4 +45,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -61,4 +56,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -84,6 +80,5 @@
                 ds.clearSelection(nearestNode);
                 Main.map.mapView.repaint();
-            }
-            else {
+            } else {
                 int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
                 switch (maxInstances) {
@@ -102,6 +97,5 @@
                         ds.addSelected(nearestNode);
                         Main.map.mapView.repaint();
-                    }
-                    else
+                    } else
                         parentPlugin.printHistory("Maximum instances is " + String.valueOf(maxInstances));
                 }
@@ -127,9 +121,8 @@
             if (!Main.isDisplayingMapView())
                 return;
-            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isUsablePredicate);
+            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isUsable);
             if (nearestNode != null) {
                 setCursor(cursorActive);
-            }
-            else {
+            } else {
                 setCursor(cursorNormal);
             }
@@ -138,5 +131,7 @@
 
     private void processMouseEvent(MouseEvent e) {
-        if (e != null) { mousePos = e.getPoint(); }
+        if (e != null) {
+            mousePos = e.getPoint();
+        }
     }
 
@@ -157,4 +152,5 @@
             currentCursor = c;
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/OsmToCmd.java	(revision 32779)
@@ -1,8 +1,3 @@
-/*
- *	  OsmToCmd.java
- *
- *	  Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -57,5 +52,5 @@
     private final HashMap<PrimitiveId, OsmPrimitive> externalIdMap; // Maps external ids to internal primitives
 
-    public OsmToCmd(CommandLine parentPlugin, DataSet targetDataSet) {
+    OsmToCmd(CommandLine parentPlugin, DataSet targetDataSet) {
         this.parentPlugin = parentPlugin;
         this.targetDataSet = targetDataSet;
@@ -70,11 +65,11 @@
             parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
             parser.parse(inputSource, handler);
-        } catch(ParserConfigurationException e) {
+        } 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) {
+        } catch (SAXException e) {
             throw new IllegalDataException(e.getMessage(), e);
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new IllegalDataException(e);
         }
@@ -115,5 +110,5 @@
                         return;
                     }
-                    if ( !(v.equals("0.6")) ) {
+                    if (!(v.equals("0.6"))) {
                         throwException(tr("Unsupported version: {0}", v));
                         return;
@@ -127,7 +122,7 @@
                     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()) )
+                    Node target = (Node) targetDataSet.getPrimitiveById(source.getUniqueId(), source.getType());
+
+                    if (target == null || !(source.isModified() || source.isDeleted()))
                         n.load(source);
                     else {
@@ -138,12 +133,11 @@
                     currentPrimitive = n;
                     externalIdMap.put(source.getPrimitiveId(), n);
-                }
-                else if (qName.equals("way")) {
+                } 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()) )
+                    Way target = (Way) targetDataSet.getPrimitiveById(source.getUniqueId(), source.getType());
+
+                    if (target == null || !(source.isModified() || source.isDeleted()))
                         w.load(source);
                     else {
@@ -155,28 +149,24 @@
                     currentWayNodes.clear();
                     externalIdMap.put(source.getPrimitiveId(), w);
-                }
-                else if (qName.equals("nd")) {
+                } 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) );
-                    Node node = (Node)externalIdMap.get(new SimplePrimitiveId(id, OsmPrimitiveType.NODE));
+                        throwException(tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id));
+                    Node node = (Node) externalIdMap.get(new SimplePrimitiveId(id, OsmPrimitiveType.NODE));
                     if (node == null || node.isModified()) {
-                        node = (Node)targetDataSet.getPrimitiveById( new SimplePrimitiveId(id, OsmPrimitiveType.NODE) );
+                        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")) {
+                } else if (qName.equals("relation")) { // ---- PARSING RELATIONS ----
                     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()) )
+                    Relation target = (Relation) targetDataSet.getPrimitiveById(source.getUniqueId(), source.getType());
+
+                    if (target == null || !(source.isModified() || source.isDeleted()))
                         r.load(source);
                     else {
@@ -188,22 +178,23 @@
                     currentRelationMembers.clear();
                     externalIdMap.put(source.getPrimitiveId(), r);
-                }
-                else if (qName.equals("member")) {
+                } else if (qName.equals("member")) {
                     if (atts.getValue("ref") == null)
-                        throwException(tr("Missing mandatory attribute ''{0}'' on <member> of relation {1}.", "ref", currentPrimitive.getUniqueId()));
+                        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) );
+                        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())));
+                        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));
+                    } 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));
                     }
 
@@ -218,9 +209,5 @@
                     RelationMember relationMember = new RelationMember(role, member);
                     currentRelationMembers.add(relationMember);
-                }
-
-                // ---- PARSING TAGS (applicable to all objects) ----
-
-                else if (qName.equals("tag")) {
+                } else if (qName.equals("tag")) { // ---- PARSING TAGS (applicable to all objects) ----
                     String key = atts.getValue("k");
                     String value = atts.getValue("v");
@@ -230,10 +217,8 @@
                     }
                     currentPrimitive.put(key.intern(), value.intern());
-                }
-                else {
+                } else {
                     Main.warn(tr("Undefined element ''{0}'' found in input stream. Skipping.", qName));
                 }
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                 throw new SAXParseException(e.getMessage(), locator, e);
             }
@@ -244,34 +229,29 @@
             if (qName.equals("node")) {
                 if (currentPrimitive.isDeleted()) {
-                    cmds.add(new DeleteCommand( targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()) ));
-                }
-                else if (currentPrimitive.isModified()) {
-                    cmds.add(new ChangeCommand(Main.getLayerManager().getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-                }
-                else if (currentPrimitive.isNew()) {
+                    cmds.add(new DeleteCommand(targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId())));
+                } else if (currentPrimitive.isModified()) {
+                    cmds.add(new ChangeCommand(Main.getLayerManager().getEditLayer(),
+                            targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                } else if (currentPrimitive.isNew()) {
                     cmds.add(new AddCommand(currentPrimitive));
                 }
-            }
-            else if (qName.equals("way")) {
-                ((Way)currentPrimitive).setNodes(currentWayNodes);
+            } 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.getLayerManager().getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-                }
-                else if (currentPrimitive.isNew()) {
+                    cmds.add(new DeleteCommand(targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId())));
+                } else if (currentPrimitive.isModified()) {
+                    cmds.add(new ChangeCommand(Main.getLayerManager().getEditLayer(),
+                            targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                } else if (currentPrimitive.isNew()) {
                     cmds.add(new AddCommand(currentPrimitive));
                 }
-            }
-            else if (qName.equals("relation")) {
-                ((Relation)currentPrimitive).setMembers(currentRelationMembers);
+            } 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.getLayerManager().getEditLayer(), targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
-                }
-                else if (currentPrimitive.isNew()) {
+                    cmds.add(new DeleteCommand(targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId())));
+                } else if (currentPrimitive.isModified()) {
+                    cmds.add(new ChangeCommand(Main.getLayerManager().getEditLayer(),
+                            targetDataSet.getPrimitiveById(currentPrimitive.getPrimitiveId()), currentPrimitive));
+                } else if (currentPrimitive.isNew()) {
                     cmds.add(new AddCommand(currentPrimitive));
                 }
@@ -315,11 +295,10 @@
             String value = atts.getValue(name);
             if (value == null) {
-                throwException(tr("Missing required attribute ''{0}''.",name));
+                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));
+            } catch (NumberFormatException e) {
+                throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.", name, value));
             }
             return 0; // should not happen
@@ -335,6 +314,5 @@
                 long id = Long.parseLong(uid);
                 return User.createOsmUser(id, name);
-            }
-            catch(NumberFormatException e) {
+            } catch (NumberFormatException e) {
                 throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''.", uid));
             }
@@ -367,6 +345,7 @@
                 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));
+                } catch (NumberFormatException e) {
+                    throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.",
+                            Long.toString(current.getUniqueId()), versionString));
                 }
             }
@@ -389,7 +368,8 @@
                 try {
                     current.setChangesetId(Integer.parseInt(v));
-                } catch(NumberFormatException e) {
+                } catch (NumberFormatException e) {
                     if (current.getUniqueId() <= 0) {
-                        Main.warn(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 {
@@ -397,7 +377,8 @@
                     }
                 }
-                if (current.getChangesetId() <=0) {
+                if (current.getChangesetId() <= 0) {
                     if (current.getUniqueId() <= 0) {
-                        Main.warn(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/Parameter.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Parameter.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      Parameter.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -39,5 +33,5 @@
         switch (type) {
         case POINT:
-            out = (String)value;
+            out = (String) value;
             break;
         case LENGTH:
@@ -51,5 +45,5 @@
             break;
         case RELAY:
-            out = String.valueOf(((Relay)value).getValue());
+            out = String.valueOf(((Relay) value).getValue());
             break;
         case NODE:
@@ -88,7 +82,6 @@
     public void setValue(Object obj) {
         if (type == Type.RELAY && obj instanceof String && value instanceof Relay) {
-            ((Relay)value).setValue((String)obj);
-        }
-        else
+            ((Relay) value).setValue((String) obj);
+        } else
             value = obj;
     }
@@ -98,7 +91,6 @@
         if (isOsm()) {
             if (maxInstances == 1) {
-                pObjects.add((OsmPrimitive)value);
-            }
-            else {
+                pObjects.add((OsmPrimitive) value);
+            } else {
                 return valueList;
             }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *	  PointAction.java
- *
- *	  Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -32,6 +26,6 @@
 public class PointAction extends MapMode implements AWTEventListener {
     private final CommandLine parentPlugin;
-    final private Cursor cursorCrosshair;
-    final private Cursor cursorJoinNode;
+    private final Cursor cursorCrosshair;
+    private final Cursor cursorJoinNode;
     private Cursor currentCursor;
     private Point mousePos;
@@ -62,4 +56,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -72,4 +67,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -82,6 +78,5 @@
                     updateTextEdit();
                 }
-            }
-            else {
+            } else {
                 LatLon coor;
                 if (nearestNode == null)
@@ -90,5 +85,5 @@
                     coor = nearestNode.getCoor();
                 if (coor.isOutSideWorld()) {
-                    JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
+                    JOptionPane.showMessageDialog(Main.parent, tr("Can not draw outside of the world."));
                     return;
                 }
@@ -98,11 +93,9 @@
                     parentPlugin.loadParameter(point, true);
                     exitMode();
-                }
-                else {
+                } else {
                     if (pointList.size() < maxInstances || maxInstances == 0) {
                         pointList.add(point);
                         updateTextEdit();
-                    }
-                    else
+                    } else
                         Main.info("Maximum instances!");
                 }
@@ -136,9 +129,8 @@
             if (!Main.isDisplayingMapView())
                 return;
-            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isUsablePredicate);
+            nearestNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isUsable);
             if (nearestNode != null) {
                 setCursor(cursorJoinNode);
-            }
-            else {
+            } else {
                 setCursor(cursorCrosshair);
             }
@@ -168,4 +160,5 @@
             currentCursor = c;
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      RelationAction.java
- *      
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *      
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -18,16 +12,16 @@
 
 public class RelationAction extends MapMode implements AWTEventListener {
-	private CommandLine parentPlugin;
+    private final CommandLine parentPlugin;
 
-	public RelationAction(MapFrame mapFrame, CommandLine parentPlugin) {
-		super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", null));
-		this.parentPlugin = parentPlugin;
-	}
+    public RelationAction(MapFrame mapFrame, CommandLine parentPlugin) {
+        super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", null));
+        this.parentPlugin = parentPlugin;
+    }
 
         @Override
-	public void eventDispatched(AWTEvent arg0) {
-		if (!(arg0 instanceof KeyEvent))
-			return;
-		KeyEvent ev = (KeyEvent) arg0;
+    public void eventDispatched(AWTEvent arg0) {
+        if (!(arg0 instanceof KeyEvent))
+            return;
+        KeyEvent ev = (KeyEvent) arg0;
         if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
             ev.consume();
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Relay.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      Relay.java
- *
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -33,5 +27,5 @@
         if (!(options.containsValue(value))) {
             int i = 0;
-            for (; i < value.length() ; i++) {
+            for (; i < value.length(); i++) {
                 letter = value.substring(i, i + 1).toLowerCase();
                 if (!options.containsKey(letter))
@@ -41,6 +35,5 @@
                 letter = String.valueOf(System.currentTimeMillis());
                 optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value;
-            }
-            else
+            } else
                 optionsString = optionsString + (optionsString.length() == 0 ? "" : ", ") + value.substring(0, i) + marker + value.substring(i);
             options.put(letter, value);
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/Type.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/Type.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/Type.java	(revision 32779)
@@ -1,20 +1,3 @@
-/*
- *      Type.java
- *      
- *      Copyright 2010 Hind <foxhind@gmail.com>
- *      
- *      NODE     - Node
- *      WAY      - Way
- *      RELATION - Relation
- *      ANY      - Any osm object (node, way or relation)
- *      POINT    - Coordinates like as Lon,Lat
- *      LENGTH   - Fractional number
- *      NATURAL  - Natural number (1, 10, 9000)
- *      STRING   - Text string
- *      TRIGGER  - Yes/No
- *      RELAY    - 
- * 
- */
- 
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
Index: applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java
===================================================================
--- applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 32699)
+++ applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java	(revision 32779)
@@ -1,9 +1,3 @@
-/*
- *      WayAction.java
- *
- *      Copyright 2011 Hind <foxhind@gmail.com>
- *
- */
-
+// License: GPL. For details, see LICENSE file.
 package CommandLine;
 
@@ -27,5 +21,5 @@
 public class WayAction extends MapMode implements AWTEventListener {
     private final CommandLine parentPlugin;
-    final private Cursor cursorNormal, cursorActive;
+    private final Cursor cursorNormal, cursorActive;
     private Cursor currentCursor;
     private Point mousePos;
@@ -38,25 +32,25 @@
         this.parentPlugin = parentPlugin;
         /*
-		this.type = type;
-		switch (type) {
-			case POINT:
-				cursorNormal = ImageProvider.getCursor("crosshair", null);
-				cursorActive = ImageProvider.getCursor("crosshair", "joinnode");
-				break;
-			case NODE:
-				cursorNormal = ImageProvider.getCursor("normal", "selection");
-				cursorActive = ImageProvider.getCursor("normal", "joinnode");
-				break;
-			case WAY:
+        this.type = type;
+        switch (type) {
+            case POINT:
+                cursorNormal = ImageProvider.getCursor("crosshair", null);
+                cursorActive = ImageProvider.getCursor("crosshair", "joinnode");
+                break;
+            case NODE:
+                cursorNormal = ImageProvider.getCursor("normal", "selection");
+                cursorActive = ImageProvider.getCursor("normal", "joinnode");
+                break;
+            case WAY:
          */
         cursorNormal = ImageProvider.getCursor("normal", "selection");
         cursorActive = ImageProvider.getCursor("normal", "joinway");
         /*
-				break;
-			default:
-				cursorNormal = ImageProvider.getCursor("normal", "selection");
-				cursorActive = ImageProvider.getCursor("normal", null);
-				break;
-		}
+                break;
+            default:
+                cursorNormal = ImageProvider.getCursor("normal", "selection");
+                cursorActive = ImageProvider.getCursor("normal", null);
+                break;
+        }
          */
         currentCursor = cursorNormal;
@@ -72,4 +66,5 @@
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -82,4 +77,5 @@
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.warn(ex);
         }
     }
@@ -122,6 +118,5 @@
                         ds.addSelected(nearestWay);
                         Main.map.mapView.repaint();
-                    }
-                    else
+                    } else
                         Main.info("Maximum instances!");
                 }
@@ -147,9 +142,8 @@
             if (!Main.isDisplayingMapView())
                 return;
-            nearestWay = Main.map.mapView.getNearestWay(mousePos, OsmPrimitive.isUsablePredicate);
+            nearestWay = Main.map.mapView.getNearestWay(mousePos, OsmPrimitive::isUsable);
             if (nearestWay != null) {
                 setCursor(cursorActive);
-            }
-            else {
+            } else {
                 setCursor(cursorNormal);
             }
@@ -158,5 +152,7 @@
 
     private void processMouseEvent(MouseEvent e) {
-        if (e != null) { mousePos = e.getPoint(); }
+        if (e != null) {
+            mousePos = e.getPoint();
+        }
     }
 
@@ -177,4 +173,5 @@
             currentCursor = c;
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
