Index: /applications/editors/josm/plugins/utilsplugin2/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/.checkstyle	(revision 32410)
+++ /applications/editors/josm/plugins/utilsplugin2/.checkstyle	(revision 32410)
@@ -0,0 +1,19 @@
+<?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="src/edu"/>
+    <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/utilsplugin2/.project
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/.project	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/.project	(revision 32410)
@@ -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/utilsplugin2/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/.settings/org.eclipse.jdt.ui.prefs	(revision 32410)
+++ /applications/editors/josm/plugins/utilsplugin2/.settings/org.eclipse.jdt.ui.prefs	(revision 32410)
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+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.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=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+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=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+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/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL v2 or later. See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2;
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java	(revision 32410)
@@ -28,5 +28,5 @@
 
 public class AddIntersectionsAction extends JosmAction {
-    
+
     /**
      * Constructs a new {@code AddIntersectionsAction}.
@@ -34,5 +34,7 @@
     public AddIntersectionsAction() {
         super(tr("Add nodes at intersections"), "addintersect", tr("Add missing nodes at intersections of selected ways."),
-                Shortcut.registerShortcut("tools:addintersect", tr("Tool: {0}", tr("Add nodes at intersections")), KeyEvent.VK_I, Shortcut.SHIFT), true);
+                Shortcut.registerShortcut("tools:addintersect", tr("Tool: {0}", tr("Add nodes at intersections")),
+                        KeyEvent.VK_I, Shortcut.SHIFT),
+                true);
         putValue("help", ht("/Action/AddIntersections"));
     }
@@ -45,7 +47,7 @@
         if (ways.isEmpty()) {
             new Notification(
-               tr("Please select one or more ways with intersections of segments."))
-               .setIcon(JOptionPane.INFORMATION_MESSAGE) 
-               .show();
+                    tr("Please select one or more ways with intersections of segments."))
+            .setIcon(JOptionPane.INFORMATION_MESSAGE)
+            .show();
             return;
         }
@@ -54,12 +56,12 @@
         Geometry.addIntersections(ways, false, cmds);
         if (!cmds.isEmpty()) {
-            Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"),cmds));
+            Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"), cmds));
             Set<Node> nodes = new HashSet<>(10);
             // find and select newly added nodes
-            for (Command cmd: cmds) if (cmd instanceof AddCommand){
+            for (Command cmd: cmds) if (cmd instanceof AddCommand) {
                 Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives();
-                for ( OsmPrimitive p : pp) { // find all affected nodes
+                for (OsmPrimitive p : pp) { // find all affected nodes
                     if (p instanceof Node && p.isNew())
-                        nodes.add((Node)p);
+                        nodes.add((Node) p);
                 }
                 if (!nodes.isEmpty()) {
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java	(revision 32410)
@@ -1,15 +1,27 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.MoveCommand;
+import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.data.osm.*;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.command.*;
-import java.util.*;
-import java.awt.event.ActionEvent;
-import javax.swing.JOptionPane;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.gui.Notification;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -27,19 +39,20 @@
     public AlignWayNodesAction() {
         super(TITLE, "dumbutils/alignwaynodes", tr("Align nodes in a way"),
-                Shortcut.registerShortcut("tools:alignwaynodes", tr("Tool: {0}", tr("Align Way Nodes")), KeyEvent.VK_L, Shortcut.SHIFT)
-                , true);
-    }
-
-    public void actionPerformed( ActionEvent e ) {
+                Shortcut.registerShortcut("tools:alignwaynodes", tr("Tool: {0}", tr("Align Way Nodes")), KeyEvent.VK_L, Shortcut.SHIFT),
+                true);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
         Set<Node> selectedNodes = filterNodes(selection);
         int selectedNodesCount = selectedNodes.size();
         Set<Way> ways = findCommonWays(selectedNodes);
-        if( ways == null || ways.size() != 1 || selectedNodesCount == 0 )
+        if (ways == null || ways.size() != 1 || selectedNodesCount == 0)
             return;
         Way way = ways.iterator().next();
-        if( way.getNodesCount() < (way.isClosed() ? 4 : 3) ) {
+        if (way.getNodesCount() < (way.isClosed() ? 4 : 3)) {
             new Notification(tr("The way with selected nodes can not be straightened."))
-                    .setIcon(JOptionPane.ERROR_MESSAGE).show();
+            .setIcon(JOptionPane.ERROR_MESSAGE).show();
             return;
         }
@@ -51,26 +64,26 @@
         int i = firstNodePos;
         boolean iterated = false;
-        while( !iterated || i != lastNodePos ) {
+        while (!iterated || i != lastNodePos) {
             Node node = way.getNode(i);
-            if( selectedNodes.contains(node) ) {
+            if (selectedNodes.contains(node)) {
                 nodes.add(node);
                 selectedNodes.remove(node);
-                if( selectedNodesCount == 1 ) {
-                    nodes.add(0, way.getNode( i > 0 ? i - 1 : way.isClosed() ? way.getNodesCount() - 2 : i + 2 ));
-                    nodes.add(way.getNode( i + 1 < way.getNodesCount() ? i + 1 : way.isClosed() ? 1 : i - 2 ));
+                if (selectedNodesCount == 1) {
+                    nodes.add(0, way.getNode(i > 0 ? i - 1 : way.isClosed() ? way.getNodesCount() - 2 : i + 2));
+                    nodes.add(way.getNode(i + 1 < way.getNodesCount() ? i + 1 : way.isClosed() ? 1 : i - 2));
                 }
-                if( selectedNodes.isEmpty() )
+                if (selectedNodes.isEmpty())
                     break;
-            } else if( selectedNodesCount == 2 && selectedNodes.size() == 1 )
+            } else if (selectedNodesCount == 2 && selectedNodes.size() == 1)
                 nodes.add(node);
             i++;
-            if( i >= way.getNodesCount() && way.isClosed() )
+            if (i >= way.getNodesCount() && way.isClosed())
                 i = 0;
             iterated = true;
         }
 
-        if( nodes.size() < 3 ) {
+        if (nodes.size() < 3) {
             new Notification(tr("Internal error: number of nodes is {0}.", nodes.size()))
-                .setIcon(JOptionPane.ERROR_MESSAGE).show();
+            .setIcon(JOptionPane.ERROR_MESSAGE).show();
             return;
         }
@@ -83,16 +96,16 @@
         double bx = nodes.get(nodes.size() - 1).getEastNorth().east();
         double by = nodes.get(nodes.size() - 1).getEastNorth().north();
-        
-        for( i = 1; i + 1 < nodes.size(); i++ ) {
+
+        for (i = 1; i + 1 < nodes.size(); i++) {
             Node n = nodes.get(i);
-            
+
             // Algorithm is copied from org.openstreetmap.josm.actions.AlignInLineAction
             double nx = n.getEastNorth().east();
             double ny = n.getEastNorth().north();
 
-            if( ax == bx ) {
+            if (ax == bx) {
                 // Special case if AB is vertical...
                 nx = ax;
-            } else if( ay == by ) {
+            } else if (ay == by) {
                 // ...or horizontal
                 ny = ay;
@@ -109,9 +122,9 @@
 
             // Add the command to move the node to its new position.
-            if( Math.abs(nx - n.getEastNorth().east()) > MOVE_THRESHOLD && Math.abs(ny - n.getEastNorth().north()) > MOVE_THRESHOLD )
+            if (Math.abs(nx - n.getEastNorth().east()) > MOVE_THRESHOLD && Math.abs(ny - n.getEastNorth().north()) > MOVE_THRESHOLD)
                 commands.add(new MoveCommand(n, nx - n.getEastNorth().east(), ny - n.getEastNorth().north()));
         }
 
-        if( !commands.isEmpty() )
+        if (!commands.isEmpty())
             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     }
@@ -123,5 +136,5 @@
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         Set<Node> nodes = filterNodes(selection);
         Set<Way> ways = findCommonWays(nodes);
@@ -129,9 +142,9 @@
     }
 
-    private Set<Way> findCommonWays( Set<Node> nodes ) {
+    private Set<Way> findCommonWays(Set<Node> nodes) {
         Set<Way> ways = null;
-        for( Node n : nodes ) {
+        for (Node n : nodes) {
             List<Way> referrers = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class);
-            if( ways == null )
+            if (ways == null)
                 ways = new HashSet<>(referrers);
             else {
@@ -142,10 +155,11 @@
     }
 
-    private Set<Node> filterNodes( Collection<? extends OsmPrimitive> selection ) {
+    private Set<Node> filterNodes(Collection<? extends OsmPrimitive> selection) {
         Set<Node> result = new HashSet<>();
-        if( selection != null ) {
-            for( OsmPrimitive p : selection )
-                if( p instanceof Node )
-                    result.add((Node)p);
+        if (selection != null) {
+            for (OsmPrimitive p : selection) {
+                if (p instanceof Node)
+                    result.add((Node) p);
+            }
         }
         return result;
@@ -157,11 +171,12 @@
      * TODO: not the maximum node count, but maximum distance!
      */
-    private int findFirstNode( Way way, Set<Node> nodes ) {
+    private int findFirstNode(Way way, Set<Node> nodes) {
         int pos = 0;
-        while( pos < way.getNodesCount() && !nodes.contains(way.getNode(pos)) )
+        while (pos < way.getNodesCount() && !nodes.contains(way.getNode(pos))) {
             pos++;
-        if( pos >= way.getNodesCount() )
+        }
+        if (pos >= way.getNodesCount())
             return 0;
-        if( !way.isClosed() || nodes.size() <= 1 )
+        if (!way.isClosed() || nodes.size() <= 1)
             return pos;
 
@@ -170,17 +185,17 @@
         int maxLength = 0;
         int lastPos = 0;
-        while( !fullCircle ) {
+        while (!fullCircle) {
             int length = 0;
             boolean skippedFirst = false;
-            while( !(skippedFirst && nodes.contains(way.getNode(pos))) ) {
+            while (!(skippedFirst && nodes.contains(way.getNode(pos)))) {
                 skippedFirst = true;
                 length++;
                 pos++;
-                if( pos >= way.getNodesCount() ) {
+                if (pos >= way.getNodesCount()) {
                     pos = 0;
                     fullCircle = true;
                 }
             }
-            if( length > maxLength ) {
+            if (length > maxLength) {
                 maxLength = length;
                 lastPos = pos;
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java	(revision 32410)
@@ -1,9 +1,9 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
-import java.awt.Point;
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Point;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -11,5 +11,7 @@
 import java.util.LinkedList;
 import java.util.List;
+
 import javax.swing.JOptionPane;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -19,7 +21,8 @@
 import org.openstreetmap.josm.command.MoveCommand;
 import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.data.osm.*;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
-
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -35,6 +38,6 @@
         super(tr("Extract node"), "extnode",
                 tr("Extracts node from a way"),
-                Shortcut.registerShortcut("tools:extnode", tr("Tool: {0}","Extract node"),
-                KeyEvent.VK_J, Shortcut.ALT_SHIFT), true);
+                Shortcut.registerShortcut("tools:extnode", tr("Tool: {0}", "Extract node"),
+                        KeyEvent.VK_J, Shortcut.ALT_SHIFT), true);
         putValue("help", ht("/Action/ExtractNode"));
     }
@@ -44,7 +47,7 @@
         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
         List<Node> selectedNodes = OsmPrimitive.getFilteredList(selection, Node.class);
-        if (selectedNodes.size()!=1) {
+        if (selectedNodes.size() != 1) {
             new Notification(tr("This tool extracts node from its ways and requires single node to be selected."))
-                .setIcon(JOptionPane.WARNING_MESSAGE).show();
+            .setIcon(JOptionPane.WARNING_MESSAGE).show();
             return;
         }
@@ -55,18 +58,18 @@
         Point p = Main.map.mapView.getMousePosition();
         if (p != null)
-            cmds.add(new MoveCommand(nd,Main.map.mapView.getLatLon(p.x, p.y)));
+            cmds.add(new MoveCommand(nd, Main.map.mapView.getLatLon(p.x, p.y)));
         List<OsmPrimitive> refs = nd.getReferrers();
         cmds.add(new AddCommand(ndCopy));
-        
+
         for (OsmPrimitive pr: refs) {
             if (pr instanceof Way) {
-                Way w=(Way)pr;
+                Way w = (Way) pr;
                 List<Node> nodes = w.getNodes();
-                int idx=nodes.indexOf(nd);
+                int idx = nodes.indexOf(nd);
                 nodes.set(idx, ndCopy); // replace node with its copy
                 cmds.add(new ChangeNodesCommand(w, nodes));
             }
         }
-        if (cmds.size()>1) Main.main.undoRedo.add(new SequenceCommand(tr("Extract node from line"),cmds));
+        if (cmds.size() > 1) Main.main.undoRedo.add(new SequenceCommand(tr("Extract node from line"), cmds));
     }
 
@@ -82,5 +85,5 @@
             return;
         }
-        setEnabled(selection.size()==1);
+        setEnabled(selection.size() == 1);
     }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
@@ -32,47 +33,48 @@
     public PasteRelationsAction() {
         super(TITLE, "dumbutils/pasterelations", tr("Paste relation membership from objects in the buffer onto selected object(s)"),
-                Shortcut.registerShortcut("tools:pasterelations", tr("Tool: {0}",  tr("Paste Relations")), KeyEvent.VK_V, Shortcut.ALT_CTRL), true);
+                Shortcut.registerShortcut("tools:pasterelations", tr("Tool: {0}", tr("Paste Relations")), KeyEvent.VK_V, Shortcut.ALT_CTRL),
+                true);
     }
 
     @Override
-    public void actionPerformed( ActionEvent e ) {
+    public void actionPerformed(ActionEvent e) {
         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
-        if( selection.isEmpty() )
+        if (selection.isEmpty())
             return;
 
         Map<Relation, String> relations = new HashMap<>();
-        for( PrimitiveData pdata : Main.pasteBuffer.getDirectlyAdded() ) {
+        for (PrimitiveData pdata : Main.pasteBuffer.getDirectlyAdded()) {
             OsmPrimitive p = getLayerManager().getEditDataSet().getPrimitiveById(pdata.getUniqueId(), pdata.getType());
             if (p != null) {
-	            for( Relation r : OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class)) {
-	                String role = relations.get(r);
-	                for( RelationMember m : r.getMembers() ) {
-	                    if( m.getMember().equals(p) ) {
-	                        String newRole = m.getRole();
-	                        if( newRole != null && role == null )
-	                            role = newRole;
-	                        else if( newRole != null ? !newRole.equals(role) : role != null ) {
-	                            role = "";
-	                            break;
-	                        }
-	                    }
-	                }
-	                relations.put(r, role);
-	            }
+                for (Relation r : OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class)) {
+                    String role = relations.get(r);
+                    for (RelationMember m : r.getMembers()) {
+                        if (m.getMember().equals(p)) {
+                            String newRole = m.getRole();
+                            if (newRole != null && role == null)
+                                role = newRole;
+                            else if (newRole != null ? !newRole.equals(role) : role != null) {
+                                role = "";
+                                break;
+                            }
+                        }
+                    }
+                    relations.put(r, role);
+                }
             }
         }
 
         List<Command> commands = new ArrayList<>();
-        for( Relation rel : relations.keySet() ) {
+        for (Relation rel : relations.keySet()) {
             Relation r = new Relation(rel);
             boolean changed = false;
-            for( OsmPrimitive p : selection ) {
-                if( !r.getMemberPrimitives().contains(p) && !r.equals(p) ) {
+            for (OsmPrimitive p : selection) {
+                if (!r.getMemberPrimitives().contains(p) && !r.equals(p)) {
                     String role = relations.get(rel);
                     if ("associatedStreet".equals(r.get("type"))) {
                         if (p.get("highway") != null) {
-                            role="street";
+                            role = "street";
                         } else if (p.get("addr:housenumber") != null) {
-                            role="house";
+                            role = "house";
                         }
                     }
@@ -81,9 +83,9 @@
                 }
             }
-            if( changed )
+            if (changed)
                 commands.add(new ChangeCommand(rel, r));
         }
 
-        if( !commands.isEmpty() )
+        if (!commands.isEmpty())
             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     }
@@ -95,6 +97,6 @@
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
-        setEnabled(selection != null && !selection.isEmpty() && !Main.pasteBuffer.isEmpty() );
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
+        setEnabled(selection != null && !selection.isEmpty() && !Main.pasteBuffer.isEmpty());
     }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2007 by Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
@@ -26,5 +26,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
-
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -44,7 +43,6 @@
     public SplitObjectAction() {
         super(tr("Split Object"), "splitobject", tr("Split an object at the selected nodes."),
-                Shortcut.registerShortcut("tools:splitobject", tr("Tool: {0}", tr("Split Object")),
-                KeyEvent.VK_X,  Shortcut.ALT)
-                , true);
+                Shortcut.registerShortcut("tools:splitobject", tr("Tool: {0}", tr("Split Object")), KeyEvent.VK_X, Shortcut.ALT),
+                true);
         putValue("help", ht("/Action/SplitObject"));
     }
@@ -75,10 +73,10 @@
             for (Way selWay : selectedWays) {       // we assume not more 2 ways in the list
                 if (selWay != null &&               // If one of selected ways is not closed we have it to get split points
-                    selWay.isUsable() &&
-                    !selWay.isClosed() &&
-                    selWay.getKeys().isEmpty()) {
-                        selectedNodes.add(selWay.firstNode());
-                        selectedNodes.add(selWay.lastNode());
-                        splitWay = selWay;
+                        selWay.isUsable() &&
+                        !selWay.isClosed() &&
+                        selWay.getKeys().isEmpty()) {
+                    selectedNodes.add(selWay.firstNode());
+                    selectedNodes.add(selWay.lastNode());
+                    splitWay = selWay;
                 } else {
                     selectedWay = selWay;           // use another way as selected way
@@ -114,7 +112,7 @@
             if (wayOccurenceCounter.isEmpty()) {
                 showWarningNotification(
-                   trn("The selected node is not in the middle of any way.",
-                       "The selected nodes are not in the middle of any way.",
-                        selectedNodes.size()));
+                        trn("The selected node is not in the middle of any way.",
+                                "The selected nodes are not in the middle of any way.",
+                                selectedNodes.size()));
                 return;
             }
@@ -124,8 +122,8 @@
                     if (selectedWay != null) {
                         showWarningNotification(
-                            trn("There is more than one way using the node you selected. Please select the way also.",
-                                    "There is more than one way using the nodes you selected. Please select the way also.",
-                                    selectedNodes.size())
-                            );
+                                trn("There is more than one way using the node you selected. Please select the way also.",
+                                        "There is more than one way using the nodes you selected. Please select the way also.",
+                                        selectedNodes.size())
+                                );
                         return;
                     }
@@ -150,12 +148,12 @@
             if (!nds.isEmpty()) {
                 showWarningNotification(
-                    trn("The selected way does not contain the selected node.",
-                            "The selected way does not contain all the selected nodes.",
-                            selectedNodes.size()));
+                        trn("The selected way does not contain the selected node.",
+                                "The selected way does not contain all the selected nodes.",
+                                selectedNodes.size()));
                 return;
             }
         } else if (selectedWay != null && selectedNodes.isEmpty()) {
             showWarningNotification(
-                tr("The selected way is not a split way, please select split points or split way too."));
+                    tr("The selected way is not a split way, please select split points or split way too."));
             return;
         }
@@ -183,5 +181,5 @@
                 (nodeIndex2 == 0 && nodeIndex1 == selectedWay.getNodesCount() - 2)) {
             showWarningNotification(
-                tr("The selected nodes can not be consecutive nodes in the object."));
+                    tr("The selected nodes can not be consecutive nodes in the object."));
             return;
         }
@@ -253,8 +251,8 @@
         setEnabled(checkSelection(selection));
     }
-    
+
     void showWarningNotification(String msg) {
         new Notification(msg)
-            .setIcon(JOptionPane.WARNING_MESSAGE).show();
+        .setIcon(JOptionPane.WARNING_MESSAGE).show();
     }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java	(revision 32410)
@@ -1,18 +1,28 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.SplitWayAction;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.command.*;
-import java.util.*;
-import java.awt.event.KeyEvent;
+import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.tools.Shortcut;
-import java.awt.event.ActionEvent;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.gui.Notification;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -28,53 +38,53 @@
         super(TITLE, "dumbutils/splitonintersections", tr("Split adjacent ways on T-intersections"),
                 Shortcut.registerShortcut("tools:splitonintersections", tr("Tool: {0}", tr("Split adjacent ways")),
-                KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT), true);
+                        KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT), true);
     }
 
     @Override
-    public void actionPerformed( ActionEvent e ) {
+    public void actionPerformed(ActionEvent e) {
         List<Command> list = new ArrayList<>();
         List<Way> selectedWays = OsmPrimitive.getFilteredList(getLayerManager().getEditDataSet().getSelected(), Way.class);
         Map<Way, List<Node>> splitWays = new HashMap<>();
 
-        for( Way way : selectedWays ) {
-            if( way.getNodesCount() > 1 && !way.hasIncompleteNodes() && !way.isClosed() )
-            for( Node node : new Node[] {way.getNode(0), way.getNode(way.getNodesCount() - 1)} ) {
-                List<Way> refs = OsmPrimitive.getFilteredList(node.getReferrers(), Way.class);
-                refs.remove(way);
-                if( selectedWays.size() > 1 ) {
-                    // When several ways are selected, split only those among selected
+        for (Way way : selectedWays) {
+            if (way.getNodesCount() > 1 && !way.hasIncompleteNodes() && !way.isClosed())
+                for (Node node : new Node[] {way.getNode(0), way.getNode(way.getNodesCount() - 1)}) {
+                    List<Way> refs = OsmPrimitive.getFilteredList(node.getReferrers(), Way.class);
+                    refs.remove(way);
+                    if (selectedWays.size() > 1) {
+                        // When several ways are selected, split only those among selected
+                        Iterator<Way> it = refs.iterator();
+                        while (it.hasNext()) {
+                            if (!selectedWays.contains(it.next()))
+                                it.remove();
+                        }
+                    }
+
                     Iterator<Way> it = refs.iterator();
                     while (it.hasNext()) {
-                        if(!selectedWays.contains(it.next()))
+                        Way w = it.next();
+                        if (w.isDeleted() || w.isIncomplete() || !w.isInnerNode(node))
                             it.remove();
                     }
+                    if (refs.size() == 1) {
+                        if (splitWays.containsKey(refs.get(0)))
+                            splitWays.get(refs.get(0)).add(node);
+                        else {
+                            List<Node> nodes = new ArrayList<>(1);
+                            nodes.add(node);
+                            splitWays.put(refs.get(0), nodes);
+                        }
+                    } else if (refs.size() > 1) {
+                        new Notification(
+                                tr("There are several ways containing one of the splitting nodes. Select ways participating in this operation.")
+                                ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                        return;
+                    }
                 }
-
-                Iterator<Way> it = refs.iterator();
-                while (it.hasNext()) {
-                    Way w = it.next();
-                    if( w.isDeleted() || w.isIncomplete() || !w.isInnerNode(node) )
-                        it.remove();
-                }
-                if( refs.size() == 1 ) {
-                    if( splitWays.containsKey(refs.get(0)) )
-                        splitWays.get(refs.get(0)).add(node);
-                    else {
-                        List<Node> nodes = new ArrayList<>(1);
-                        nodes.add(node);
-                        splitWays.put(refs.get(0), nodes);
-                    }
-                } else if( refs.size() > 1 ) {
-                    new Notification(
-                        tr("There are several ways containing one of the splitting nodes. Select ways participating in this operation.")
-                        ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
-                    return;
-                }
-            }
         }
 
-        for( Way splitWay : splitWays.keySet() ) {
+        for (Way splitWay : splitWays.keySet()) {
             List<List<Node>> wayChunks = SplitWayAction.buildSplitChunks(splitWay, splitWays.get(splitWay));
-            if( wayChunks != null ) {
+            if (wayChunks != null) {
                 List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size());
                 sel.addAll(selectedWays);
@@ -84,5 +94,5 @@
         }
 
-        if( !list.isEmpty() ) {
+        if (!list.isEmpty()) {
             Main.main.undoRedo.add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list));
             getLayerManager().getEditDataSet().clearSelection();
@@ -96,15 +106,15 @@
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         boolean ok = false;
-        if( selection != null )
-        for( OsmPrimitive p : selection ) {
-            if( p instanceof Way )
-                ok = true;
-            else {
-                ok = false;
-                break;
+        if (selection != null)
+            for (OsmPrimitive p : selection) {
+                if (p instanceof Way)
+                    ok = true;
+                else {
+                    ok = false;
+                    break;
+                }
             }
-        }
         setEnabled(ok);
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java	(revision 32410)
@@ -1,7 +1,7 @@
-// License: GPL. Copyright 2007 by Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 
 import java.awt.event.ActionEvent;
@@ -23,5 +23,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
-
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -32,5 +31,5 @@
  *
  * @author Alexei Kasatkin, based on much copy&Paste from other MirrorAction :)
- */ 
+ */
 public final class SymmetryAction extends JosmAction {
 
@@ -49,32 +48,34 @@
         Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected();
         HashSet<Node> nodes = new HashSet<>();
-        EastNorth p1=null,p2=null;
-        
+        EastNorth p1 = null, p2 = null;
+
         for (OsmPrimitive osm : sel) {
             if (osm instanceof Node) {
-                if (p1==null) p1=((Node)osm).getEastNorth(); else
-                if (p2==null) p2=((Node)osm).getEastNorth(); else
-                nodes.add((Node)osm);
+                if (p1 == null) p1 = ((Node) osm).getEastNorth(); else
+                    if (p2 == null) p2 = ((Node) osm).getEastNorth(); else
+                        nodes.add((Node) osm);
             }
         }
         for (OsmPrimitive osm : sel) {
             if (osm instanceof Way) {
-                nodes.addAll(((Way)osm).getNodes());
+                nodes.addAll(((Way) osm).getNodes());
             }
         }
-        
-        if (p1==null || p2==null || nodes.size() < 1) {
+
+        if (p1 == null || p2 == null || nodes.size() < 1) {
             new Notification(
                     tr("Please select at least two nodes for symmetry axis and something else to mirror.")
-                ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
             return;
         }
 
-        double ne,nn,l,e0,n0;
-        e0=p1.east();        n0=p1.north();
-        ne =  -(p2.north()-p1.north());      nn =  (p2.east()-p1.east());
-        l = Math.hypot(ne,nn);
+        double ne, nn, l, e0, n0;
+        e0 = p1.east();
+        n0 = p1.north();
+        ne = -(p2.north() - p1.north());
+        nn = (p2.east() - p1.east());
+        l = Math.hypot(ne, nn);
         ne /= l; nn /= l; // normal unit vector
-        
+
         Collection<Command> cmds = new LinkedList<>();
 
@@ -83,5 +84,5 @@
             double pr = (c.east()-e0)*ne + (c.north()-n0)*nn;
             //pr=10;
-            cmds.add(new MoveCommand(n, -2*ne*pr, -2*nn*pr ));
+            cmds.add(new MoveCommand(n, -2*ne*pr, -2*nn*pr));
         }
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java	(revision 32410)
@@ -1,15 +1,26 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.command.*;
-import java.util.*;
-import java.awt.event.KeyEvent;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.command.ChangePropertyCommand;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Shortcut;
-import java.awt.event.ActionEvent;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Utils;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -35,6 +46,7 @@
     public TagBufferAction() {
         super(TITLE, "dumbutils/tagbuffer", tr("Pastes tags of previously selected object(s)"),
-                Shortcut.registerShortcut("tools:tagbuffer", tr("Tool: {0}", tr("Copy tags from previous selection")), KeyEvent.VK_R, Shortcut.SHIFT)
-        , true, false);
+                Shortcut.registerShortcut("tools:tagbuffer", tr("Tool: {0}", tr("Copy tags from previous selection")),
+                        KeyEvent.VK_R, Shortcut.SHIFT),
+                true, false);
         // The fields are not initialized while the super constructor is running, so we have to call this afterwards:
         installAdapters();
@@ -42,24 +54,24 @@
 
     @Override
-    public void actionPerformed( ActionEvent e ) {
+    public void actionPerformed(ActionEvent e) {
         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
-        if( selection.isEmpty() )
+        if (selection.isEmpty())
             return;
 
         List<Command> commands = new ArrayList<>();
-        for( String key : tags.keySet() ) {
+        for (String key : tags.keySet()) {
             String value = tags.get(key);
             boolean foundNew = false;
-            for( OsmPrimitive p : selection ) {
-                if( !p.hasKey(key) || !p.get(key).equals(value) ) {
+            for (OsmPrimitive p : selection) {
+                if (!p.hasKey(key) || !p.get(key).equals(value)) {
                     foundNew = true;
                     break;
                 }
             }
-            if( foundNew )
+            if (foundNew)
                 commands.add(new ChangePropertyCommand(selection, key, value));
         }
-        
-        if( !commands.isEmpty() )
+
+        if (!commands.isEmpty())
             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     }
@@ -67,19 +79,19 @@
     @Override
     protected void updateEnabledState() {
-        if( getLayerManager().getEditDataSet() == null ) {
+        if (getLayerManager().getEditDataSet() == null) {
             setEnabled(false);
-            if( selectionBuf != null )
+            if (selectionBuf != null)
                 selectionBuf.clear();
-        }  else
+        } else
             updateEnabledState(getLayerManager().getEditDataSet().getSelected());
     }
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         // selection changed => check if selection is completely different from before
         boolean foundOld = false;
-        if( selection != null ) {
-            for( OsmPrimitive p : selectionBuf ) {
-                if( selection.contains(p) ) {
+        if (selection != null) {
+            for (OsmPrimitive p : selectionBuf) {
+                if (selection.contains(p)) {
                     foundOld = true;
                     break;
@@ -92,10 +104,10 @@
             selectionBuf.clear();
         }
-        if( !foundOld ) {
+        if (!foundOld) {
             // selection has completely changed, remember tags
             tags.clear();
             tags.putAll(currentTags);
         }
-        if( getLayerManager().getEditDataSet() != null)
+        if (getLayerManager().getEditDataSet() != null)
             rememberSelectionTags();
 
@@ -105,23 +117,28 @@
     private void rememberSelectionTags() {
         // Fix #8350 - only care about tagged objects
-        final Collection<OsmPrimitive> selectedTaggedObjects = Utils.filter(getLayerManager().getEditDataSet().getSelected(), IS_TAGGED_PREDICATE);
-        if( !selectedTaggedObjects.isEmpty() ) {
+        final Collection<OsmPrimitive> selectedTaggedObjects = Utils.filter(
+                getLayerManager().getEditDataSet().getSelected(), IS_TAGGED_PREDICATE);
+        if (!selectedTaggedObjects.isEmpty()) {
             currentTags.clear();
             Set<String> bad = new HashSet<>();
-            for( OsmPrimitive p : selectedTaggedObjects ) {
-                if( currentTags.isEmpty() ) {
-                    for( String key : p.keySet() )
+            for (OsmPrimitive p : selectedTaggedObjects) {
+                if (currentTags.isEmpty()) {
+                    for (String key : p.keySet()) {
                         currentTags.put(key, p.get(key));
+                    }
                 } else {
-                    for( String key : p.keySet() )
-                        if( !currentTags.containsKey(key) || !currentTags.get(key).equals(p.get(key)) )
+                    for (String key : p.keySet()) {
+                        if (!currentTags.containsKey(key) || !currentTags.get(key).equals(p.get(key)))
                             bad.add(key);
-                    for( String key : currentTags.keySet() )
-                        if( !p.hasKey(key) )
+                    }
+                    for (String key : currentTags.keySet()) {
+                        if (!p.hasKey(key))
                             bad.add(key);
+                    }
                 }
             }
-            for( String key : bad )
+            for (String key : bad) {
                 currentTags.remove(key);
+            }
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java	(revision 32410)
@@ -1,13 +1,18 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.command.*;
-import java.util.*;
-import java.awt.event.KeyEvent;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.command.ChangePropertyCommand;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Shortcut;
-import java.awt.event.ActionEvent;
-import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -24,6 +29,6 @@
     public TagSourceAction() {
         super(TITLE, "dumbutils/sourcetag", tr("Add remembered source tag"),
-                Shortcut.registerShortcut("tools:sourcetag", tr("Tool: {0}", tr("Add Source Tag")), KeyEvent.VK_S, Shortcut.ALT_CTRL)
-                , true, false);
+                Shortcut.registerShortcut("tools:sourcetag", tr("Tool: {0}", tr("Add Source Tag")), KeyEvent.VK_S, Shortcut.ALT_CTRL),
+                true, false);
         source = Main.pref.get("sourcetag.value");
         // The fields are not initialized while the super constructor is running, so we have to call this afterwards:
@@ -32,7 +37,7 @@
 
     @Override
-    public void actionPerformed( ActionEvent e ) {
+    public void actionPerformed(ActionEvent e) {
         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
-        if( selection.isEmpty() || source == null || source.length() == 0 )
+        if (selection.isEmpty() || source == null || source.length() == 0)
             return;
 
@@ -42,15 +47,15 @@
     @Override
     protected void updateEnabledState() {
-        if( getLayerManager().getEditDataSet() == null ) {
+        if (getLayerManager().getEditDataSet() == null) {
             setEnabled(false);
-            if( selectionBuf != null )
+            if (selectionBuf != null)
                 selectionBuf.clear();
-        }  else
+        } else
             updateEnabledState(getLayerManager().getEditDataSet().getSelected());
     }
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
-        if( selection == null || selection.isEmpty() ) {
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
+        if (selection == null || selection.isEmpty()) {
             selectionBuf.clear();
             clickedTwice = false;
@@ -59,20 +64,20 @@
         }
 
-        if( selectionBuf.size() == selection.size() && selectionBuf.containsAll(selection) ) {
-            if( !clickedTwice )
+        if (selectionBuf.size() == selection.size() && selectionBuf.containsAll(selection)) {
+            if (!clickedTwice)
                 clickedTwice = true;
             else {
                 // tags may have been changed, get the source
                 String newSource = null;
-                for( OsmPrimitive p : selection ) {
+                for (OsmPrimitive p : selection) {
                     String value = p.get("source");
-                    if( value != null && newSource == null )
+                    if (value != null && newSource == null)
                         newSource = value;
-                    else if( value != null ? !value.equals(newSource) : newSource != null ) {
+                    else if (value != null ? !value.equals(newSource) : newSource != null) {
                         newSource = "";
                         break;
                     }
                 }
-                if( newSource != null && newSource.length() > 0 && !newSource.equals(source) ) {
+                if (newSource != null && newSource.length() > 0 && !newSource.equals(source)) {
                     source = newSource;
                     Main.pref.put("sourcetag.value", source);
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java	(revision 32410)
@@ -1,4 +1,3 @@
-// License: GPL v2 or later. Copyright 2010 by Kalle Lampila and others
-// See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.actions;
 
@@ -39,5 +38,6 @@
     public UnGlueRelationAction() {
         super(tr("UnGlue Relation"), "ungluerelations", tr("Duplicate nodes, ways and relations that are used by multiple relations."),
-              Shortcut.registerShortcut("tools:ungluerelation", tr("Tool: {0}", tr("UnGlue Relations")), KeyEvent.VK_G, Shortcut.ALT_SHIFT ), true);
+                Shortcut.registerShortcut("tools:ungluerelation", tr("Tool: {0}", tr("UnGlue Relations")), KeyEvent.VK_G, Shortcut.ALT_SHIFT),
+                true);
         putValue("help", ht("/Action/UnGlueRelation"));
     }
@@ -62,9 +62,9 @@
                     OsmPrimitive newp;
                     switch(p.getType()) {
-                    case NODE: newp = new Node((Node)p, true); break;
-                    case WAY: newp = new Way((Way)p, true); break;
-                    case RELATION: newp = new Relation((Relation)p, true); break;
+                    case NODE: newp = new Node((Node) p, true); break;
+                    case WAY: newp = new Way((Way) p, true); break;
+                    case RELATION: newp = new Relation((Relation) p, true); break;
                     default: throw new AssertionError();
-                    }                    
+                    }
                     newPrimitives.add(newp);
                     cmds.add(new AddCommand(newp));
@@ -76,8 +76,7 @@
         }
 
-        if (newPrimitives.isEmpty() ) {
+        if (newPrimitives.isEmpty()) {
             // error message nothing to do
-        }
-        else {
+        } else {
             Main.main.undoRedo.add(new SequenceCommand(tr("Unglued Relations"), cmds));
             //Set selection all primiteves (new and old)
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/command/ChangeRelationMemberCommand.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/command/ChangeRelationMemberCommand.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/command/ChangeRelationMemberCommand.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL v2 or later. See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.command;
 
@@ -44,5 +44,5 @@
         relation.setMembers(newrms);
     }
-    
+
     @Override
     public boolean executeCommand() {
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Ole Jørgen Brønner
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.curves;
 
@@ -21,5 +21,10 @@
 import org.openstreetmap.josm.data.osm.Way;
 
-public class CircleArcMaker {
+public final class CircleArcMaker {
+
+    private CircleArcMaker() {
+        // Hide default constructor for utilities classes
+    }
+
     public static Collection<Command> doCircleArc(List<Node> selectedNodes, List<Way> selectedWays, int angleSeparation) {
         Collection<Command> cmds = new LinkedList<>();
@@ -95,5 +100,5 @@
             }
             // Fix #7341. Find the first way having all nodes in common to sort them in its nodes order
-            List<Node> consideredNodes = Arrays.asList(new Node[]{n1,n2,n3});
+            List<Node> consideredNodes = Arrays.asList(new Node[]{n1, n2, n3});
             for (Way w : selectedWays) {
                 final List<Node> nodes = w.getNodes();
@@ -111,5 +116,5 @@
                 }
             }
-            
+
             for (Node n : consideredNodes) {
                 targetWays.addAll(OsmPrimitive.getFilteredList(n.getReferrers(), Way.class));
@@ -133,24 +138,21 @@
         List<Node> arcNodes = new ArrayList<>(points.size());
         arcNodes.add(n1);
-        {
-            int i = 1;
-            for (EastNorth p : slice(points, 1, -2)) {
-                //            if (p == p2) {
-                if (i == p2Index.value) {
-                    Node n2new = new Node(n2);
-                    n2new.setEastNorth(p);
-                    arcNodes.add(n2); // add the original n2, or else we can't find it in the target ways
-                    cmds.add(new ChangeCommand(n2, n2new));
-                } else {
-                    Node n = new Node(p);
-                    arcNodes.add(n);
-                    cmds.add(new AddCommand(n));
-                }
-                i++;
-            }
+        int i = 1;
+        for (EastNorth p : slice(points, 1, -2)) {
+            if (i == p2Index.value) {
+                Node n2new = new Node(n2);
+                n2new.setEastNorth(p);
+                arcNodes.add(n2); // add the original n2, or else we can't find it in the target ways
+                cmds.add(new ChangeCommand(n2, n2new));
+            } else {
+                Node n = new Node(p);
+                arcNodes.add(n);
+                cmds.add(new AddCommand(n));
+            }
+            i++;
         }
         arcNodes.add(n3);
 
-        Node[] anchorNodes = { n1, n2, n3 };
+        Node[] anchorNodes = {n1, n2, n3};
         //// "Fuse" the arc with all target ways
         fuseArc(anchorNodes, arcNodes, targetWays, cmds);
@@ -359,4 +361,5 @@
         return a;
     }
+
     public static class ReturnValue<T> {
         public T value;
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Ole Jørgen Brønner
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.curves;
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java	(revision 32410)
@@ -1,25 +1,29 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.customurl;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
 import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
 import java.util.List;
-import javax.swing.JPanel;
-import javax.swing.event.ListSelectionEvent;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.Main;
-import java.awt.event.ActionEvent;
+
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
 import javax.swing.JList;
+import javax.swing.JPanel;
 import javax.swing.JTextField;
 import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import static org.openstreetmap.josm.tools.I18n.tr;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.tools.GBC;
 
 public class ChooseURLAction extends JosmAction {
 
     public ChooseURLAction() {
-        super(tr("Select custom URL"), "selecturl", tr("Select custom URL"),null,true,true);
+        super(tr("Select custom URL"), "selecturl", tr("Select custom URL"), null, true, true);
     }
 
@@ -33,59 +37,56 @@
         setEnabled(getLayerManager().getEditDataSet() != null);
     }
-        
+
     public static void showConfigDialog(final boolean fast) {
         JPanel all = new JPanel(new GridBagLayout());
-        
+
         List<String> items = URLList.getURLList();
         String addr = URLList.getSelectedURL();
-        int n=items.size()/2 , idxToSelect=-1;
-        final String names[] =new String[n];
-        final String vals[] =new String[n];
-        for (int i=0;i<n;i++) {
-            names[i]=items.get(i*2);
-            vals[i]=items.get(i*2+1);
-            if (vals[i].equals(addr)) idxToSelect=i; 
+        int n = items.size()/2, idxToSelect = -1;
+        final String[] names = new String[n];
+        final String[] vals = new String[n];
+        for (int i = 0; i < n; i++) {
+            names[i] = items.get(i*2);
+            vals[i] = items.get(i*2+1);
+            if (vals[i].equals(addr)) idxToSelect = i;
         }
-        final JLabel label1=new JLabel(tr("Please select one of custom URLs (configured in Preferences)"));
-        final JList<String> list1=new JList<>(names);
-        final JTextField editField=new JTextField();
-        final JCheckBox check1=new JCheckBox(tr("Ask every time"));
-        
+        final JLabel label1 = new JLabel(tr("Please select one of custom URLs (configured in Preferences)"));
+        final JList<String> list1 = new JList<>(names);
+        final JTextField editField = new JTextField();
+        final JCheckBox check1 = new JCheckBox(tr("Ask every time"));
+
         final ExtendedDialog dialog = new ExtendedDialog(Main.parent,
                 tr("Configure custom URL"),
-                new String[] {tr("OK"),tr("Cancel"),}
-        );
+                new String[] {tr("OK"), tr("Cancel")}
+                );
         list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         list1.addListSelectionListener(new ListSelectionListener() {
             @Override
             public void valueChanged(ListSelectionEvent e) {
-                int idx=list1.getSelectedIndex();
-                if (idx>=0) editField.setText(vals[idx]);
+                int idx = list1.getSelectedIndex();
+                if (idx >= 0) editField.setText(vals[idx]);
             }
         });
         list1.setSelectedIndex(idxToSelect);
-        check1.setSelected(Main.pref.getBoolean("utilsplugin2.askurl",false));
-        
+        check1.setSelected(Main.pref.getBoolean("utilsplugin2.askurl", false));
+
         editField.setEditable(false);
-        
-        all.add(label1,GBC.eop().fill(GBC.HORIZONTAL).insets(15,5,15,0));
-        all.add(list1,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
-        all.add(editField,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
-        all.add(check1,GBC.eop().fill(GBC.HORIZONTAL).insets(5,5,0,0));
-        
-        
+
+        all.add(label1, GBC.eop().fill(GBC.HORIZONTAL).insets(15, 5, 15, 0));
+        all.add(list1, GBC.eop().fill(GBC.HORIZONTAL).insets(5, 5, 0, 0));
+        all.add(editField, GBC.eop().fill(GBC.HORIZONTAL).insets(5, 5, 0, 0));
+        all.add(check1, GBC.eop().fill(GBC.HORIZONTAL).insets(5, 5, 0, 0));
+
+
         dialog.setContent(all, false);
-        dialog.setButtonIcons(new String[] {"ok.png","cancel.png",});
+        dialog.setButtonIcons(new String[] {"ok.png", "cancel.png"});
         dialog.setDefaultButton(1);
         dialog.showDialog();
-        
+
         int idx = list1.getSelectedIndex();
-        if (dialog.getValue() ==1 && idx>=0) {
-           URLList.select(vals[idx]);
-           Main.pref.put("utilsplugin2.askurl", check1.isSelected());
+        if (dialog.getValue() == 1 && idx >= 0) {
+            URLList.select(vals[idx]);
+            Main.pref.put("utilsplugin2.askurl", check1.isSelected());
         }
     }
-
-    
-    
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java	(revision 32410)
@@ -1,16 +1,14 @@
-// License: GPL. Copyright 2007 by Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.customurl;
 
-import java.io.UnsupportedEncodingException;
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.Collection;
-
 import java.util.regex.Matcher;
-
 import java.util.regex.Pattern;
 
@@ -30,12 +28,12 @@
  *
  * @author Alexei Kasatkin, based on much copy&Paste from other MirrorAction :)
- */ 
+ */
 public final class OpenPageAction extends JosmAction {
-    
+
     public OpenPageAction() {
         super(tr("Open custom URL"), "openurl",
                 tr("Opens specified URL browser"),
                 Shortcut.registerShortcut("tools:openurl", tr("Tool: {0}", tr("Open custom URL")),
-                KeyEvent.VK_H, Shortcut.SHIFT), true);
+                        KeyEvent.VK_H, Shortcut.SHIFT), true);
         putValue("help", ht("/Action/OpenPage"));
     }
@@ -44,53 +42,50 @@
     public void actionPerformed(ActionEvent e) {
         Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected();
-        OsmPrimitive p=null;
-        if (sel.size()>=1) {
-            p=sel.iterator().next();
+        OsmPrimitive p = null;
+        if (sel.size() >= 1) {
+            p = sel.iterator().next();
         }
-        
-        if (Main.pref.getBoolean("utilsplugin2.askurl",false)==true) 
+
+        if (Main.pref.getBoolean("utilsplugin2.askurl", false) == true)
             ChooseURLAction.showConfigDialog(true);
-        
-        //lat = p.getBBox().getTopLeft().lat();
-        //lon = p.getBBox().getTopLeft().lon();
+
         LatLon center = Main.map.mapView.getLatLon(Main.map.mapView.getWidth()/2, Main.map.mapView.getHeight()/2);
-                
-        String addr =  URLList.getSelectedURL();
+
+        String addr = URLList.getSelectedURL();
         Pattern pat = Pattern.compile("\\{([^\\}]*)\\}");
         Matcher m = pat.matcher(addr);
-        String val,key;
-        String keys[]=new String[100],vals[]=new String[100];
-        int i=0;
+        String val, key;
+        String[] keys = new String[100], vals = new String[100];
+        int i = 0;
         try {
-        while (m.find()) {
-            key=m.group(1); val=null;                
-            if (key.equals("#id")) {
-                if (p!=null) val=Long.toString(p.getId());
-            } else if (key.equals("#type")) {
-                if (p!=null) val = OsmPrimitiveType.from(p).getAPIName();
-            } else if (key.equals("#lat")) {
-                val = Double.toString(center.lat());
-            } else if (key.equals("#lon")) {
-                val = Double.toString(center.lon());
-            } else if (key.equals("#zoom")) {
-                val = Integer.toString(OsmUrlToBounds.getZoom(Main.map.mapView.getRealBounds()));
+            while (m.find()) {
+                key = m.group(1); val = null;
+                if (key.equals("#id")) {
+                    if (p != null) val = Long.toString(p.getId());
+                } else if (key.equals("#type")) {
+                    if (p != null) val = OsmPrimitiveType.from(p).getAPIName();
+                } else if (key.equals("#lat")) {
+                    val = Double.toString(center.lat());
+                } else if (key.equals("#lon")) {
+                    val = Double.toString(center.lon());
+                } else if (key.equals("#zoom")) {
+                    val = Integer.toString(OsmUrlToBounds.getZoom(Main.map.mapView.getRealBounds()));
+                } else {
+                    if (p != null) {
+                        val = p.get(key);
+                        if (val != null) val = URLEncoder.encode(p.get(key), "UTF-8"); else return;
+                    }
+                }
+                keys[i] = m.group();
+                if (val != null) vals[i] = val;
+                else vals[i] = "";
+                i++;
             }
-            else {
-                if (p!=null) {
-                    val =p.get(key);
-                    if (val!=null) val =URLEncoder.encode(p.get(key), "UTF-8"); else return;
-                }
-            }
-            keys[i]=m.group();
-            if  (val!=null) vals[i]=val;
-            else vals[i]="";
-            i++;
-        }
         } catch (UnsupportedEncodingException ex) {
             Main.error(ex, "Encoding error");
             return;
         }
-        for (int j=0;j<i;j++){
-            addr = addr.replace(keys[j],vals[j]);
+        for (int j = 0; j < i; j++) {
+            addr = addr.replace(keys[j], vals[j]);
         }
         try {
@@ -99,8 +94,4 @@
             Main.error(ex, "Can not open URL " + addr);
         }
-        //Collection<Command> cmds = new LinkedList<Command>();
-
-        //cmds.add(new MoveCommand(n, -2*ne*pr, -2*nn*pr ));
-        //Main.main.undoRedo.add(new SequenceCommand(tr("Symmetry"), cmds));
     }
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.customurl;
 
@@ -14,6 +15,10 @@
 import org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2;
 
-public class URLList {
+public final class URLList {
     public static final String defaultURL = "http://osm.mapki.com/history/{#type}.php?id={#id}";
+
+    private URLList() {
+        // Hide default constructor for utilities classes
+    }
 
     public static String getSelectedURL() {
@@ -21,9 +26,11 @@
         return Main.pref.get("utilsplugin2.customurl", defaultURL);
     }
+
     public static void select(String url) {
-        Main.pref.put("utilsplugin2.customurl",url);
+        Main.pref.put("utilsplugin2.customurl", url);
     }
+
     public static List<String> resetURLList() {
-        List<String> items=new ArrayList<>();
+        List<String> items = new ArrayList<>();
         items.add("Wikipedia");
         items.add("https://en.wikipedia.org/w/index.php?search={name}&fulltext=Search");
@@ -38,6 +45,6 @@
         items.add("Browse element [demo, =Ctrl-Shift-I]");
         items.add("https://www.openstreetmap.org/{#type}/{#id}");
-        Main.pref.putCollection("utilsplugin2.urlHistory",items);
-        Main.pref.put("utilsplugin2.customurl",items.get(9));
+        Main.pref.putCollection("utilsplugin2.urlHistory", items);
+        Main.pref.put("utilsplugin2.customurl", items.get(9));
         return items;
     }
@@ -45,7 +52,7 @@
     public static List<String> getURLList() {
         List<String> items = (List<String>) Main.pref.getCollection("utilsplugin2.urlHistory");
-        if (items==null || items.isEmpty()) {
+        if (items == null || items.isEmpty()) {
             resetURLList();
-            items=(List<String>) Main.pref.getCollection("utilsplugin2.urlHistory");
+            items = (List<String>) Main.pref.getCollection("utilsplugin2.urlHistory");
         }
         return items;
@@ -53,5 +60,5 @@
 
     public static void updateURLList(List<String> lst) {
-        Main.pref.putCollection("utilsplugin2.urlHistory",lst);
+        Main.pref.putCollection("utilsplugin2.urlHistory", lst);
         try {
             Main.pref.save();
@@ -62,15 +69,20 @@
 
     public static List<String> loadURLList() {
-        ArrayList<String> items=new ArrayList<>();
-        BufferedReader fr=null;
+        ArrayList<String> items = new ArrayList<>();
+        BufferedReader fr = null;
         try {
-	        File f = new File(UtilsPlugin2.getInstance().getPluginDir(), "customurl.txt");
-	        fr = new BufferedReader(new FileReader(f));
-	        String s;
-	        while ((s = fr.readLine()) !=null ) items.add(s);
+            File f = new File(UtilsPlugin2.getInstance().getPluginDir(), "customurl.txt");
+            fr = new BufferedReader(new FileReader(f));
+            String s;
+            while ((s = fr.readLine()) != null) items.add(s);
         } catch (IOException e) {
             e.printStackTrace();
         } finally {
-            try { if (fr!=null) fr.close(); } catch (Exception e) {}
+            try {
+                if (fr != null)
+                    fr.close();
+            } catch (Exception e) {
+                Main.warn(e);
+            }
         }
         return items;
@@ -79,15 +91,20 @@
     public static void saveURLList(List<String> items) {
         File f = new File(UtilsPlugin2.getInstance().getPluginDir(), "customurl.txt");
-        PrintWriter fw=null;
+        PrintWriter fw = null;
         try {
             f.getParentFile().mkdirs();
-	        fw=new PrintWriter(f);
-	        for (String s : items) {
-	            fw.println(s);
-	        }
+            fw = new PrintWriter(f);
+            for (String s : items) {
+                fw.println(s);
+            }
         } catch (IOException e) {
             e.printStackTrace();
         } finally {
-            try { if (fw!=null) fw.close(); } catch (Exception e) {}
+            try {
+                if (fw != null)
+                    fw.close();
+            } catch (Exception e) {
+                Main.warn(e);
+            }
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java	(revision 32410)
@@ -2,28 +2,30 @@
 package org.openstreetmap.josm.plugins.utilsplugin2.customurl;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.swing.JButton;
-import java.util.List;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
 import javax.swing.table.TableModel;
-import javax.swing.JTable;
-import javax.swing.JLabel;
-import java.awt.GridBagLayout;
-import java.util.ArrayList;
-import javax.swing.event.TableModelEvent;
+
+import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
+import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import java.awt.event.ActionListener;
-import javax.swing.JPanel;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
-import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
 import org.openstreetmap.josm.tools.GBC;
 
-import static org.openstreetmap.josm.tools.I18n.*;
-
 public class UtilsPluginPreferences extends DefaultTabPreferenceSetting {
-    HistoryComboBox combo1=new HistoryComboBox();
+    HistoryComboBox combo1 = new HistoryComboBox();
     JTable table;
     JButton resetButton;
@@ -40,5 +42,5 @@
 
         URLList.getSelectedURL();
-        table=new JTable(new DefaultTableModel(null,new String[]{"Title","URL"}));
+        table = new JTable(new DefaultTableModel(null, new String[]{"Title", "URL"}));
 
         List<String> items = URLList.getURLList();
@@ -77,9 +79,9 @@
                 + " Your can manually load settings from file <b>customurl.txt</b> in JOSM folder"));
 
-        all.add(new JLabel(tr("Custom URL configuration")),GBC.std().insets(5,10,0,0));
-        all.add(resetButton,GBC.std().insets(25,10,0,0));
-        all.add(loadButton,GBC.std().insets(25,10,0,0));
-        all.add(saveButton,GBC.eol().insets(25,10,0,0));
-        all.add(help,GBC.eop().insets(5,10,0,0));
+        all.add(new JLabel(tr("Custom URL configuration")), GBC.std().insets(5, 10, 0, 0));
+        all.add(resetButton, GBC.std().insets(25, 10, 0, 0));
+        all.add(loadButton, GBC.std().insets(25, 10, 0, 0));
+        all.add(saveButton, GBC.eol().insets(25, 10, 0, 0));
+        all.add(help, GBC.eop().insets(5, 10, 0, 0));
 
         table.getColumnModel().getColumn(0).setPreferredWidth(150);
@@ -92,32 +94,32 @@
                 int row = e.getFirstRow();
                 int column = e.getColumn();
-                DefaultTableModel model = (DefaultTableModel)(e.getSource());
-                if (row<0  || column<0) return;
-                String data = (String)model.getValueAt(row, column);
-                if (data!=null && data.length()>0 && row==model.getRowCount()-1)
-                    model.addRow(new String[]{"",""});
+                DefaultTableModel model = (DefaultTableModel) e.getSource();
+                if (row < 0 || column < 0) return;
+                String data = (String) model.getValueAt(row, column);
+                if (data != null && data.length() > 0 && row == model.getRowCount()-1)
+                    model.addRow(new String[]{"", ""});
             }
         });
-        all.add(table,GBC.eop().fill());
+        all.add(table, GBC.eop().fill());
         createPreferenceTabWithScrollPane(gui, all);
     }
 
     private void fillRows(List<String> items) {
-        if (items==null) return;
-        int p=0;
+        if (items == null) return;
+        int p = 0;
         String name, url;
         DefaultTableModel model = (DefaultTableModel) table.getModel();
         model.setRowCount(0);
-        int n=items.size();
+        int n = items.size();
         while (true) {
-            if (p>=n) break;
+            if (p >= n) break;
             name = items.get(p);
             p++;
-            if (p>=n) break;
+            if (p >= n) break;
             url = items.get(p);
             p++;
-            model.addRow(new String[]{name,url});
+            model.addRow(new String[]{name, url});
         }
-        model.addRow(new String[]{"",""});
+        model.addRow(new String[]{"", ""});
     }
 
@@ -134,16 +136,16 @@
         TableModel model = (table.getModel());
         String v;
-        ArrayList<String> lst=new ArrayList<>();
-        int n=model.getRowCount();
-        for (int i=0;i<n;i++) {
-            v=(String) model.getValueAt(i, 0);
-            if (v.length()==0) continue;
+        ArrayList<String> lst = new ArrayList<>();
+        int n = model.getRowCount();
+        for (int i = 0; i < n; i++) {
+            v = (String) model.getValueAt(i, 0);
+            if (v.length() == 0) continue;
             lst.add(v);
-            v=(String) model.getValueAt(i, 1);
+            v = (String) model.getValueAt(i, 1);
             lst.add(v);
         }
-        int row=table.getSelectedRow();
-        if (row!=-1) {
-            v=(String) model.getValueAt(row, 1);
+        int row = table.getSelectedRow();
+        if (row != -1) {
+            v = (String) model.getValueAt(row, 1);
             URLList.select(v);
         }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2007 by Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.latlon;
 
@@ -7,17 +7,16 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-
 import java.util.Collection;
 import java.util.LinkedList;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.command.AddCommand;
+import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.actions.JosmAction;
 
 /**
@@ -47,5 +46,5 @@
 
         dialog.showDialog();
-        
+
         if (dialog.getValue() != 1)
             return;
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java	(revision 32410)
@@ -18,14 +18,12 @@
 
 import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
 import javax.swing.JSeparator;
 import javax.swing.JTabbedPane;
-
 import javax.swing.JTextArea;
-import javax.swing.JScrollPane;
-import javax.swing.ButtonGroup;
-import javax.swing.JRadioButton;
-
 import javax.swing.UIManager;
 import javax.swing.event.ChangeEvent;
@@ -43,5 +41,5 @@
 
 public class LatLonDialog extends ExtendedDialog {
-    private static final Color BG_COLOR_ERROR = new Color(255,224,224);
+    private static final Color BG_COLOR_ERROR = new Color(255, 224, 224);
 
     public JTabbedPane tabs;
@@ -78,65 +76,63 @@
     protected JPanel buildLatLon() {
         JPanel pnl = new JPanel(new GridBagLayout());
-        pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-
-        pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0));
-
-        taLatLon = new JTextArea(5,24);
+        pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+        pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0, 10, 5, 0));
+
+        taLatLon = new JTextArea(5, 24);
         taLatLon.getDocument().addDocumentListener(new CoordinateListener());
-	spScroll = new JScrollPane(taLatLon);
-        pnl.add(spScroll, GBC.eol().insets(0,10,0,0).fill().weight(2.0, 2.0));
-
-	//Radio button setup
-	bgType = new ButtonGroup();
-
-	rbNodes = new JRadioButton("Nodes", true);
-	rbNodes.setActionCommand("nodes");
-	bgType.add(rbNodes);
-	pnl.add(rbNodes);
-
-	rbWay = new JRadioButton("Way");
-	rbWay.setActionCommand("way");
-	bgType.add(rbWay);
-	pnl.add(rbWay);
-
-	rbClosedWay = new JRadioButton("Closed Way (Area)");
-	rbClosedWay.setActionCommand("area");
-	bgType.add(rbClosedWay);
-	pnl.add(rbClosedWay, GBC.eol());
-
-        //pnl.add(bgType, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(2.0, 0.0));
-	//pnl.add(new JRadioButton("test"));
-	//pnl.add(bgType);
-
-        pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5));
+        spScroll = new JScrollPane(taLatLon);
+        pnl.add(spScroll, GBC.eol().insets(0, 10, 0, 0).fill().weight(2.0, 2.0));
+
+        //Radio button setup
+        bgType = new ButtonGroup();
+
+        rbNodes = new JRadioButton("Nodes", true);
+        rbNodes.setActionCommand("nodes");
+        bgType.add(rbNodes);
+        pnl.add(rbNodes);
+
+        rbWay = new JRadioButton("Way");
+        rbWay.setActionCommand("way");
+        bgType.add(rbWay);
+        pnl.add(rbWay);
+
+        rbClosedWay = new JRadioButton("Closed Way (Area)");
+        rbClosedWay.setActionCommand("area");
+        bgType.add(rbClosedWay);
+        pnl.add(rbClosedWay, GBC.eol());
+
+        pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0, 5, 0, 5));
 
         pnl.add(new HtmlPanel(
-                tr("Enter the coordinates for the new nodes, one for each line.<br/>If you enter two lines with the same coordinates there will be generated duplicate nodes.<br/>You can separate longitude and latitude with space, comma or semicolon.<br/>" +
-                    "Use positive numbers or N, E characters to indicate North or East cardinal direction.<br/>" +
-                    "For South and West cardinal directions you can use either negative numbers or S, W characters.<br/>" +
-                    "Coordinate value can be in one of three formats:<ul>" +
-                    "<li><i>degrees</i><tt>&deg;</tt></li>" +
-                    "<li><i>degrees</i><tt>&deg;</tt> <i>minutes</i><tt>&#39;</tt></li>" +
-                    "<li><i>degrees</i><tt>&deg;</tt> <i>minutes</i><tt>&#39;</tt> <i>seconds</i><tt>&quot</tt></li>" +
-                    "</ul>" +
-                    "Symbols <tt>&deg;</tt>, <tt>&#39;</tt>, <tt>&prime;</tt>, <tt>&quot;</tt>, <tt>&Prime;</tt> are optional.<br/><br/>" +
-                    "Some examples:<ul>" +
-                    "<li>49.29918&deg; 19.24788&deg;</li>" +
-                    "<li>N 49.29918 E 19.24788</li>" +
-                    "<li>W 49&deg;29.918&#39; S 19&deg;24.788&#39;</li>" +
-                    "<li>N 49&deg;29&#39;04&quot; E 19&deg;24&#39;43&quot;</li>" +
-                    "<li>49.29918 N, 19.24788 E</li>" +
-                    "<li>49&deg;29&#39;21&quot; N 19&deg;24&#39;38&quot; E</li>" +
-                    "<li>49 29 51, 19 24 18</li>" +
-                    "<li>49 29, 19 24</li>" +
-                    "<li>E 49 29, N 19 24</li>" +
-                    "<li>49&deg; 29; 19&deg; 24</li>" +
-                    "<li>N 49&deg; 29, W 19&deg; 24</li>" +
-                    "<li>49&deg; 29.5 S, 19&deg; 24.6 E</li>" +
-                    "<li>N 49 29.918 E 19 15.88</li>" +
-                    "<li>49 29.4 19 24.5</li>" +
-                    "<li>-49 29.4 N -19 24.5 W</li></ul>" +
-                    "<li>48 deg 42&#39; 52.13\" N, 21 deg 11&#39; 47.60\" E</li></ul>"
-                )),
+                tr("Enter the coordinates for the new nodes, one for each line.<br/>"+
+                        "If you enter two lines with the same coordinates there will be generated duplicate nodes.<br/>"+
+                        "You can separate longitude and latitude with space, comma or semicolon.<br/>" +
+                        "Use positive numbers or N, E characters to indicate North or East cardinal direction.<br/>" +
+                        "For South and West cardinal directions you can use either negative numbers or S, W characters.<br/>" +
+                        "Coordinate value can be in one of three formats:<ul>" +
+                        "<li><i>degrees</i><tt>&deg;</tt></li>" +
+                        "<li><i>degrees</i><tt>&deg;</tt> <i>minutes</i><tt>&#39;</tt></li>" +
+                        "<li><i>degrees</i><tt>&deg;</tt> <i>minutes</i><tt>&#39;</tt> <i>seconds</i><tt>&quot</tt></li>" +
+                        "</ul>" +
+                        "Symbols <tt>&deg;</tt>, <tt>&#39;</tt>, <tt>&prime;</tt>, <tt>&quot;</tt>, <tt>&Prime;</tt> are optional.<br/><br/>" +
+                        "Some examples:<ul>" +
+                        "<li>49.29918&deg; 19.24788&deg;</li>" +
+                        "<li>N 49.29918 E 19.24788</li>" +
+                        "<li>W 49&deg;29.918&#39; S 19&deg;24.788&#39;</li>" +
+                        "<li>N 49&deg;29&#39;04&quot; E 19&deg;24&#39;43&quot;</li>" +
+                        "<li>49.29918 N, 19.24788 E</li>" +
+                        "<li>49&deg;29&#39;21&quot; N 19&deg;24&#39;38&quot; E</li>" +
+                        "<li>49 29 51, 19 24 18</li>" +
+                        "<li>49 29, 19 24</li>" +
+                        "<li>E 49 29, N 19 24</li>" +
+                        "<li>49&deg; 29; 19&deg; 24</li>" +
+                        "<li>N 49&deg; 29, W 19&deg; 24</li>" +
+                        "<li>49&deg; 29.5 S, 19&deg; 24.6 E</li>" +
+                        "<li>N 49 29.918 E 19 15.88</li>" +
+                        "<li>49 29.4 19 24.5</li>" +
+                        "<li>-49 29.4 N -19 24.5 W</li></ul>" +
+                        "<li>48 deg 42&#39; 52.13\" N, 21 deg 11&#39; 47.60\" E</li></ul>"
+                        )),
                 GBC.eol().fill().weight(1.0, 1.0));
 
@@ -160,6 +156,6 @@
             public void stateChanged(ChangeEvent e) {
                 switch (tabs.getModel().getSelectedIndex()) {
-                    case 0: parseLatLonUserInput(); break;
-                    default: throw new AssertionError();
+                case 0: parseLatLonUserInput(); break;
+                default: throw new AssertionError();
                 }
             }
@@ -169,6 +165,6 @@
 
     public LatLonDialog(Component parent, String title, String help) {
-        super(Main.parent, tr("Add Node..."), new String[] { tr("Ok"), tr("Cancel") });
-        setButtonIcons(new String[] { "ok", "cancel" });
+        super(Main.parent, tr("Add Node..."), new String[] {tr("Ok"), tr("Cancel")});
+        setButtonIcons(new String[] {"ok", "cancel"});
         configureContextsensitiveHelp("/Action/AddNode", true);
 
@@ -182,7 +178,8 @@
         }
         this.latLonCoordinates = ll;
-    String text = "";
-    for (LatLon latlon : ll) {
-            text = text + latlon.latToString(CoordinateFormat.getDefaultFormat()) + " " + latlon.lonToString(CoordinateFormat.getDefaultFormat()) + "\n";
+        String text = "";
+        for (LatLon latlon : ll) {
+            text = text + latlon.latToString(CoordinateFormat.getDefaultFormat())
+            + " " + latlon.lonToString(CoordinateFormat.getDefaultFormat()) + "\n";
         }
         taLatLon.setText(text);
@@ -224,8 +221,8 @@
         //
         NumberFormat f = NumberFormat.getNumberInstance();
-        Number n=null;
+        Number n = null;
         ParsePosition pp = new ParsePosition(0);
-        n = f.parse(input,pp);
-        if (pp.getErrorIndex() >= 0 || pp.getIndex()<input.length()) {
+        n = f.parse(input, pp);
+        if (pp.getErrorIndex() >= 0 || pp.getIndex() < input.length()) {
             // fall back - try to parse with the english locale
             //
@@ -233,8 +230,8 @@
             f = NumberFormat.getNumberInstance(Locale.ENGLISH);
             n = f.parse(input, pp);
-            if (pp.getErrorIndex() >= 0 || pp.getIndex()<input.length())
+            if (pp.getErrorIndex() >= 0 || pp.getIndex() < input.length())
                 return null;
         }
-        return n== null ? null : n.doubleValue();
+        return n == null ? null : n.doubleValue();
     }
 
@@ -243,13 +240,13 @@
         try {
             latLons = parseLatLons(taLatLon.getText());
-        Boolean working = true;
-        int i=0;
-        while (working && i < latLons.length) {
-        if (!LatLon.isValidLat(latLons[i].lat()) || !LatLon.isValidLon(latLons[i].lon())) {
+            Boolean working = true;
+            int i = 0;
+            while (working && i < latLons.length) {
+                if (!LatLon.isValidLat(latLons[i].lat()) || !LatLon.isValidLon(latLons[i].lon())) {
                     latLons = null;
-            working = false;
+                    working = false;
                 }
-        i++;
-        }
+                i++;
+            }
         } catch (IllegalArgumentException e) {
             latLons = null;
@@ -260,5 +257,5 @@
             setOkEnabled(false);
         } else {
-            clearErrorFeedback(taLatLon,tr("Please enter a GPS coordinates"));
+            clearErrorFeedback(taLatLon, tr("Please enter a GPS coordinates"));
             latLonCoordinates = latLons;
             setOkEnabled(true);
@@ -279,5 +276,5 @@
                     preferenceKey,
                     WindowGeometry.centerInWindow(getParent(), getSize())
-            ).applySafe(this);
+                    ).applySafe(this);
         } else {
             new WindowGeometry(this).remember(preferenceKey);
@@ -301,18 +298,19 @@
 
     static class TextFieldFocusHandler implements FocusListener {
-        @Override 
+        @Override
         public void focusGained(FocusEvent e) {
             Component c = e.getComponent();
             if (c instanceof JTextArea) {
-                JTextArea tf = (JTextArea)c;
+                JTextArea tf = (JTextArea) c;
                 tf.selectAll();
             }
         }
-        @Override 
+
+        @Override
         public void focusLost(FocusEvent e) {}
     }
 
     private static LatLon[] parseLatLons(final String text) {
-        String lines[] = text.split("\\r?\\n");
+        String[] lines = text.split("\\r?\\n");
         List<LatLon> latLons = new ArrayList<>();
         for (String line : lines) {
@@ -426,5 +424,6 @@
     }
 
-    private static void setLatLon(final LatLonHolder latLon, final double coordDeg, final double coordMin, final double coordSec, final String card) {
+    private static void setLatLon(final LatLonHolder latLon, final double coordDeg, final double coordMin, final double coordSec,
+            final String card) {
         if (coordDeg < -180 || coordDeg > 180 || coordMin < 0 || coordMin >= 60 || coordSec < 0 || coordSec > 60) {
             throw new IllegalArgumentException("out of range");
@@ -452,10 +451,13 @@
             //not fired
         }
+
         @Override public void insertUpdate(DocumentEvent e) {
             updateButtons();
         }
+
         @Override public void removeUpdate(DocumentEvent e) {
             updateButtons();
         }
+
         private void updateButtons() {
             String text = taLatLon.getText();
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagAction.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.multitagger;
 
@@ -20,5 +21,5 @@
      */
     public MultiTagAction() {
-        super(tr("Tag multiple objects [alpha]"), (String)null, tr("Edit tags of object list in table"),
+        super(tr("Tag multiple objects [alpha]"), (String) null, tr("Edit tags of object list in table"),
                 Shortcut.registerShortcut("multitag", tr("Edit: {0}", tr("Tag multiple objects")), KeyEvent.VK_T, Shortcut.CTRL),
                 true, "multitag", true);
@@ -37,11 +38,11 @@
     @Override
     protected void updateEnabledState() {
-        setEnabled(getLayerManager().getEditLayer()!=null);
+        setEnabled(getLayerManager().getEditLayer() != null);
     }
 
     @Override
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
-        setEnabled(getLayerManager().getEditLayer()!=null);
-        if (dlg!=null && dlg.isVisible()) {
+        setEnabled(getLayerManager().getEditLayer() != null);
+        if (dlg != null && dlg.isVisible()) {
             dlg.selectionChanged(selection);
         }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.multitagger;
 
@@ -71,10 +72,10 @@
 
     private static final String HISTORY_KEY = "utilsplugin2.multitaghistory";
-    String defaultHistory[] = {"addr:street, addr:housenumber, building, ${area}",
-        "highway, name, ${id}, ${length}",
-        "name name:en name:ru name:de"};
+    String[] defaultHistory = {"addr:street, addr:housenumber, building, ${area}",
+            "highway, name, ${id}, ${length}",
+    "name name:en name:ru name:de"};
 
     public MultiTagDialog() {
-        super(Main.parent,  tr("Edit tags"), new String[]{tr("Ok"), tr("Cancel")}, false);
+        super(Main.parent, tr("Edit tags"), new String[]{tr("Ok"), tr("Cancel")}, false);
         JPanel pnl = new JPanel(new GridBagLayout());
         tbl = createTable();
@@ -82,24 +83,23 @@
         cbTagSet.addItemListener(tagSetChanger);
         cbTagSet.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
-           .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true), "applyTagSet");
+        .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true), "applyTagSet");
         cbTagSet.getActionMap().put("applyTagSet", tagSetChanger);
 
         tbl.addMouseListener(new PopupMenuLauncher(createPopupMenu()));
 
-        pnl.add(cbTagSet,GBC.std().fill(GBC.HORIZONTAL));
-        pnl.add(new JButton(new DeleteFromHistoryAction()),GBC.std());
-        pnl.add(new JButton(new FindMatchingAction()),GBC.std());
+        pnl.add(cbTagSet, GBC.std().fill(GBC.HORIZONTAL));
+        pnl.add(new JButton(new DeleteFromHistoryAction()), GBC.std());
+        pnl.add(new JButton(new FindMatchingAction()), GBC.std());
         final JToggleButton jt = new JToggleButton("", ImageProvider.get("restart"), true);
         jt.setToolTipText(tr("Sync with JOSM selection"));
-        jt.addActionListener(new ActionListener(){
+        jt.addActionListener(new ActionListener() {
             @Override public void actionPerformed(ActionEvent e) {
                 tableModel.setWatchSelection(jt.isSelected());
-            };
-        });
-        pnl.add(jt,GBC.eol());
-
+            }
+        });
+        pnl.add(jt, GBC.eol());
 
         pnl.add(createTypeFilterPanel(), GBC.eol().fill(GBC.HORIZONTAL));
-        pnl.add(tbl.getTableHeader(),GBC.eop().fill(GBC.HORIZONTAL));
+        pnl.add(tbl.getTableHeader(), GBC.eop().fill(GBC.HORIZONTAL));
 
         pnl.add(new JScrollPane(tbl), GBC.eol().fill(GBC.BOTH));
@@ -132,5 +132,5 @@
         for (final OsmPrimitiveType type: OsmPrimitiveType.values()) {
             final JToggleButton jt = new JToggleButton("", ImageProvider.get(type), true);
-            jt.addActionListener(new ActionListener(){
+            jt.addActionListener(new ActionListener() {
                 @Override
                 public void actionPerformed(ActionEvent e) {
@@ -169,5 +169,5 @@
     /*private OsmPrimitive getSelectedPrimitive() {
         int idx = tbl.getSelectedRow();
-        if (idx>=0) {
+        if (idx>= 0) {
             return tableModel.getPrimitiveAt(tbl.convertRowIndexToModel(idx));
         } else {
@@ -176,8 +176,8 @@
     }*/
 
-   private final MouseAdapter tableMouseAdapter = new MouseAdapter() {
+    private final MouseAdapter tableMouseAdapter = new MouseAdapter() {
         @Override
         public void mouseClicked(MouseEvent e) {
-            if (e.getClickCount()>1 && Main.isDisplayingMapView()) {
+            if (e.getClickCount() > 1 && Main.isDisplayingMapView()) {
                 AutoScaleAction.zoomTo(currentSelection);
             }
@@ -189,5 +189,5 @@
         public void valueChanged(ListSelectionEvent e) {
             currentSelection = getSelectedPrimitives();
-            if (currentSelection != null && Main.isDisplayingMapView() ) {
+            if (currentSelection != null && Main.isDisplayingMapView()) {
                 if (highlightHelper.highlightOnly(currentSelection)) {
                     Main.map.mapView.repaint();
@@ -210,11 +210,11 @@
         OsmDataLayer l = Main.getLayerManager().getEditLayer();
         AutoCompletionManager autocomplete = l.data.getAutoCompletionManager();
-        for (int i=0; i<tableModel.mainTags.length; i++) {
-                if (tableModel.isSpecialTag[i]) continue;
-                AutoCompletingTextField tf = new AutoCompletingTextField(0, false);
-                AutoCompletionList acList = new AutoCompletionList();
-                autocomplete.populateWithTagValues(acList, tableModel.mainTags[i]);
-                tf.setAutoCompletionList(acList);
-                tbl.getColumnModel().getColumn(i+1).setCellEditor(tf);
+        for (int i = 0; i < tableModel.mainTags.length; i++) {
+            if (tableModel.isSpecialTag[i]) continue;
+            AutoCompletingTextField tf = new AutoCompletingTextField(0, false);
+            AutoCompletionList acList = new AutoCompletionList();
+            autocomplete.populateWithTagValues(acList, tableModel.mainTags[i]);
+            tf.setAutoCompletionList(acList);
+            tbl.getColumnModel().getColumn(i+1).setCellEditor(tf);
         }
     }
@@ -236,5 +236,5 @@
             }
         });
-        menu.add(new AbstractAction(tr("Remove tag"), ImageProvider.get("dialogs", "delete")){
+        menu.add(new AbstractAction(tr("Remove tag"), ImageProvider.get("dialogs", "delete")) {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -249,10 +249,10 @@
             }
         });
-        menu.add(new AbstractAction(tr("Duplicate tags from the first"), ImageProvider.get("copy")){
+        menu.add(new AbstractAction(tr("Duplicate tags from the first"), ImageProvider.get("copy")) {
             @Override
             public void actionPerformed(ActionEvent e) {
                 tableModel.setAutoCommit(false);
                 for (int c: tbl.getSelectedColumns()) {
-                    if (c==0 || tableModel.isSpecialTag[c-1]) continue;
+                    if (c == 0 || tableModel.isSpecialTag[c-1]) continue;
                     boolean first = true;
                     String value = "";
@@ -261,5 +261,5 @@
                             value = (String) tableModel.getValueAt(tbl.convertRowIndexToModel(r), tbl.convertColumnIndexToModel(c));
                         }
-                        first=false;
+                        first = false;
                         tableModel.setValueAt(value, tbl.convertRowIndexToModel(r), tbl.convertColumnIndexToModel(c));
                     }
@@ -285,6 +285,6 @@
 
     private class DeleteFromHistoryAction extends AbstractAction {
-        public DeleteFromHistoryAction() {
-            super("", ImageProvider.get("dialogs","delete"));
+        DeleteFromHistoryAction() {
+            super("", ImageProvider.get("dialogs", "delete"));
             putValue(SHORT_DESCRIPTION, tr("Delete from history"));
         }
@@ -305,6 +305,6 @@
 
     private class FindMatchingAction extends AbstractAction {
-        public FindMatchingAction() {
-            super("", ImageProvider.get("dialogs","search"));
+        FindMatchingAction() {
+            super("", ImageProvider.get("dialogs", "search"));
             putValue(SHORT_DESCRIPTION, tr("Find primitives with these tags"));
         }
@@ -322,5 +322,5 @@
         public void itemStateChanged(ItemEvent e) {
             // skip text-changing enevts, we need only combobox-selecting ones
-            if (cbTagSet.getSelectedIndex()<0) return;
+            if (cbTagSet.getSelectedIndex() < 0) return;
             actionPerformed(null);
         }
@@ -329,5 +329,5 @@
         public void actionPerformed(ActionEvent e) {
             String s = cbTagSet.getText();
-            if (s==null || s.isEmpty() || s.equals(oldTags)) return;
+            if (s == null || s.isEmpty() || s.equals(oldTags)) return;
             oldTags = s;
             cbTagSet.addCurrentItemToHistory();
@@ -335,6 +335,5 @@
             specifyTagSet(s);
         }
-
-    };
+    }
 
     private void specifyTagSet(String s) {
@@ -346,5 +345,5 @@
 
         tbl.getColumnModel().getColumn(0).setMaxWidth(20);
-        for (int i=1; i<tableModel.getColumnCount(); i++) {
+        for (int i = 1; i < tableModel.getColumnCount(); i++) {
             TableHelper.adjustColumnWidth(tbl, i, 100);
         }
@@ -355,6 +354,6 @@
     class ColoredRenderer extends DefaultTableCellRenderer {
         private final Color highlightColor =
-                Main.pref.getColor( marktr("Multitag Background: highlight"),
-                        new Color(255,255,200));
+                Main.pref.getColor(marktr("Multitag Background: highlight"),
+                        new Color(255, 255, 200));
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean
@@ -362,5 +361,5 @@
             int row1 = tbl.convertRowIndexToModel(row);
             JLabel label = (JLabel) super.getTableCellRendererComponent(
-                table, value, isSelected, hasFocus, row, column);
+                    table, value, isSelected, hasFocus, row, column);
             if (tbl.isRowSelected(row1) && !tbl.isColumnSelected(column)) {
                 label.setBackground(highlightColor);
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java	(revision 32410)
@@ -1,6 +1,4 @@
-// License: GPL. Copyright 2013 by Alexei Kasatkin
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.multitagger;
-
 
 import java.util.ArrayList;
@@ -24,12 +22,9 @@
 import org.openstreetmap.josm.tools.Geometry;
 
-/**
- *
- */
 public class MultiTaggerTableModel extends AbstractTableModel implements SelectionChangedListener {
 
     ArrayList<OsmPrimitive> list = new ArrayList<>(50);
-    String mainTags[] = new String[]{};
-    boolean isSpecialTag[] = new boolean[]{};
+    String[] mainTags = new String[]{};
+    boolean[] isSpecialTag = new boolean[]{};
     Set<OsmPrimitiveType> shownTypes = new HashSet<>();
     private boolean autoCommit = true;
@@ -41,5 +36,5 @@
         Collections.addAll(shownTypes, OsmPrimitiveType.values());
     }
-    
+
     @Override
     public int getRowCount() {
@@ -54,5 +49,5 @@
     public void setWatchSelection(boolean watchSelection) {
         this.watchSelection = watchSelection;
-        if (watchSelection && Main.getLayerManager().getEditLayer() != null) 
+        if (watchSelection && Main.getLayerManager().getEditLayer() != null)
             selectionChanged(Main.getLayerManager().getEditDataSet().getSelected());
     }
@@ -60,5 +55,5 @@
     @Override
     public Object getValueAt(int rowIndex, int columnIndex) {
-        if (columnIndex==0) {
+        if (columnIndex == 0) {
             return list.get(rowIndex).getDisplayType();
         }
@@ -71,5 +66,5 @@
             return String.valueOf(p.getUniqueId());
         } else if (var.equals("type")) {
-            return OsmPrimitiveType.from(p).getAPIName().substring(0,1).toUpperCase();
+            return OsmPrimitiveType.from(p).getAPIName().substring(0, 1).toUpperCase();
         } else if (var.equals("area")) {
             if (p.getDisplayType() == OsmPrimitiveType.CLOSEDWAY) {
@@ -82,5 +77,5 @@
                 return String.format("%.1f", ((Way) p).getLength());
             }
-        } 
+        }
         return "";
     }
@@ -88,5 +83,5 @@
     @Override
     public Class<?> getColumnClass(int columnIndex) {
-        if (columnIndex==0) {
+        if (columnIndex == 0) {
             return OsmPrimitiveType.class;
         } else {
@@ -94,5 +89,5 @@
         }
     }
-   
+
     @Override
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
@@ -103,5 +98,5 @@
     @Override
     public boolean isCellEditable(int rowIndex, int columnIndex) {
-        if (columnIndex==0) return false;
+        if (columnIndex == 0) return false;
         return !isSpecialTag[columnIndex-1];
     }
@@ -109,12 +104,12 @@
     @Override
     public void setValueAt(Object value, int rowIndex, int columnIndex) {
-        if (columnIndex==0 || isSpecialTag[columnIndex-1]) return;
+        if (columnIndex == 0 || isSpecialTag[columnIndex-1]) return;
         if (columnIndex >= getColumnCount() || rowIndex >= getRowCount()) return;
-        if (value==null) value="";
+        if (value == null) value = "";
         String val = ((String) value).trim();
         OsmPrimitive sel = list.get(rowIndex);
         String key = mainTags[columnIndex-1];
         String newValue = sel.get(key);
-        if (newValue == null) newValue="";
+        if (newValue == null) newValue = "";
         if (!val.equals(newValue)) {
             Command cmd = new ChangePropertyCommand(sel, key, (String) value);
@@ -124,17 +119,15 @@
                 cmds.add(cmd);
             }
-            
         }
     }
-    
 
     @Override
     public String getColumnName(int column) {
-        if (column==0) return "";
+        if (column == 0) return "";
         return mainTags[column-1];
     }
-    
+
     public OsmPrimitive getPrimitiveAt(int number) {
-        if (number<0 || number>=list.size()) {
+        if (number < 0 || number >= list.size()) {
             return null;
         } else {
@@ -142,10 +135,10 @@
         }
     }
-    
+
     public void setupColumnsFromText(String txt) {
         String[] tags = txt.trim().split("[\\s,]+");
         mainTags = new String[tags.length];
         isSpecialTag = new boolean[tags.length];
-        int i=0;
+        int i = 0;
         for (String t: tags) {
             if (t.startsWith("${") && t.endsWith("}")) {
@@ -163,20 +156,20 @@
         StringBuilder sb = new StringBuilder();
         boolean notFirst = false;
-        for (int i=0; i<mainTags.length; i++) {
+        for (int i = 0; i < mainTags.length; i++) {
             if (!isSpecialTag[i]) {
-                 if (notFirst) sb.append(" | ");
-                 sb.append("\"");
-                 sb.append(mainTags[i]);
-                 sb.append("\":");
-                 notFirst = true;
+                if (notFirst) sb.append(" | ");
+                sb.append("\"");
+                sb.append(mainTags[i]);
+                sb.append("\":");
+                notFirst = true;
             }
-        };
+        }
         return sb.toString();
     }
 
     void updateData(Collection<? extends OsmPrimitive> sel) {
-       if (table.isEditing()) table.getCellEditor().stopCellEditing();
-       
-       list.clear();
+        if (table.isEditing()) table.getCellEditor().stopCellEditing();
+
+        list.clear();
         for (OsmPrimitive p : sel) {
             if (shownTypes.contains(p.getDisplayType())) {
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java	(revision 32410)
@@ -1,3 +1,6 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.event.ActionEvent;
@@ -6,10 +9,11 @@
 import java.util.Collection;
 import java.util.List;
+
 import javax.swing.JOptionPane;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.Notification;
-import static org.openstreetmap.josm.tools.I18n.tr;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -24,6 +28,6 @@
     public ReplaceGeometryAction() {
         super(TITLE, "dumbutils/replacegeometry", tr("Replace geometry of selected object with a new one"),
-                Shortcut.registerShortcut("tools:replacegeometry", tr("Tool: {0}", tr("Replace Geometry")), KeyEvent.VK_G, Shortcut.CTRL_SHIFT)
-                , true);
+                Shortcut.registerShortcut("tools:replacegeometry", tr("Tool: {0}", tr("Replace Geometry")), KeyEvent.VK_G, Shortcut.CTRL_SHIFT),
+                true);
     }
 
@@ -39,5 +43,5 @@
             new Notification(
                     tr("This tool replaces geometry of one object with another, and so requires exactly two objects to be selected.")
-                ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
             return;
         }
@@ -45,22 +49,22 @@
         OsmPrimitive firstObject = selection.get(0);
         OsmPrimitive secondObject = selection.get(1);
-        
+
         try {
             ReplaceGeometryCommand replaceCommand =
                     ReplaceGeometryUtils.buildReplaceWithNewCommand(firstObject, secondObject);
-            
+
             // action was canceled
             if (replaceCommand == null)
                 return;
-            
+
             Main.main.undoRedo.add(replaceCommand);
         } catch (IllegalArgumentException ex) {
             new Notification(
-                ex.getMessage()
-            ).setIcon(JOptionPane.WARNING_MESSAGE).show(); 
+                    ex.getMessage()
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
         } catch (ReplaceGeometryException ex) {
             new Notification(
-                ex.getMessage()
-            ).setIcon(JOptionPane.WARNING_MESSAGE).show(); 
+                    ex.getMessage()
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
         }
     }
@@ -72,6 +76,6 @@
 
     @Override
-    protected void updateEnabledState( Collection<? extends OsmPrimitive> selection ) {
-        setEnabled(selection != null && selection.size() >= 2 );
+    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
+        setEnabled(selection != null && selection.size() >= 2);
     }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryCommand.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryCommand.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryCommand.java	(revision 32410)
@@ -1,6 +1,9 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry;
 
 import java.util.Collection;
+
 import javax.swing.Icon;
+
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
@@ -9,10 +12,10 @@
 /**
  * Command to replace the geometry of one object with another.
- * 
+ *
  * @author joshdoe
  */
 public class ReplaceGeometryCommand extends SequenceCommand {
     private final String description;
-    
+
     public ReplaceGeometryCommand(String description, Collection<Command> sequence) {
         super(description, sequence);
@@ -24,9 +27,9 @@
         return description;
     }
-    
+
     @Override
     public Icon getDescriptionIcon() {
         return ImageProvider.get("dumbutils", "replacegeometry");
     }
-    
+
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryException.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryException.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryException.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry;
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry;
 
@@ -43,10 +44,11 @@
  */
 public final class ReplaceGeometryUtils {
+
+    private ReplaceGeometryUtils() {
+        // Hide default constructor for utilities classes
+    }
+
     /**
      * Replace new or uploaded object with new object
-     * 
-     * @param firstObject
-     * @param secondObject
-     * @return 
      */
     public static ReplaceGeometryCommand buildReplaceWithNewCommand(OsmPrimitive firstObject, OsmPrimitive secondObject) {
@@ -60,15 +62,12 @@
             return buildUpgradeNodeCommand((Node) secondObject, firstObject);
         } else {
-            throw new IllegalArgumentException(tr("This tool can only replace a node, upgrade a node to a way or a multipolygon, or replace a way with a way."));
-        }
-    }
-    
+            throw new IllegalArgumentException(
+                    tr("This tool can only replace a node, upgrade a node to a way or a multipolygon, or replace a way with a way."));
+        }
+    }
+
     /**
      * Replace subjectObject geometry with referenceObject geometry and merge tags
      * and relation memberships.
-     * 
-     * @param subjectObject
-     * @param referenceSubject
-     * @return 
      */
     public static ReplaceGeometryCommand buildReplaceCommand(OsmPrimitive subjectObject, OsmPrimitive referenceSubject) {
@@ -83,5 +82,6 @@
             return buildUpgradeNodeCommand((Node) referenceSubject, subjectObject);
         } else {
-            throw new IllegalArgumentException(tr("This tool can only replace a node, upgrade a node to a way or a multipolygon, or replace a way with a way."));
+            throw new IllegalArgumentException(
+                    tr("This tool can only replace a node, upgrade a node to a way or a multipolygon, or replace a way with a way."));
         }
     }
@@ -89,7 +89,4 @@
     /**
      * Replace a new or uploaded node with a new node
-     * @param firstNode
-     * @param secondNode
-     * @return 
      */
     public static ReplaceGeometryCommand buildReplaceNodeWithNewCommand(Node firstNode, Node secondNode) {
@@ -103,11 +100,7 @@
             return buildReplaceNodeCommand(firstNode, secondNode);
     }
-    
+
     /**
      * Replace a node with another node (similar to MergeNodesAction)
-     *
-     * @param subjectNode
-     * @param referenceNode
-     * @return
      */
     public static ReplaceGeometryCommand buildReplaceNodeCommand(Node subjectNode, Node referenceNode) {
@@ -128,5 +121,5 @@
                 commands);
     }
-    
+
     /**
      * Upgrade a node to a way or multipolygon
@@ -167,5 +160,5 @@
 
         List<Command> commands = new ArrayList<>();
-        AbstractMap<String, String> nodeTags = (AbstractMap<String, String>) subjectNode.getKeys();
+        AbstractMap<String, String> nodeTags = subjectNode.getKeys();
 
         // merge tags
@@ -210,10 +203,10 @@
                 commands);
     }
-    
+
     public static ReplaceGeometryCommand buildReplaceWayWithNewCommand(List<Way> selection) {
         // determine which way will be replaced and which will provide the geometry
         boolean overrideNewCheck = false;
         int idxNew = selection.get(0).isNew() ? 0 : 1;
-        if( selection.get(1-idxNew).isNew() ) {
+        if (selection.get(1-idxNew).isNew()) {
             // if both are new, select the one with all the DB nodes
             boolean areNewNodes = false;
@@ -233,6 +226,6 @@
         Way referenceWay = selection.get(idxNew);
         Way subjectWay = selection.get(1 - idxNew);
-        
-        if( !overrideNewCheck && (subjectWay.isNew() || !referenceWay.isNew()) ) {
+
+        if (!overrideNewCheck && (subjectWay.isNew() || !referenceWay.isNew())) {
             throw new ReplaceGeometryException(
                     tr("Please select one way that exists in the database and one new way with correct geometry."));
@@ -240,5 +233,5 @@
         return buildReplaceWayCommand(subjectWay, referenceWay);
     }
-    
+
     public static ReplaceGeometryCommand buildReplaceWayCommand(Way subjectWay, Way referenceWay) {
 
@@ -247,5 +240,5 @@
             throw new ReplaceGeometryException(tr("The ways must be entirely within the downloaded area."));
         }
-        
+
         if (hasImportantNode(referenceWay, subjectWay)) {
             throw new ReplaceGeometryException(
@@ -254,5 +247,5 @@
 
         List<Command> commands = new ArrayList<>();
-                
+
         // merge tags
         try {
@@ -263,5 +256,5 @@
             return null;
         }
-        
+
         // Prepare a list of nodes that are not used anywhere except in the way
         List<Node> nodePool = getUnimportantNodes(subjectWay);
@@ -269,7 +262,7 @@
         // And the same for geometry, list nodes that can be freely deleted
         List<Node> geometryPool = new LinkedList<>();
-        for( Node node : referenceWay.getNodes() ) {
+        for (Node node : referenceWay.getNodes()) {
             List<OsmPrimitive> referrers = node.getReferrers();
-            if( node.isNew() && !node.isDeleted() && referrers.size() == 1
+            if (node.isNew() && !node.isDeleted() && referrers.size() == 1
                     && referrers.get(0).equals(referenceWay) && !subjectWay.containsNode(node)
                     && !hasInterestingKey(node) && !geometryPool.contains(node))
@@ -278,5 +271,5 @@
 
         boolean useRobust = Main.pref.getBoolean("utilsplugin2.replace-geometry.robustAssignment", true);
-        
+
         // Find new nodes that are closest to the old ones, remove matching old ones from the pool
         // Assign node moves with least overall distance moved
@@ -287,5 +280,5 @@
                 int nLen = nodePool.size();
                 int N = Math.max(gLen, nLen);
-                double cost[][] = new double[N][N];
+                double[][] cost = new double[N][N];
                 for (int i = 0; i < N; i++) {
                     for (int j = 0; j < N; j++) {
@@ -319,10 +312,9 @@
                         nodePool.remove(n);
                     }
-                }
-                catch (Exception e) {
+                } catch (Exception e) {
                     useRobust = false;
                     new Notification(
-                        tr("Exceeded iteration limit for robust method, using simpler method.")
-                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();     
+                            tr("Exceeded iteration limit for robust method, using simpler method.")
+                            ).setIcon(JOptionPane.WARNING_MESSAGE).show();
                     nodeAssoc = new HashMap<>();
                 }
@@ -341,13 +333,15 @@
 
         // Now that we have replacement list, move all unused new nodes to nodePool (and delete them afterwards)
-        for( Node n : geometryPool )
-            if( nodeAssoc.containsKey(n) )
+        for (Node n : geometryPool) {
+            if (nodeAssoc.containsKey(n))
                 nodePool.add(n);
+        }
 
         // And prepare a list of nodes with all the replacements
         List<Node> geometryNodes = referenceWay.getNodes();
-        for( int i = 0; i < geometryNodes.size(); i++ )
-            if( nodeAssoc.containsKey(geometryNodes.get(i)) )
+        for (int i = 0; i < geometryNodes.size(); i++) {
+            if (nodeAssoc.containsKey(geometryNodes.get(i)))
                 geometryNodes.set(i, nodeAssoc.get(geometryNodes.get(i)));
+        }
 
         // Now do the replacement
@@ -355,6 +349,7 @@
 
         // Move old nodes to new positions
-        for( Node node : nodeAssoc.keySet() )
+        for (Node node : nodeAssoc.keySet()) {
             commands.add(new MoveCommand(nodeAssoc.get(node), node.getCoor()));
+        }
 
         // Remove geometry way from selection
@@ -365,5 +360,5 @@
 
         // Delete nodes that are not used anymore
-        if( !nodePool.isEmpty() )
+        if (!nodePool.isEmpty())
             commands.add(new DeleteCommand(nodePool));
 
@@ -376,7 +371,4 @@
     /**
      * Create a list of nodes that are not used anywhere except in the way.
-     *
-     * @param way
-     * @return 
      */
     protected static List<Node> getUnimportantNodes(Way way) {
@@ -391,11 +383,8 @@
         return nodePool;
     }
-    
+
     /**
      * Checks if a way has at least one important node (e.g. interesting tag,
      * role membership), and thus cannot be safely modified.
-     * 
-     * @param way
-     * @return 
      */
     protected static boolean hasImportantNode(Way geometry, Way way) {
@@ -417,5 +406,5 @@
         return false;
     }
-    
+
     protected static boolean hasInterestingKey(OsmPrimitive object) {
         for (String key : object.getKeys().keySet()) {
@@ -434,5 +423,5 @@
         return false;
     }
-    
+
     protected static boolean isInArea(Way way, Area area) {
         if (area == null) {
@@ -448,6 +437,6 @@
         return true;
     }
-    
-     /**
+
+    /**
      * Merge tags from source to target object, showing resolution dialog if
      * needed.
@@ -464,13 +453,13 @@
                 TagCollection.unionOfAllPrimitives(primitives), primitives, Collections.singleton(target));
     }
-    
+
     /**
      * Find node from the collection which is nearest to <tt>node</tt>. Max distance is taken in consideration.
      * @return null if there is no such node.
      */
-    protected static Node findNearestNode( Node node, Collection<Node> nodes ) {
-        if( nodes.contains(node) )
+    protected static Node findNearestNode(Node node, Collection<Node> nodes) {
+        if (nodes.contains(node))
             return node;
-        
+
         Node nearest = null;
         // TODO: use meters instead of degrees, but do it fast
@@ -478,7 +467,7 @@
         LatLon coor = node.getCoor();
 
-        for( Node n : nodes ) {
+        for (Node n : nodes) {
             double d = n.getCoor().distance(coor);
-            if( d < distance ) {
+            if (d < distance) {
                 distance = d;
                 nearest = n;
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.replacegeometry;
 
@@ -50,9 +51,9 @@
                     secondObject.getDisplayName(DefaultNameFormatter.getInstance()),
                     affectedRelations
-            )).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
+                    )).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
         } else {
             new Notification(tr("The first selected object ''{0}'' is not part of any relation",
                     firstObject.getDisplayName(DefaultNameFormatter.getInstance())
-            )).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                    )).setIcon(JOptionPane.WARNING_MESSAGE).show();
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ChildrenMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ChildrenMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ChildrenMatch.java	(revision 32410)
@@ -1,4 +1,6 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
-package org.openstreetmap.josm.plugins.utilsplugin2.search;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
@@ -7,5 +9,4 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -13,15 +14,18 @@
  */
 public class ChildrenMatch extends RangeMatch {
-    public ChildrenMatch(PushbackTokenizer.Range range) {super(range);}
+    public ChildrenMatch(PushbackTokenizer.Range range) {
+        super(range);
+    }
+
     public ChildrenMatch(PushbackTokenizer tokenizer) throws SearchCompiler.ParseError {
         this(tokenizer.readRange(tr("Range of child primitives count")));
     }
 
-    @Override 
+    @Override
     protected Long getNumber(OsmPrimitive osm) {
         if (osm instanceof Way) {
-            return (long) ((Way)osm).getNodesCount();
+            return (long) ((Way) osm).getNodesCount();
         } else if (osm instanceof Relation) {
-            return (long) ((Relation)osm).getMembersCount();
+            return (long) ((Relation) osm).getMembersCount();
         } else {
             return null;
@@ -29,5 +33,5 @@
     }
 
-    @Override 
+    @Override
     protected String getString() {
         return "children";
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL v2 or later. See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
@@ -5,4 +5,5 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
@@ -11,5 +12,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils;
-
 
 /**
@@ -62,8 +62,8 @@
         }
         if (osm instanceof Way) {
-            return connected.contains((Way) osm);
+            return connected.contains(osm);
         }
         return false;
     }
-    
+
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java	(revision 32410)
@@ -1,12 +1,8 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
 import java.util.Collection;
 import java.util.HashSet;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL v2 or later. See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
@@ -5,4 +5,5 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
@@ -12,6 +13,6 @@
 
 /**
-* Find (all) ways intersecting ways or nodes which match the expression.
-*/
+ * Find (all) ways intersecting ways or nodes which match the expression.
+ */
 public class IntersectingMatch extends SearchCompiler.UnaryMatch {
     private Collection<Way> intersecting = null;
@@ -51,8 +52,8 @@
         }
         if (osm instanceof Way) {
-            return intersecting.contains((Way) osm);
+            return intersecting.contains(osm);
         }
         return false;
     }
-    
+
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ParentsMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ParentsMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ParentsMatch.java	(revision 32410)
@@ -1,9 +1,10 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
-package org.openstreetmap.josm.plugins.utilsplugin2.search;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -11,13 +12,18 @@
  */
 public class ParentsMatch extends RangeMatch {
-    public ParentsMatch(PushbackTokenizer.Range range) {super(range);}
+    public ParentsMatch(PushbackTokenizer.Range range) {
+        super(range);
+    }
+
     public ParentsMatch(PushbackTokenizer tokenizer) throws SearchCompiler.ParseError {
         this(tokenizer.readRange(tr("Range of parent primitives count")));
     }
-    @Override 
+
+    @Override
     protected Long getNumber(OsmPrimitive osm) {
         return new Long(osm.getReferrers().size());
     }
-    @Override 
+
+    @Override
     protected String getString() {
         return "parents";
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/RangeMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/RangeMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/RangeMatch.java	(revision 32410)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
@@ -10,33 +11,33 @@
 public abstract class RangeMatch extends SearchCompiler.Match {
 
-        private final long min;
-        private final long max;
+    private final long min;
+    private final long max;
 
-        public RangeMatch(long min, long max) {
-            this.min = Math.min(min, max);
-            this.max = Math.max(min, max);
-        }
-
-        public RangeMatch(PushbackTokenizer.Range range) {
-            this(range.getStart(), range.getEnd());
-        }
-
-        protected abstract Long getNumber(OsmPrimitive osm);
-
-        protected abstract String getString();
-
-        @Override
-        public boolean match(OsmPrimitive osm) {
-            Long num = getNumber(osm);
-            if (num == null)
-                return false;
-            else
-                return (num >= min) && (num <= max);
-        }
-
-        @Override
-        public String toString() {
-            return getString() + "=" + min + "-" + max;
-        }
+    public RangeMatch(long min, long max) {
+        this.min = Math.min(min, max);
+        this.max = Math.max(min, max);
     }
 
+    public RangeMatch(PushbackTokenizer.Range range) {
+        this(range.getStart(), range.getEnd());
+    }
+
+    protected abstract Long getNumber(OsmPrimitive osm);
+
+    protected abstract String getString();
+
+    @Override
+    public boolean match(OsmPrimitive osm) {
+        Long num = getNumber(osm);
+        if (num == null)
+            return false;
+        else
+            return (num >= min) && (num <= max);
+    }
+
+    @Override
+    public String toString() {
+        return getString() + "=" + min + "-" + max;
+    }
+}
+
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInRelationsMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInRelationsMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInRelationsMatch.java	(revision 32410)
@@ -1,4 +1,6 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
-package org.openstreetmap.josm.plugins.utilsplugin2.search;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
@@ -10,5 +12,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -16,25 +17,45 @@
  */
 public class UsedInRelationsMatch extends RangeMatch {
-    public UsedInRelationsMatch(PushbackTokenizer.Range range) {super(range);}
+    public UsedInRelationsMatch(PushbackTokenizer.Range range) {
+        super(range);
+    }
+
     public UsedInRelationsMatch(PushbackTokenizer tokenizer) throws SearchCompiler.ParseError {
         this(tokenizer.readRange(tr("Range of referencing relation count")));
     }
+
     private class RelationCounter implements Visitor {
         int count;
         @Override
-        public void visit(Way w) {  }
-        @Override   public void visit(Node n) { }
-        @Override   public void visit(Relation r) { count++;  }
-        @Override   public void visit(Changeset cs) {   }
+        public void visit(Way w) {
+            // Do nothing
+        }
+
+        @Override
+        public void visit(Node n) {
+            // Do nothing
+        }
+
+        @Override
+        public void visit(Relation r) {
+            count++;
+        }
+
+        @Override
+        public void visit(Changeset cs) {
+            // Do nothing
+        }
     }
+
     RelationCounter counter = new RelationCounter();
 
-    @Override 
+    @Override
     protected Long getNumber(OsmPrimitive osm) {
-        counter.count=0;
+        counter.count = 0;
         osm.visitReferrers(counter);
         return new Long(counter.count);
     }
-    @Override 
+
+    @Override
     protected String getString() {
         return "usedinrelations";
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInWaysMatch.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInWaysMatch.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UsedInWaysMatch.java	(revision 32410)
@@ -1,4 +1,6 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
-package org.openstreetmap.josm.plugins.utilsplugin2.search;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
@@ -10,5 +12,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -16,25 +17,45 @@
  */
 public class UsedInWaysMatch extends RangeMatch {
-    public UsedInWaysMatch(PushbackTokenizer.Range range) {super(range);}
+    public UsedInWaysMatch(PushbackTokenizer.Range range) {
+        super(range);
+    }
+
     public UsedInWaysMatch(PushbackTokenizer tokenizer) throws SearchCompiler.ParseError {
         this(tokenizer.readRange(tr("Range of attached ways count")));
     }
+
     private class WayCounter implements Visitor {
         int count;
         @Override
-        public void visit(Way w) { count++; }
-        @Override   public void visit(Node n) { }
-        @Override   public void visit(Relation r) {   }
-        @Override   public void visit(Changeset cs) {   }
+        public void visit(Way w) {
+            count++;
+        }
+
+        @Override
+        public void visit(Node n) {
+            // Do nothing
+        }
+
+        @Override
+        public void visit(Relation r) {
+            // Do nothing
+        }
+
+        @Override
+        public void visit(Changeset cs) {
+            // Do nothing
+        }
     }
+
     WayCounter counter = new WayCounter();
 
-@Override protected Long getNumber(OsmPrimitive osm) {
+    @Override protected Long getNumber(OsmPrimitive osm) {
         if (osm instanceof Node) {
-            counter.count=0;
+            counter.count = 0;
             osm.visitReferrers(counter);
             return new Long(counter.count);
         } else return null;
     }
+
     @Override protected String getString() {
         return "wayrefs";
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsSimpleMatchFactory.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsSimpleMatchFactory.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsSimpleMatchFactory.java	(revision 32410)
@@ -1,6 +1,8 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
 import java.util.Arrays;
 import java.util.Collection;
+
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
@@ -8,5 +10,5 @@
 
 public class UtilsSimpleMatchFactory implements SimpleMatchFactory {
-    
+
     private static Collection<String> keywords = Arrays.asList("usedinways", "usedinrelations", "parents", "children");
 
@@ -20,16 +22,15 @@
         if ("usedinways".equals(keyword)) {
             return new UsedInWaysMatch(tokenizer);
-        } else 
-        if ("usedinrelations".equals(keyword)) {
-            return new UsedInRelationsMatch(tokenizer);
-        } else 
-        if ("parents".equals(keyword)) {
-            return new ParentsMatch(tokenizer);
         } else
-        if ("children".equals(keyword)) {
-            return new ChildrenMatch(tokenizer);
-        } else
-            return null; 
-    };
-    
+            if ("usedinrelations".equals(keyword)) {
+                return new UsedInRelationsMatch(tokenizer);
+            } else
+                if ("parents".equals(keyword)) {
+                    return new ParentsMatch(tokenizer);
+                } else
+                    if ("children".equals(keyword)) {
+                        return new ChildrenMatch(tokenizer);
+                    } else
+                        return null;
+    }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsUnaryMatchFactory.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsUnaryMatchFactory.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/UtilsUnaryMatchFactory.java	(revision 32410)
@@ -1,7 +1,8 @@
-// License: GPL v2 or later. See LICENSE file for details.
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.search;
 
 import java.util.Arrays;
 import java.util.Collection;
+
 import org.openstreetmap.josm.actions.search.PushbackTokenizer;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
@@ -13,5 +14,6 @@
 
     @Override
-    public SearchCompiler.UnaryMatch get(String keyword, SearchCompiler.Match matchOperand, PushbackTokenizer tokenizer) throws SearchCompiler.ParseError {
+    public SearchCompiler.UnaryMatch get(String keyword, SearchCompiler.Match matchOperand, PushbackTokenizer tokenizer)
+            throws SearchCompiler.ParseError {
         if ("inside".equals(keyword)) {
             return new InsideMatch(matchOperand);
@@ -24,5 +26,5 @@
         } else if ("allintersecting".equals(keyword)) {
             return new IntersectingMatch(matchOperand, true);
-        } 
+        }
         return null;
     }
@@ -32,4 +34,3 @@
         return keywords;
     }
-
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentNodesAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -10,11 +10,14 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Extends current selection
+ * Extends current selection
  */
 public class AdjacentNodesAction extends JosmAction {
@@ -24,10 +27,10 @@
     public AdjacentNodesAction() {
         super(tr("Adjacent nodes"), "adjnodes", tr("Select adjacent nodes"),
-                Shortcut.registerShortcut("tools:adjnodes", tr("Tool: {0}","Adjacent nodes"),
-                KeyEvent.VK_E, Shortcut.DIRECT), true);
+                Shortcut.registerShortcut("tools:adjnodes", tr("Tool: {0}", "Adjacent nodes"),
+                        KeyEvent.VK_E, Shortcut.DIRECT), true);
         putValue("help", ht("/Action/AdjacentNodes"));
     }
 
-    private  Set<Way> activeWays = new HashSet<>();
+    private Set<Way> activeWays = new HashSet<>();
 
     @Override
@@ -38,5 +41,5 @@
 
         Set<Way> selectedWays = OsmPrimitive.getFilteredSet(ds.getSelected(), Way.class);
-        
+
         // if no nodes and no ways are selected, do nothing
         if (selectedNodes.isEmpty() && selectedWays.isEmpty()) return;
@@ -50,5 +53,5 @@
             if (selectedNodes.size() == 1) {
                 activeWays.clear();
-//                System.out.println("Cleared active ways");
+                //                System.out.println("Cleared active ways");
             }
         } else {
@@ -58,5 +61,5 @@
 
         // selecting nodes of selected ways
-        if(selectedNodes.isEmpty()) {
+        if (selectedNodes.isEmpty()) {
             HashSet<Node> newNodes = new HashSet<>();
             NodeWayUtils.addNodesConnectedToWays(selectedWays, newNodes);
@@ -70,5 +73,5 @@
         }
 
-        Set<Node> newNodes = new HashSet <>();
+        Set<Node> newNodes = new HashSet<>();
         for (Node node: selectedNodes) {
             for (Way w: activeWays) {
@@ -76,18 +79,15 @@
             }
         }
-        
+
         // select only newly found nodes
-         newNodes.removeAll(selectedNodes);
+        newNodes.removeAll(selectedNodes);
 
-//         System.out.printf("Found %d new nodes\n",newNodes.size());
-         
-         // enable branching on next call of this function
-         // if no new nodes were found, next search will include all touched ways
-         if (newNodes.isEmpty()) {
-             activeWays.clear();
-//             System.out.println("No more points found, activeways cleared");
-         }
+        // enable branching on next call of this function
+        // if no new nodes were found, next search will include all touched ways
+        if (newNodes.isEmpty()) {
+            activeWays.clear();
+        }
 
-         ds.addSelected(newNodes);
+        ds.addSelected(newNodes);
     }
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentWaysAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentWaysAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -10,11 +10,14 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Extends current selection
+ * Extends current selection
  */
 public class AdjacentWaysAction extends JosmAction {
@@ -25,6 +28,6 @@
         super(tr("Adjacent ways"), "adjways",
                 tr("Adjacent ways will be selected. Nodes will be deselected."),
-                Shortcut.registerShortcut("tools:adjways", tr("Tool: {0}","Adjacent ways"),
-                KeyEvent.VK_E, Shortcut.SHIFT), true);
+                Shortcut.registerShortcut("tools:adjways", tr("Tool: {0}", "Adjacent ways"),
+                        KeyEvent.VK_E, Shortcut.SHIFT), true);
         putValue("help", ht("/Action/AdjacentWays"));
     }
@@ -44,9 +47,9 @@
 
         // selecting ways attached to selected nodes
-        if(!selectedNodes.isEmpty()) {
+        if (!selectedNodes.isEmpty()) {
             NodeWayUtils.addWaysConnectedToNodes(selectedNodes, newWays);
         }
 
-//        System.out.printf("%d ways added to selection\n",newWays.size()-selectedWays.size());
+        //        System.out.printf("%d ways added to selection\n",newWays.size()-selectedWays.size());
         ds.setSelected(newWays);
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/ConnectedWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/ConnectedWaysAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/ConnectedWaysAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -10,11 +10,14 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Extends current selection by selecting nodes on all touched ways
+ * Extends current selection by selecting nodes on all touched ways
  */
 public class ConnectedWaysAction extends JosmAction {
@@ -22,6 +25,6 @@
     public ConnectedWaysAction() {
         super(tr("All connected ways"), "adjwaysall", tr("Select all connected ways"),
-                Shortcut.registerShortcut("tools:adjwaysall", tr("Tool: {0}","All connected ways"),
-                KeyEvent.VK_E, Shortcut.CTRL_SHIFT), true);
+                Shortcut.registerShortcut("tools:adjwaysall", tr("Tool: {0}", "All connected ways"),
+                        KeyEvent.VK_E, Shortcut.CTRL_SHIFT), true);
         putValue("help", ht("/Action/SelectConnectedWays"));
     }
@@ -37,5 +40,5 @@
 
         // selecting ways attached to selected nodes
-        if(!selectedNodes.isEmpty()) {
+        if (!selectedNodes.isEmpty()) {
             NodeWayUtils.addWaysConnectedToNodes(selectedNodes, newWays);
         }
@@ -44,6 +47,5 @@
         newWays.addAll(selectedWays);
         NodeWayUtils.addWaysConnectedToWaysRecursively(selectedWays, newWays);
-        
-//        System.out.printf("%d ways added to selection\n",newWays.size()-selectedWays.size());
+
         ds.setSelected(newWays);
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -21,5 +21,5 @@
 
 /**
- *    Extends current selection by selecting nodes on all touched ways
+ * Extends current selection by selecting nodes on all touched ways
  */
 public class IntersectedWaysAction extends JosmAction {
@@ -27,6 +27,6 @@
     public IntersectedWaysAction() {
         super(tr("Intersecting ways"), "intway", tr("Select intersecting ways"),
-                Shortcut.registerShortcut("tools:intway", tr("Tool: {0}","Intersecting ways"),
-                KeyEvent.VK_I, Shortcut.DIRECT), true);
+                Shortcut.registerShortcut("tools:intway", tr("Tool: {0}", "Intersecting ways"),
+                        KeyEvent.VK_I, Shortcut.DIRECT), true);
         putValue("help", ht("/Action/SelectIntersectingWays"));
     }
@@ -46,7 +46,7 @@
             return;
         } else {
-             new Notification(
-               tr("Please select some ways to find connected and intersecting ways!")
-               ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+            new Notification(
+                    tr("Please select some ways to find connected and intersecting ways!")
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysRecursiveAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysRecursiveAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysRecursiveAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin ond others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -21,12 +21,12 @@
 
 /**
- *    Extends current selection by selecting nodes on all touched ways
+ * Extends current selection by selecting nodes on all touched ways
  */
 public class IntersectedWaysRecursiveAction extends JosmAction {
-    
+
     public IntersectedWaysRecursiveAction() {
         super(tr("All intersecting ways"), "intwayall", tr("Select all intersecting ways"),
-                Shortcut.registerShortcut("tools:intwayall", tr("Tool: {0}","All intersecting ways"),
-                KeyEvent.VK_MULTIPLY, Shortcut.CTRL), true);
+                Shortcut.registerShortcut("tools:intwayall", tr("Tool: {0}", "All intersecting ways"),
+                        KeyEvent.VK_MULTIPLY, Shortcut.CTRL), true);
         putValue("help", ht("/Action/SelectAllIntersectingWays"));
 
@@ -45,7 +45,7 @@
             ds.addSelected(newWays);
         } else {
-              new Notification(
-                tr("Please select some ways to find all connected and intersecting ways!")
-                ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+            new Notification(
+                    tr("Please select some ways to find all connected and intersecting ways!")
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/MiddleNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/MiddleNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/MiddleNodesAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -20,5 +20,5 @@
 
 /**
- *    Selects nodes between two selected
+ * Selects nodes between two selected
  */
 public class MiddleNodesAction extends JosmAction {
@@ -28,6 +28,5 @@
     public MiddleNodesAction() {
         super(tr("Middle nodes"), "midnodes", tr("Select middle nodes"),
-                Shortcut.registerShortcut("tools:midnodes", tr("Tool: {0}","Middle nodes"),
-                KeyEvent.VK_E,  Shortcut.ALT_SHIFT), true);
+                Shortcut.registerShortcut("tools:midnodes", tr("Tool: {0}", "Middle nodes"), KeyEvent.VK_E, Shortcut.ALT_SHIFT), true);
         putValue("help", ht("/Action/MiddleNodes"));
     }
@@ -41,12 +40,12 @@
         if (selectedNodes.size() != 2) {
             new Notification(
-                tr("Please select two nodes connected by way!")
-            ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                    tr("Please select two nodes connected by way!")
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
             return;
         }
 
-        Set<Node> newNodes = new HashSet <>();
+        Set<Node> newNodes = new HashSet<>();
         NodeWayUtils.addMiddle(selectedNodes, newNodes);
-        
+
         // select only newly found nodes
         newNodes.removeAll(selectedNodes);
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java	(revision 32410)
@@ -1,11 +1,11 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
-import org.openstreetmap.josm.data.osm.Relation;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -19,13 +19,9 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.tools.Geometry;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
 import org.openstreetmap.josm.tools.Pair;
-
-
 
 /**
@@ -38,4 +34,8 @@
     static final int maxWays = Main.pref.getInteger("selection.maxfoundways", 2000);
     static final int maxWays1 = Main.pref.getInteger("selection.maxfoundways.intersection", 500);
+
+    private NodeWayUtils() {
+        // Hide default constructor for utilities classes
+    }
 
     /**
@@ -47,5 +47,5 @@
     static void addNeighbours(Way w, Node n, Collection<Node> nodes) {
         List<Node> nodeList = w.getNodes();
-        
+
         int idx = nodeList.indexOf(n);
         if (idx == -1) return;
@@ -68,5 +68,5 @@
             }
         }
-     }
+    }
 
     /**
@@ -76,5 +76,5 @@
      */
     static int addWaysConnectedToWay(Way w, Set<Way> ways) {
-         int s = ways.size();
+        int s = ways.size();
         List<Node> nodes = w.getNodes();
         boolean flag = ways.contains(w);
@@ -103,20 +103,20 @@
      * @param newWays set to place the ways we found
      */
-    static int addWaysIntersectingWay(Collection<Way> ways, Way w, Set<Way> newWays,Set<Way> excludeWays) {
+    static int addWaysIntersectingWay(Collection<Way> ways, Way w, Set<Way> newWays, Set<Way> excludeWays) {
         List<Pair<Node, Node>> nodePairs = w.getNodePairs(false);
-        int count=0;
+        int count = 0;
         for (Way anyway: ways) {
             if (anyway == w) continue;
-            if (newWays.contains(anyway) || excludeWays.contains(anyway) ) continue;
+            if (newWays.contains(anyway) || excludeWays.contains(anyway)) continue;
 
             List<Pair<Node, Node>> nodePairs2 = anyway.getNodePairs(false);
-            loop: for (Pair<Node,Node> p1 : nodePairs) {
-                for (Pair<Node,Node> p2 : nodePairs2) {
-                    if (null!=Geometry.getSegmentSegmentIntersection(
-                            p1.a.getEastNorth(),p1.b.getEastNorth(),
-                            p2.a.getEastNorth(),p2.b.getEastNorth())) {
-                            newWays.add(anyway);
-                            count++;
-                            break loop;
+            loop: for (Pair<Node, Node> p1 : nodePairs) {
+                for (Pair<Node, Node> p2 : nodePairs2) {
+                    if (null != Geometry.getSegmentSegmentIntersection(
+                            p1.a.getEastNorth(), p1.b.getEastNorth(),
+                            p2.a.getEastNorth(), p2.b.getEastNorth())) {
+                        newWays.add(anyway);
+                        count++;
+                        break loop;
                     }
                 }
@@ -126,20 +126,19 @@
     }
 
-
-        static int addWaysIntersectingWay(Collection<Way> ways, Way w, Set<Way> newWays) {
+    static int addWaysIntersectingWay(Collection<Way> ways, Way w, Set<Way> newWays) {
         List<Pair<Node, Node>> nodePairs = w.getNodePairs(false);
-        int count=0;
+        int count = 0;
         for (Way anyway: ways) {
             if (anyway == w) continue;
             if (newWays.contains(anyway)) continue;
             List<Pair<Node, Node>> nodePairs2 = anyway.getNodePairs(false);
-            loop: for (Pair<Node,Node> p1 : nodePairs) {
-                for (Pair<Node,Node> p2 : nodePairs2) {
-                    if (null!=Geometry.getSegmentSegmentIntersection(
-                            p1.a.getEastNorth(),p1.b.getEastNorth(),
-                            p2.a.getEastNorth(),p2.b.getEastNorth())) {
-                            newWays.add(anyway);
-                            count++;
-                            break loop;
+            loop: for (Pair<Node, Node> p1 : nodePairs) {
+                for (Pair<Node, Node> p2 : nodePairs2) {
+                    if (null != Geometry.getSegmentSegmentIntersection(
+                            p1.a.getEastNorth(), p1.b.getEastNorth(),
+                            p2.a.getEastNorth(), p2.b.getEastNorth())) {
+                        newWays.add(anyway);
+                        count++;
+                        break loop;
                     }
                 }
@@ -156,13 +155,13 @@
      */
     public static int addWaysIntersectingWays(Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
-        int count=0;
-        for (Way w : initWays){
-            count+=addWaysIntersectingWay(allWays, w, newWays);
+        int count = 0;
+        for (Way w : initWays) {
+            count += addWaysIntersectingWay(allWays, w, newWays);
         }
         return count;
     }
-    
+
     public static void addWaysConnectedToWays(Collection<Way> ways, Set<Way> newWays) {
-        for (Way w : ways){
+        for (Way w : ways) {
             NodeWayUtils.addWaysConnectedToWay(w, newWays);
         }
@@ -185,6 +184,5 @@
     }
 
-    public static void addWaysIntersectingWaysRecursively
-        (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
+    public static void addWaysIntersectingWaysRecursively(Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
         Set<Way> foundWays = new HashSet<>();
         foundWays.addAll(initWays);
@@ -192,54 +190,48 @@
         Set<Way> newFoundWays;
 
-        int level=0,c;
+        int level = 0, c;
         do {
-             c=0;
-             newFoundWays = new HashSet<>();
-             for (Way w : foundWays){
-                  c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays);
-             }
-             foundWays = newFoundWays;
-             newWays.addAll(newFoundWays);
-             level++;
-//                 System.out.printf("%d: %d ways added to selection intersectiong\n",level,c);
-             if (c>maxWays1) {
-                    new Notification(
-                        tr("Too many ways are added: {0}!",c)
-                        ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
-                   return;
-             }
-        } while ( c >0 && level < maxLevel );
-    }
-
-    public static void addWaysConnectedToWaysRecursively
-            (Collection<Way> initWays, Set<Way> newWays)
-    {
-        //long t = System.currentTimeMillis();
-        int level=0,c;
+            c = 0;
+            newFoundWays = new HashSet<>();
+            for (Way w : foundWays) {
+                c += addWaysIntersectingWay(allWays, w, newFoundWays, newWays);
+            }
+            foundWays = newFoundWays;
+            newWays.addAll(newFoundWays);
+            level++;
+            if (c > maxWays1) {
+                new Notification(
+                        tr("Too many ways are added: {0}!", c)
+                        ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                return;
+            }
+        } while (c > 0 && level < maxLevel);
+    }
+
+    public static void addWaysConnectedToWaysRecursively(Collection<Way> initWays, Set<Way> newWays) {
+        int level = 0, c;
         newWays.addAll(initWays);
         do {
-             c=0;
-             Set<Way> foundWays = new HashSet<>();
-             foundWays.addAll(newWays);
-             for (Way w : foundWays){
-                  c+=addWaysConnectedToWay(w, newWays);
-             }
-             level++;
-//                 System.out.printf("%d: %d ways added to selection\n",level,c);
-             if (c>maxWays) {
+            c = 0;
+            Set<Way> foundWays = new HashSet<>();
+            foundWays.addAll(newWays);
+            for (Way w : foundWays) {
+                c += addWaysConnectedToWay(w, newWays);
+            }
+            level++;
+            if (c > maxWays) {
                 new Notification(
-                    tr("Too many ways are added: {0}!",c)
-                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();                       
-               return;
-             }
-        } while ( c >0 && level < maxLevel );
-       // System.out.println("time = "+(System.currentTimeMillis()-t)+" ways = "+newWays.size());
+                        tr("Too many ways are added: {0}!", c)
+                        ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                return;
+            }
+        } while (c > 0 && level < maxLevel);
     }
 
     static void addMiddle(Set<Node> selectedNodes, Set<Node> newNodes) {
-        Iterator<Node> it=selectedNodes.iterator();
+        Iterator<Node> it = selectedNodes.iterator();
         Node n1 = it.next();
         Node n2 = it.next();
-        Set<Way> ways=new HashSet<>();
+        Set<Way> ways = new HashSet<>();
         ways.addAll(OsmPrimitive.getFilteredList(n1.getReferrers(), Way.class));
         for (Way w: ways) {
@@ -247,39 +239,41 @@
             if (w.isUsable() && w.containsNode(n2) && w.containsNode(n1)) {
                 // Way w goes from n1 to n2
-                List <Node> nodes= w.getNodes();
+                List<Node> nodes = w.getNodes();
                 int i1 = nodes.indexOf(n1);
                 int i2 = nodes.indexOf(n2);
                 int n = nodes.size();
-                if (i1>i2) { int p=i2; i2=i1; i1=p; } // now i1<i2
+                if (i1 > i2) {
+                    int p = i2; i2 = i1; i1 = p; // now i1<i2
+                }
                 if (w.isClosed()) {
-                        if ((i2-i1)*2 <= n ) { // i1 ... i2
-                            for (int i=i1+1;i!=i2; i++) {
-                                newNodes.add(nodes.get(i));
-                            }
-                        } else { // i2 ... n-1 0 1 ... i1
-                            for (int i=i2+1;i!=i1; i=(i+1)%n) {
-                                newNodes.add(nodes.get(i));
-                            }
-                        }
-                    } else {
-                        for (int i=i1+1;i<i2;i++) {
+                    if ((i2-i1)*2 <= n) { // i1 ... i2
+                        for (int i = i1+1; i != i2; i++) {
                             newNodes.add(nodes.get(i));
                         }
-                    }
+                    } else { // i2 ... n-1 0 1 ... i1
+                        for (int i = i2+1; i != i1; i = (i+1) % n) {
+                            newNodes.add(nodes.get(i));
+                        }
+                    }
+                } else {
+                    for (int i = i1+1; i < i2; i++) {
+                        newNodes.add(nodes.get(i));
+                    }
+                }
             }
         }
         if (newNodes.isEmpty()) {
-                new Notification(
+            new Notification(
                     tr("Please select two nodes connected by way!")
-                ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
-            }
-    }
-    
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+        }
+    }
+
     static boolean addAreaBoundary(Way firstWay, Set<Way> newWays, boolean goingLeft) {
-        Way w=firstWay;
+        Way w = firstWay;
         Node curNode = w.lastNode();
         Node prevNode = w.getNode(w.getNodes().size()-2);
         Set<Way> newestWays = new HashSet<>();
-        while(true) {
+        while (true) {
 
             Node nextNode, endNode, otherEnd, preLast;
@@ -287,36 +281,36 @@
 
             EastNorth en;
-            double startHeading,bestAngle;
+            double startHeading, bestAngle;
 
             en = curNode.getEastNorth();
-            startHeading = prevNode.getEastNorth().heading( en );
-
-            bestAngle = goingLeft ? -1e5 : 1e5 ;
-            otherEnd=null; nextWay=null;
-            
+            startHeading = prevNode.getEastNorth().heading(en);
+
+            bestAngle = goingLeft ? -1e5 : 1e5;
+            otherEnd = null;
+            nextWay = null;
+
             for (OsmPrimitive ref : curNode.getReferrers()) {
-                if (ref instanceof Way && ref!=w && ref.isSelectable()) {
+                if (ref instanceof Way && ref != w && ref.isSelectable()) {
                     //
                     Way w2 = (Way) ref;
                     //  -----[prevNode]-(curNode)-[nextNode]------[preLast]-(endNode)
                     //          w           |              w2
-                    if (w2.getNodesCount()<2 || w2.isClosed()) continue;
-
+                    if (w2.getNodesCount() < 2 || w2.isClosed()) continue;
 
                     if (curNode == w2.firstNode()) {
                         nextNode = w2.getNode(1);
                         preLast = w2.getNode(w2.getNodesCount()-2);
-                        endNode = w2.lastNode();
-                    } // forward direction
-                    else if (curNode == w2.lastNode()) {
+                        endNode = w2.lastNode(); // forward direction
+                    } else if (curNode == w2.lastNode()) {
                         nextNode = w2.getNode(w2.getNodesCount()-2);
                         preLast = w2.getNode(1);
-                        endNode = w2.firstNode();
-                    } // backward direction
-                        else continue; // we came to some way middle node
+                        endNode = w2.firstNode(); // backward direction
+                    } else continue; // we came to some way middle node
 
                     double angle = startHeading -Math.PI - en.heading(nextNode.getEastNorth());
-                    while (angle<0) angle+=2*Math.PI;
-                    
+                    while (angle < 0) {
+                        angle += 2*Math.PI;
+                    }
+
                     if (angle < bestAngle ^ goingLeft) {
                         bestAngle = angle;
@@ -327,9 +321,9 @@
                 }
             }
-            if (firstWay == nextWay ) {
-                //we came to starting way, but not not the right end 
-                if (otherEnd==firstWay.firstNode()) return false;
+            if (firstWay == nextWay) {
+                //we came to starting way, but not not the right end
+                if (otherEnd == firstWay.firstNode()) return false;
                 newWays.addAll(newestWays);
-                return true; // correct loop found 
+                return true; // correct loop found
             }
             if (newestWays.contains(nextWay)) {
@@ -337,5 +331,5 @@
                 return false;
             }
-            if (nextWay != null) { 
+            if (nextWay != null) {
                 newestWays.add(nextWay);
                 curNode = otherEnd;
@@ -345,13 +339,13 @@
                 // no closed loop found
                 return false;
-            } 
-        }
-    }
-    
+            }
+        }
+    }
+
     static boolean isPointInsideMultipolygon(EastNorth p, Relation rel) {
         Set<Way> usedWays = OsmPrimitive.getFilteredSet(rel.getMemberPrimitives(), Way.class);
         return isPointInsidePolygon(p, buildPointList(usedWays));
     }
-            
+
     static void addAllInsideMultipolygon(DataSet data, Relation rel, Set<Way> newWays, Set<Node> newNodes) {
         if (!rel.isMultipolygon()) return;
@@ -359,5 +353,5 @@
         Collection<Way> usedWays = rel.getMemberPrimitives(Way.class);
         List<EastNorth> polyPoints = buildPointList(usedWays);
-       
+
         List<Node> searchNodes = data.searchNodes(box);
         Set<Node> newestNodes = new HashSet<>();
@@ -369,5 +363,5 @@
             }
         }
-        
+
         List<Way> searchWays = data.searchWays(box);
         for (Way w : searchWays) {
@@ -380,5 +374,5 @@
             // do not select nodes of already selected ways
         }
-        
+
         newNodes.addAll(newestNodes);
         newWays.addAll(newestWays);
@@ -389,5 +383,5 @@
         BBox box = way.getBBox();
         Iterable<EastNorth> polyPoints = getWayPoints(way);
-        
+
         List<Node> searchNodes = data.searchNodes(box);
         Set<Node> newestNodes = new HashSet<>();
@@ -399,5 +393,5 @@
             }
         }
-        
+
         List<Way> searchWays = data.searchWays(box);
         for (Way w : searchWays) {
@@ -406,13 +400,13 @@
             }
         }
-        
+
         newNodes.addAll(newestNodes);
         newWays.addAll(newestWays);
     }
-    
+
     public static boolean isPointInsidePolygon(EastNorth point, Iterable<EastNorth> polygonPoints) {
         int n = getRayIntersectionsCount(point, polygonPoints);
-        if (n<0) return true; // we are near node or near edge
-        return (n%2==1);
+        if (n < 0) return true; // we are near node or near edge
+        return (n % 2 == 1);
     }
 
@@ -423,41 +417,41 @@
      */
     public static int getRayIntersectionsCount(EastNorth point, Iterable<EastNorth> polygonPoints) {
-        if (point==null) return 0;
+        if (point == null) return 0;
         EastNorth oldPoint = null;
-        double n1,n2,n3,e1,e2,e3,d;
-        int interCount=0;
-        
+        double n1, n2, n3, e1, e2, e3, d;
+        int interCount = 0;
+
         for (EastNorth curPoint : polygonPoints) {
-            if (oldPoint==null || curPoint==null) {
+            if (oldPoint == null || curPoint == null) {
                 oldPoint = curPoint;
                 continue;
             }
-            n1 = curPoint.north(); n2 = oldPoint.north();  n3 =  point.north();
-            e1 = curPoint.east(); e2 = oldPoint.east();  e3 =  point.east();
-            
-            if (Math.abs(n1-n3)<1e-5 && Math.abs(e1-e3)<1e-5) return -3; // vertex
-            if (Math.abs(n2-n3)<1e-5 && Math.abs(e2-e3)<1e-5) return -3; // vertex
-            
+            n1 = curPoint.north(); n2 = oldPoint.north(); n3 = point.north();
+            e1 = curPoint.east(); e2 = oldPoint.east(); e3 = point.east();
+
+            if (Math.abs(n1-n3) < 1e-5 && Math.abs(e1-e3) < 1e-5) return -3; // vertex
+            if (Math.abs(n2-n3) < 1e-5 && Math.abs(e2-e3) < 1e-5) return -3; // vertex
+
             // looking at oldPoint-curPoint segment
-            if ( n1 > n2) {
+            if (n1 > n2) {
                 if (n1 > n3 && n3 >= n2) {
-                    n1-=n3; n2-=n3; e1-=e3; e2-=e3;
+                    n1 -= n3; n2 -= n3; e1 -= e3; e2 -= e3;
                     d = e1*n2 - n1*e2;
-                    if (d<-1e-5) {
-                        interCount++; // there is OX intersecthion at e = (e1n2-e2n1)/(n2-n1) >=0
-                    } else if (d<=1e-5) return -2; // boundary detected
+                    if (d < -1e-5) {
+                        interCount++; // there is OX intersecthion at e = (e1n2-e2n1)/(n2-n1) >= 0
+                    } else if (d <= 1e-5) return -2; // boundary detected
                 }
             } else if (n1 == n2) {
                 if (n1 == n3) {
-                    e1-=e3; e2-=e3;
-                    if ((e1 <=0 && e2 >= 0) || (e1 >=0 && e2 <= 0)) return -2;// boundary detected
+                    e1 -= e3; e2 -= e3;
+                    if ((e1 <= 0 && e2 >= 0) || (e1 >= 0 && e2 <= 0)) return -2; // boundary detected
                 }
             } else {
                 if (n1 <= n3 && n3 < n2) {
-                    n1-=n3; n2-=n3; e1-=e3; e2-=e3;
+                    n1 -= n3; n2 -= n3; e1 -= e3; e2 -= e3;
                     d = e1*n2 - n1*e2;
-                    if (d>1e-5) {
-                        interCount++; // there is OX intersecthion at e = (e1n2-e2n1)/(n2-n1) >=0
-                    } else if (d>=-1e-5) return -2; // boundary detected
+                    if (d > 1e-5) {
+                        interCount++; // there is OX intersecthion at e = (e1n2-e2n1)/(n2-n1) >= 0
+                    } else if (d >= -1e-5) return -2; // boundary detected
                 }
             }
@@ -467,9 +461,9 @@
         return interCount;
     }
-    
+
     public static Collection<OsmPrimitive> selectAllInside(Collection<OsmPrimitive> selected, DataSet dataset) {
         return selectAllInside(selected, dataset, true);
     }
-    
+
     public static Collection<OsmPrimitive> selectAllInside(Collection<OsmPrimitive> selected, DataSet dataset, boolean ignoreNodesOfFoundWays) {
         Set<Way> selectedWays = OsmPrimitive.getFilteredSet(selected, Way.class);
@@ -488,10 +482,10 @@
         if (!selectedWays.isEmpty()) {
             for (Way w: selectedWays) {
-                addAllInsideWay(dataset,w,newWays,newNodes);
+                addAllInsideWay(dataset, w, newWays, newNodes);
             }
         }
         if (!selectedRels.isEmpty()) {
             for (Relation r: selectedRels) {
-                addAllInsideMultipolygon(dataset,r,newWays,newNodes);
+                addAllInsideMultipolygon(dataset, r, newWays, newNodes);
             }
         }
@@ -500,7 +494,7 @@
                 newNodes.removeAll(w.getNodes());
                 // do not select nodes of already selected ways
-            }            
-        }
-        
+            }
+        }
+
         Set<OsmPrimitive> insideSelection = new HashSet<>();
         if (!newWays.isEmpty() || !newNodes.isEmpty()) {
@@ -521,5 +515,5 @@
         return points;
     }
-    
+
     public static Iterable<EastNorth> getWayPoints(final Way w) {
         return new Iterable<EastNorth>() {
@@ -531,7 +525,9 @@
                         return idx < w.getNodesCount();
                     }
+
                     @Override public EastNorth next() {
                         return w.getNode(idx++).getEastNorth();
                     }
+
                     @Override public void remove() {
                         throw new UnsupportedOperationException();
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectAllInsideAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectAllInsideAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectAllInsideAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -18,5 +18,5 @@
 
 /**
- *    Extends current selection by selecting nodes on all touched ways
+ * Extends current selection by selecting nodes on all touched ways
  */
 public class SelectAllInsideAction extends JosmAction {
@@ -24,21 +24,21 @@
     public SelectAllInsideAction() {
         super(tr("All inside [testing]"), "selinside", tr("Select all inside selected polygons"),
-                Shortcut.registerShortcut("tools:selinside", tr("Tool: {0}","All inside"),
-                KeyEvent.VK_I, Shortcut.ALT_SHIFT), true);
+                Shortcut.registerShortcut("tools:selinside", tr("Tool: {0}", "All inside"),
+                        KeyEvent.VK_I, Shortcut.ALT_SHIFT), true);
         putValue("help", ht("/Action/SelectAllInside"));
     }
-    
+
     @Override
     public void actionPerformed(ActionEvent e) {
         DataSet ds = getLayerManager().getEditDataSet();
         Collection<OsmPrimitive> insideSelected = NodeWayUtils.selectAllInside(ds.getSelected(), ds, true);
-        
+
         if (!insideSelected.isEmpty()) {
             ds.addSelected(insideSelected);
-        } else{
+        } else {
             new Notification(
-                tr("Nothing found. Please select some closed ways or multipolygons to find all primitives inside them!"))
-                .setIcon(JOptionPane.WARNING_MESSAGE)
-                .show();  
+                    tr("Nothing found. Please select some closed ways or multipolygons to find all primitives inside them!"))
+            .setIcon(JOptionPane.WARNING_MESSAGE)
+            .show();
         }
     }
@@ -57,5 +57,3 @@
         setEnabled(!selection.isEmpty());
     }
-
-
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java	(revision 32410)
@@ -1,9 +1,9 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
-import java.awt.Point;
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Point;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -13,6 +13,6 @@
 
 import javax.swing.JOptionPane;
+
 import org.openstreetmap.josm.Main;
-
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.SelectByInternalPointAction;
@@ -21,9 +21,8 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
-
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Extends current selection by selecting nodes on all touched ways
+ * Extends current selection by selecting nodes on all touched ways
  */
 public class SelectBoundaryAction extends JosmAction {
@@ -33,6 +32,6 @@
     public SelectBoundaryAction() {
         super(tr("Area boundary [testing]"), "selboundary", tr("Select relation or all ways that forms area boundary"),
-                Shortcut.registerShortcut("tools:selboundary", tr("Tool: {0}","Area boundary [testing]"),
-                KeyEvent.VK_SLASH, Shortcut.SHIFT), true);
+                Shortcut.registerShortcut("tools:selboundary", tr("Tool: {0}", "Area boundary [testing]"),
+                        KeyEvent.VK_SLASH, Shortcut.SHIFT), true);
         putValue("help", ht("/Action/SelectAreaBoundary"));
     }
@@ -42,15 +41,14 @@
         Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getLayerManager().getEditDataSet().getSelected(), Way.class);
         Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(getLayerManager().getEditDataSet().getSelected(), Node.class);
-        
+
         Set<Way> newWays = new HashSet<>();
-        
-        Way w=null;
-        
+
+        Way w = null;
+
         if (selectedWays.isEmpty()) {
-            if (selectedNodes.size()==1 ) {
+            if (selectedNodes.size() == 1) {
                 for (OsmPrimitive p : selectedNodes.iterator().next().getReferrers()) {
                     if (p instanceof Way && p.isSelectable()) {
-                        //if (w!=null) return; // if we want only one way
-                        w=(Way) p;
+                        w = (Way) p;
                         break;
                     }
@@ -61,30 +59,30 @@
                 return;
             }
-        } else if (selectedWays.size()==1)  {
+        } else if (selectedWays.size() == 1) {
             w = selectedWays.iterator().next();
-        } else if (selectedWays.contains(lastUsedStartingWay)) { 
-            w=lastUsedStartingWay; //repeated call for selected way
+        } else if (selectedWays.contains(lastUsedStartingWay)) {
+            w = lastUsedStartingWay; //repeated call for selected way
             lastUsedLeft = !lastUsedLeft;
         }
 
-        
-        if (w==null) return; //no starting way found
+
+        if (w == null) return; //no starting way found
         if (!w.isSelectable()) return;
         if (w.isClosed()) return;
-        if (w.getNodesCount()<2) return;
+        if (w.getNodesCount() < 2) return;
 
         newWays.add(w);
         lastUsedStartingWay = w;
-                       
+
         // try going left at each turn
-        if (! NodeWayUtils.addAreaBoundary(w, newWays, lastUsedLeft) ) {
+        if (!NodeWayUtils.addAreaBoundary(w, newWays, lastUsedLeft)) {
             NodeWayUtils.addAreaBoundary(w, newWays, !lastUsedLeft); // try going right at each turn
         }
-        
-        if (!newWays.isEmpty() ) {
+
+        if (!newWays.isEmpty()) {
             getLayerManager().getEditDataSet().setSelected(newWays);
-        } else{
+        } else {
             new Notification(tr("Nothing found. Please select way that is a part of some polygon formed by connected ways"))
-                .setIcon(JOptionPane.WARNING_MESSAGE).show();            
+            .setIcon(JOptionPane.WARNING_MESSAGE).show();
         }
     }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: PD
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -28,5 +28,5 @@
  * Select all connected ways for a street if one way is selected (determine by name/ref),
  * select highway ways between two selected ways.
- * 
+ *
  * @author zverik
  */
@@ -35,6 +35,6 @@
     public SelectHighwayAction() {
         super(tr("Select Highway"), "selecthighway", tr("Select highway for the name/ref given"),
-                Shortcut.registerShortcut("tools:selecthighway", tr("Tool: {0}","Select Highway"),
-                KeyEvent.VK_W, Shortcut.ALT_CTRL), true);
+                Shortcut.registerShortcut("tools:selecthighway", tr("Tool: {0}", "Select Highway"),
+                        KeyEvent.VK_W, Shortcut.ALT_CTRL), true);
     }
 
@@ -44,26 +44,26 @@
         List<Way> selectedWays = OsmPrimitive.getFilteredList(ds.getSelected(), Way.class);
 
-        if( selectedWays.size() == 1 ) {
+        if (selectedWays.size() == 1) {
             ds.setSelected(selectNamedRoad(selectedWays.get(0)));
-        } else if( selectedWays.size() == 2 ) {
+        } else if (selectedWays.size() == 2) {
             ds.setSelected(selectHighwayBetween(selectedWays.get(0), selectedWays.get(1)));
         } else {
             new Notification(
-                tr("Please select one or two ways for this action")
-            ).setIcon(JOptionPane.WARNING_MESSAGE).show();
-        }
-    }
-
-    private Set<Way> selectNamedRoad( Way firstWay ) {
+                    tr("Please select one or two ways for this action")
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();
+        }
+    }
+
+    private Set<Way> selectNamedRoad(Way firstWay) {
         Set<Way> newWays = new HashSet<>();
         String key = firstWay.hasKey("name") ? "name" : "ref";
-        if( firstWay.hasKey(key) ) {
+        if (firstWay.hasKey(key)) {
             String value = firstWay.get(key);
             Queue<Node> nodeQueue = new LinkedList<>();
             nodeQueue.add(firstWay.firstNode());
-            while( !nodeQueue.isEmpty() ) {
+            while (!nodeQueue.isEmpty()) {
                 Node node = nodeQueue.remove();
-                for( Way p : OsmPrimitive.getFilteredList(node.getReferrers(), Way.class) ) {
-                    if( !newWays.contains(p) && p.hasKey(key) && p.get(key).equals(value) ) {
+                for (Way p : OsmPrimitive.getFilteredList(node.getReferrers(), Way.class)) {
+                    if (!newWays.contains(p) && p.hasKey(key) && p.get(key).equals(value)) {
                         newWays.add(p);
                         nodeQueue.add(p.firstNode().equals(node) ? p.lastNode() : p.firstNode());
@@ -74,42 +74,42 @@
         return newWays;
     }
-    
-    private Set<Way> selectHighwayBetween( Way firstWay, Way lastWay ) {
+
+    private Set<Way> selectHighwayBetween(Way firstWay, Way lastWay) {
         int minRank = Math.min(getHighwayRank(firstWay), getHighwayRank(lastWay));
-	HighwayTree firstTree = new HighwayTree(firstWay, minRank);
-	HighwayTree secondTree = new HighwayTree(lastWay, minRank);
-	Way intersection = firstTree.getIntersection(secondTree);
-	while( intersection == null && (firstTree.canMoveOn() || secondTree.canMoveOn()) ) {
-	    firstTree.processNextLevel();
-	    secondTree.processNextLevel();
-	    intersection = firstTree.getIntersection(secondTree);
-	}
-	Set<Way> newWays = new HashSet<>();
-	newWays.addAll(firstTree.getPath(intersection));
-	newWays.addAll(secondTree.getPath(intersection));
-	return newWays;
-    }
-    
-    private static int getHighwayRank( OsmPrimitive way ) {
-        if( !way.hasKey("highway") )
+        HighwayTree firstTree = new HighwayTree(firstWay, minRank);
+        HighwayTree secondTree = new HighwayTree(lastWay, minRank);
+        Way intersection = firstTree.getIntersection(secondTree);
+        while (intersection == null && (firstTree.canMoveOn() || secondTree.canMoveOn())) {
+            firstTree.processNextLevel();
+            secondTree.processNextLevel();
+            intersection = firstTree.getIntersection(secondTree);
+        }
+        Set<Way> newWays = new HashSet<>();
+        newWays.addAll(firstTree.getPath(intersection));
+        newWays.addAll(secondTree.getPath(intersection));
+        return newWays;
+    }
+
+    private static int getHighwayRank(OsmPrimitive way) {
+        if (!way.hasKey("highway"))
             return 0;
         String highway = way.get("highway");
-        if( highway.equals("path") || highway.equals("footway") || highway.equals("cycleway") )
+        if (highway.equals("path") || highway.equals("footway") || highway.equals("cycleway"))
             return 1;
-        else if( highway.equals("track") || highway.equals("service") )
+        else if (highway.equals("track") || highway.equals("service"))
             return 2;
-        else if( highway.equals("unclassified") || highway.equals("residential") )
+        else if (highway.equals("unclassified") || highway.equals("residential"))
             return 3;
-        else if( highway.equals("tertiary") || highway.equals("tertiary_link") )
+        else if (highway.equals("tertiary") || highway.equals("tertiary_link"))
             return 4;
-        else if( highway.equals("secondary") || highway.equals("secondary_link") )
+        else if (highway.equals("secondary") || highway.equals("secondary_link"))
             return 5;
-        else if( highway.equals("primary") || highway.equals("primary_link") )
+        else if (highway.equals("primary") || highway.equals("primary_link"))
             return 6;
-        else if( highway.equals("trunk") || highway.equals("trunk_link") || highway.equals("motorway") || highway.equals("motorway_link") )
+        else if (highway.equals("trunk") || highway.equals("trunk_link") || highway.equals("motorway") || highway.equals("motorway_link"))
             return 7;
         return 0;
     }
-    
+
     @Override
     protected void updateEnabledState() {
@@ -124,6 +124,6 @@
         }
         int count = 0, rank = 100;
-        for( OsmPrimitive p : selection ) {
-            if( p instanceof Way ) {
+        for (OsmPrimitive p : selection) {
+            if (p instanceof Way) {
                 count++;
                 rank = Math.min(rank, getHighwayRank(p));
@@ -132,75 +132,76 @@
         setEnabled(count == 1 || (count == 2 && rank > 0));
     }
-    
+
     private static class HighwayTree {
-	private List<Way> tree;
-	private List<Integer> refs;
-	private List<Node> nodesToCheck;
-	private List<Integer> nodeRefs;
-	private int minHighwayRank;
-
-	public HighwayTree( Way from, int minHighwayRank ) {
-	    tree = new ArrayList<>(1);
-	    refs = new ArrayList<>(1);
-	    tree.add(from);
-	    refs.add(Integer.valueOf(-1));
-	    this.minHighwayRank = minHighwayRank;
-	    nodesToCheck = new ArrayList<>(2);
-	    nodeRefs = new ArrayList<>(2);
-	    nodesToCheck.add(from.firstNode());
-	    nodesToCheck.add(from.lastNode());
-	    nodeRefs.add(Integer.valueOf(0));
-	    nodeRefs.add(Integer.valueOf(0));
-	}
-	
-	public void processNextLevel() {
-	    List<Node> newNodes = new ArrayList<>();
-	    List<Integer> newIdx = new ArrayList<>();
-	    for( int i = 0; i < nodesToCheck.size(); i++ ) {
-		Node node = nodesToCheck.get(i);
-		Integer nodeRef = nodeRefs.get(i);
-                for( Way way : OsmPrimitive.getFilteredList(node.getReferrers(), Way.class) ) {
-		    if( (way.firstNode().equals(node) || way.lastNode().equals(node)) &&
-			!tree.contains(way) && suits(way) ) {
-			tree.add(way);
-			refs.add(nodeRef);
-			Node newNode = way.firstNode().equals(node) ? way.lastNode() : way.firstNode();
-			newNodes.add(newNode);
-			newIdx.add(Integer.valueOf(tree.size() - 1));
-		    }
-		}
-	    }
-	    nodesToCheck = newNodes;
-	    nodeRefs = newIdx;
-	}
-	
-	private boolean suits( Way w ) {
-	    return getHighwayRank(w) >= minHighwayRank;
-	}
-	
-	public boolean canMoveOn() {
-	    return !nodesToCheck.isEmpty() && tree.size() < 10000;
-	}
-	
-	public Way getIntersection( HighwayTree other ) {
-	    for( Way w : other.tree )
-		if( tree.contains(w) )
-		    return w;
-	    return null;
-	}
-	
-	public List<Way> getPath( Way to ) {
-	    if( to == null )
-		return Collections.singletonList(tree.get(0));
-	    int pos = tree.indexOf(to);
-	    if( pos < 0 )
-		throw new ArrayIndexOutOfBoundsException("Way " + to + " is not in the tree.");
-	    List<Way> result = new ArrayList<>(1);
-	    while( pos >= 0 ) {
-		result.add(tree.get(pos));
-		pos = refs.get(pos);
-	    }
-	    return result;
-	}
+        private List<Way> tree;
+        private List<Integer> refs;
+        private List<Node> nodesToCheck;
+        private List<Integer> nodeRefs;
+        private int minHighwayRank;
+
+        HighwayTree(Way from, int minHighwayRank) {
+            tree = new ArrayList<>(1);
+            refs = new ArrayList<>(1);
+            tree.add(from);
+            refs.add(Integer.valueOf(-1));
+            this.minHighwayRank = minHighwayRank;
+            nodesToCheck = new ArrayList<>(2);
+            nodeRefs = new ArrayList<>(2);
+            nodesToCheck.add(from.firstNode());
+            nodesToCheck.add(from.lastNode());
+            nodeRefs.add(Integer.valueOf(0));
+            nodeRefs.add(Integer.valueOf(0));
+        }
+
+        public void processNextLevel() {
+            List<Node> newNodes = new ArrayList<>();
+            List<Integer> newIdx = new ArrayList<>();
+            for (int i = 0; i < nodesToCheck.size(); i++) {
+                Node node = nodesToCheck.get(i);
+                Integer nodeRef = nodeRefs.get(i);
+                for (Way way : OsmPrimitive.getFilteredList(node.getReferrers(), Way.class)) {
+                    if ((way.firstNode().equals(node) || way.lastNode().equals(node)) &&
+                            !tree.contains(way) && suits(way)) {
+                        tree.add(way);
+                        refs.add(nodeRef);
+                        Node newNode = way.firstNode().equals(node) ? way.lastNode() : way.firstNode();
+                        newNodes.add(newNode);
+                        newIdx.add(Integer.valueOf(tree.size() - 1));
+                    }
+                }
+            }
+            nodesToCheck = newNodes;
+            nodeRefs = newIdx;
+        }
+
+        private boolean suits(Way w) {
+            return getHighwayRank(w) >= minHighwayRank;
+        }
+
+        public boolean canMoveOn() {
+            return !nodesToCheck.isEmpty() && tree.size() < 10000;
+        }
+
+        public Way getIntersection(HighwayTree other) {
+            for (Way w : other.tree) {
+                if (tree.contains(w))
+                    return w;
+            }
+            return null;
+        }
+
+        public List<Way> getPath(Way to) {
+            if (to == null)
+                return Collections.singletonList(tree.get(0));
+            int pos = tree.indexOf(to);
+            if (pos < 0)
+                throw new ArrayIndexOutOfBoundsException("Way " + to + " is not in the tree.");
+            List<Way> result = new ArrayList<>(1);
+            while (pos >= 0) {
+                result.add(tree.get(pos));
+                pos = refs.get(pos);
+            }
+            return result;
+        }
     }
 }
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java	(revision 32410)
@@ -1,6 +1,5 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
-import org.openstreetmap.josm.command.Command;
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -11,12 +10,15 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Unselects all nodes
+ * Unselects all nodes
  */
 public class SelectModNodesAction extends JosmAction {
@@ -27,38 +29,36 @@
         super(tr("Select last modified nodes"), "selmodnodes",
                 tr("Select last modified nodes"),
-                Shortcut.registerShortcut("tools:selmodnodes", tr("Tool: {0}","Select last modified nodes"),
-                KeyEvent.VK_Z, Shortcut.SHIFT), true);
+                Shortcut.registerShortcut("tools:selmodnodes", tr("Tool: {0}", "Select last modified nodes"),
+                        KeyEvent.VK_Z, Shortcut.SHIFT), true);
         putValue("help", ht("/Action/SelectLastModifiedNodes"));
     }
 
     @Override
-     public void actionPerformed(ActionEvent e) {
+    public void actionPerformed(ActionEvent e) {
         DataSet ds = getLayerManager().getEditDataSet();
         Collection<OsmPrimitive> selection = ds.getSelected();
         Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class);
         ds.clearSelection(selectedNodes);
-        Command cmd =null;
+        Command cmd = null;
 
         if (Main.main.undoRedo.commands == null) return;
-        int num=Main.main.undoRedo.commands.size();
-        if (num==0) return;
-        int k=0,idx;
-        if (selection!=null && !selection.isEmpty() && selection.hashCode() == lastHash) {
+        int num = Main.main.undoRedo.commands.size();
+        if (num == 0) return;
+        int k = 0, idx;
+        if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) {
             // we are selecting next command in history if nothing is selected
             idx = Main.main.undoRedo.commands.indexOf(lastCmd);
-           // System.out.println("My previous selection found "+idx);
         } else {
-            idx=num;
-           // System.out.println("last history item taken");
+            idx = num;
         }
 
         Set<Node> nodes = new HashSet<>(10);
         do {  //  select next history element
-            if (idx>0) idx--; else idx=num-1;
+            if (idx > 0) idx--; else idx = num-1;
             cmd = Main.main.undoRedo.commands.get(idx);
             Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives();
             nodes.clear();
-            for ( OsmPrimitive p : pp) {  // find all affected ways
-                if (p instanceof Node && !p.isDeleted()) nodes.add((Node)p);
+            for (OsmPrimitive p : pp) {  // find all affected ways
+                if (p instanceof Node && !p.isDeleted()) nodes.add((Node) p);
             }
             if (!nodes.isEmpty()) {
@@ -67,9 +67,9 @@
                 lastHash = ds.getSelected().hashCode();
                 return;
-                }
+            }
             k++;
             //System.out.println("no nodes found, previous...");
-        } while ( k < num ); // try to find previous command if this affects nothing
-        lastCmd=null; lastHash=0;
+        } while (k < num); // try to find previous command if this affects nothing
+        lastCmd = null; lastHash = 0;
     }
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java	(revision 32410)
@@ -1,4 +1,7 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
+
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.event.ActionEvent;
@@ -7,4 +10,5 @@
 import java.util.HashSet;
 import java.util.Set;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -14,10 +18,8 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
-import static org.openstreetmap.josm.tools.I18n.tr;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Unselects all nodes
+ * Unselects all nodes
  */
 public class SelectModWaysAction extends JosmAction {
@@ -28,6 +30,6 @@
         super(tr("Select last modified ways"), "selmodways",
                 tr("Select last modified ways"),
-                Shortcut.registerShortcut("tools:selmodways", tr("Tool: {0}","Select last modified ways"),
-                KeyEvent.VK_Z,  Shortcut.ALT_SHIFT), true);
+                Shortcut.registerShortcut("tools:selmodways", tr("Tool: {0}", "Select last modified ways"),
+                        KeyEvent.VK_Z, Shortcut.ALT_SHIFT), true);
         putValue("help", ht("/Action/SelectLastModifiedWays"));
     }
@@ -42,24 +44,22 @@
 
         if (Main.main.undoRedo.commands == null) return;
-        int num=Main.main.undoRedo.commands.size();
-        if (num==0) return;
-        int k=0,idx;
-        if (selection!=null && !selection.isEmpty() && selection.hashCode() == lastHash) {
+        int num = Main.main.undoRedo.commands.size();
+        if (num == 0) return;
+        int k = 0, idx;
+        if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) {
             // we are selecting next command in history if nothing is selected
             idx = Main.main.undoRedo.commands.indexOf(lastCmd);
-           // System.out.println("My previous selection found "+idx);
         } else {
-            idx=num;
-           // System.out.println("last history item taken");
+            idx = num;
         }
 
         Set<Way> ways = new HashSet<>(10);
         do {  //  select next history element
-            if (idx>0) idx--; else idx=num-1;
+            if (idx > 0) idx--; else idx = num-1;
             cmd = Main.main.undoRedo.commands.get(idx);
             Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives();
             ways.clear();
-            for ( OsmPrimitive p : pp) {  // find all affected ways
-                if (p instanceof Way && !p.isDeleted()) ways.add((Way)p);
+            for (OsmPrimitive p : pp) {  // find all affected ways
+                if (p instanceof Way && !p.isDeleted()) ways.add((Way) p);
             }
             if (!ways.isEmpty() && !ds.getSelected().containsAll(ways)) {
@@ -68,8 +68,9 @@
                 lastHash = ds.getSelected().hashCode();
                 return;
-                }
+            }
             k++;
-        } while ( k < num ); // try to find previous command if this affects nothing
-        lastCmd=null; lastHash=0;
+        } while (k < num); // try to find previous command if this affects nothing
+        lastCmd = null;
+        lastHash = 0;
     }
 
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectWayNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectWayNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectWayNodesAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2010 by Hanno Hecker
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -18,7 +18,5 @@
 /**
  * Select all nodes of a selected way.
- *
  */
-
 public class SelectWayNodesAction extends JosmAction {
 
@@ -29,6 +27,7 @@
      */
     public SelectWayNodesAction() {
-        super(tr("Select Way Nodes"),"selectwaynodes" , tr("Select all nodes of a selected way."),
-                Shortcut.registerShortcut("tools:selectwaynodes", tr("Tool: {0}", tr("Select Way Nodes")), KeyEvent.VK_N, Shortcut.CTRL_SHIFT), true);
+        super(tr("Select Way Nodes"), "selectwaynodes", tr("Select all nodes of a selected way."),
+                Shortcut.registerShortcut("tools:selectwaynodes", tr("Tool: {0}", tr("Select Way Nodes")),
+                        KeyEvent.VK_N, Shortcut.CTRL_SHIFT), true);
         putValue("help", ht("/Action/SelectWayNodes"));
     }
@@ -50,6 +49,5 @@
                 }
                 selectWayNodes(w);
-            }
-            else if (p instanceof Node) {
+            } else if (p instanceof Node) {
                 Node n = (Node) p;
                 if (selectedNodes == null) {
@@ -59,5 +57,5 @@
             }
         }
-            
+
         getLayerManager().getEditDataSet().setSelected(selectedNodes);
         selectedNodes = null;
@@ -65,5 +63,5 @@
 
     private void selectWayNodes(Way w) {
-        
+
         for (Node n : w.getNodes()) {
             if (selectedNodes == null) {
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UndoSelectionAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UndoSelectionAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UndoSelectionAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -11,19 +11,20 @@
 import java.util.LinkedList;
 import java.util.Set;
+
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Shortcut;
 
 /**
- *    Use selection istory to restore previous selection
+ * Use selection istory to restore previous selection
  */
 public class UndoSelectionAction extends JosmAction {
-    
+
     public UndoSelectionAction() {
         super(tr("Undo selection"), "undoselection",
                 tr("Reselect last added object or selection form history"),
-                Shortcut.registerShortcut("tools:undoselection", tr("Tool: {0}","Undo selection"),
-                KeyEvent.VK_Z, Shortcut.CTRL_SHIFT), true);
+                Shortcut.registerShortcut("tools:undoselection", tr("Tool: {0}", "Undo selection"),
+                        KeyEvent.VK_Z, Shortcut.CTRL_SHIFT), true);
         putValue("help", ht("/Action/UndoSelection"));
     }
@@ -36,18 +37,18 @@
         DataSet ds = getLayerManager().getEditDataSet();
         LinkedList<Collection<? extends OsmPrimitive>> history = ds.getSelectionHistory();
-        if (history==null || history.isEmpty()) return; // empty history
-        int num=history.size();
-        
+        if (history == null || history.isEmpty()) return; // empty history
+        int num = history.size();
+
         Collection<OsmPrimitive> selection = ds.getSelected();
 
-        if (selection!= null &&  selection.hashCode() != myAutomaticSelectionHash) {
+        if (selection != null && selection.hashCode() != myAutomaticSelectionHash) {
             // manual selection or another pluging selection noticed
-            index=history.indexOf(lastSel);
+            index = history.indexOf(lastSel);
             // first is selected, next list is previous selection
         }
-        int k=0;
+        int k = 0;
         Set<OsmPrimitive> newsel = new HashSet<>();
         do {
-            if (index+1<history.size()) index++; else index=0;
+            if (index+1 < history.size()) index++; else index = 0;
             Collection<? extends OsmPrimitive> histsel = history.get(index);
             // remove deleted entities from selection
@@ -55,7 +56,7 @@
             newsel.addAll(histsel);
             newsel.retainAll(ds.allNonDeletedPrimitives());
-            if (newsel.size() > 0 ) break;
+            if (newsel.size() > 0) break;
             k++;
-        } while ( k < num );
+        } while (k < num);
 
         ds.setSelected(newsel);
Index: /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UnselectNodesAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UnselectNodesAction.java	(revision 32409)
+++ /applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UnselectNodesAction.java	(revision 32410)
@@ -1,3 +1,3 @@
-// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
@@ -9,7 +9,8 @@
 import java.util.Collection;
 import java.util.Set;
+
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.osm.*;
-
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -25,6 +26,6 @@
         super(tr("Unselect nodes"), "unsnodes",
                 tr("Removes all nodes from selection"),
-                Shortcut.registerShortcut("tools:unsnodes", tr("Tool: {0}","Unselect nodes"),
-                KeyEvent.VK_U, Shortcut.SHIFT), true);
+                Shortcut.registerShortcut("tools:unsnodes", tr("Tool: {0}", "Unselect nodes"),
+                        KeyEvent.VK_U, Shortcut.SHIFT), true);
         putValue("help", ht("/Action/UnselectNodes"));
     }
