Index: applications/editors/josm/plugins/tracer2/.checkstyle
===================================================================
--- applications/editors/josm/plugins/tracer2/.checkstyle	(revision 32788)
+++ applications/editors/josm/plugins/tracer2/.checkstyle	(revision 32788)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: applications/editors/josm/plugins/tracer2/.project
===================================================================
--- applications/editors/josm/plugins/tracer2/.project	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/.project	(revision 32788)
@@ -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/tracer2/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/tracer2/.settings/org.eclipse.jdt.ui.prefs	(revision 32788)
+++ applications/editors/josm/plugins/tracer2/.settings/org.eclipse.jdt.ui.prefs	(revision 32788)
@@ -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/tracer2/src/org/openstreetmap/josm/plugins/tracer2/ConnectWays.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/ConnectWays.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/ConnectWays.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -35,66 +18,72 @@
 import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.BBox;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.plugins.tracer2.preferences.ServerParam;
 import org.openstreetmap.josm.tools.Pair;
 
-public class ConnectWays {
-    static double s_dMinDistance		= 0.000006;		// Minimal distance, for objects
-    static double s_dMinDistanceN2N		= 0.0000005;	// Minimal distance, when nodes are merged
-    static double s_dMinDistanceN2oW	= 0.000001;		// Minimal distance, when node is connected to other way
-    static double s_dMinDistanceN2tW	= 0.000001;		// Minimal distance, when other node is connected this way
-    final static double MAX_ANGLE	= 30;				// Minimal angle, when other node is connected this way
-    
+public final class ConnectWays {
+
+    private ConnectWays() {
+        // Hide default constructor for utilities classes
+    }
+
+    // CHECKSTYLE.OFF: SingleSpaceSeparator
+    static double s_dMinDistance     = 0.000006;  // Minimal distance, for objects
+    static double s_dMinDistanceN2N  = 0.0000005; // Minimal distance, when nodes are merged
+    static double s_dMinDistanceN2oW = 0.000001;  // Minimal distance, when node is connected to other way
+    static double s_dMinDistanceN2tW = 0.000001;  // Minimal distance, when other node is connected this way
+    static final double MAX_ANGLE    = 30;        // Minimal angle, when other node is connected this way
+    // CHECKSTYLE.ON: SingleSpaceSeparator
+
     static Way s_oWay;
     static Way s_oWayOld;
     static List<Way> s_oWays;
     static List<Node> s_oNodes;
-    
+
     static ServerParam s_oParam;
     static boolean s_bCtrl;
     static boolean s_bAlt;
-    
+
     static boolean s_bAddNewWay;
-    
-    private static void calcDistance()
-    {
-    	double dTileSize = Double.parseDouble(s_oParam.getTileSize());
-    	double dResolution = Double.parseDouble(s_oParam.getResolution());
-    	double dMin = dTileSize / dResolution;
-    	
-    	s_dMinDistance = dMin * 30;
-    	s_dMinDistanceN2N = dMin * 2.5;
-    	s_dMinDistanceN2oW = dMin * 5;
-    	s_dMinDistanceN2tW = dMin * 5;
-    }
-    
+
+    private static void calcDistance() {
+        double dTileSize = Double.parseDouble(s_oParam.getTileSize());
+        double dResolution = Double.parseDouble(s_oParam.getResolution());
+        double dMin = dTileSize / dResolution;
+
+        s_dMinDistance = dMin * 30;
+        s_dMinDistanceN2N = dMin * 2.5;
+        s_dMinDistanceN2oW = dMin * 5;
+        s_dMinDistanceN2tW = dMin * 5;
+    }
+
     private static void getWays(Way way) {
-    	BBox bbox = new BBox(way);
-    	bbox.addPrimitive(way,s_dMinDistance);
+        BBox bbox = new BBox(way);
+        bbox.addPrimitive(way, s_dMinDistance);
         s_oWays = Main.getLayerManager().getEditDataSet().searchWays(bbox);
     }
-    
+
     private static List<Way> getWaysOfNode(Node node) {
-    	List<Way> ways;
-    	ways = OsmPrimitive.getFilteredList(node.getReferrers(), Way.class);
-    	return ways;
-    }
-    
+        List<Way> ways;
+        ways = OsmPrimitive.getFilteredList(node.getReferrers(), Way.class);
+        return ways;
+    }
+
     private static void getNodes(Way way) {
-    	BBox bbox = new BBox(way);
-    	bbox.addPrimitive(way,s_dMinDistance);
-    	s_oNodes = Main.getLayerManager().getEditDataSet().searchNodes(bbox);
-    }
-    
+        BBox bbox = new BBox(way);
+        bbox.addPrimitive(way, s_dMinDistance);
+        s_oNodes = Main.getLayerManager().getEditDataSet().searchNodes(bbox);
+    }
+
     private static double calcAlpha(LatLon oP1, Node n) {
-    	LatLon oP2 = n.getCoor();
-    	
-    	double dAlpha = Math.atan((oP2.getY() - oP1.getY()) / (oP2.getX() - oP1.getX())) * 180 / Math.PI + (oP1.getX() > oP2.getX() ? 180 : 0);
-    	return checkAlpha(dAlpha);
-    }
-    
+        LatLon oP2 = n.getCoor();
+
+        double dAlpha = Math.atan((oP2.getY() - oP1.getY()) / (oP2.getX() - oP1.getX())) * 180 / Math.PI + (oP1.getX() > oP2.getX() ? 180 : 0);
+        return checkAlpha(dAlpha);
+    }
+
     private static Double checkAlpha(Double dAlpha) {
         if (dAlpha > 180) {
@@ -106,38 +95,38 @@
         return dAlpha;
     }
-    
+
     private static boolean isNodeInsideWay(LatLon pos, Way way) {
-    	List<Node> listNode = way.getNodes();
-    	
-    	double dAlpha;
-    	double dAlphaOld = calcAlpha(pos, listNode.get(listNode.size()-1));
-    	double dSumAlpha = 0;
-    	
-    	for (Node n : listNode) {
-    		dAlpha = calcAlpha(pos, n);
-    		dSumAlpha += checkAlpha( dAlpha - dAlphaOld );
-    		dAlphaOld = dAlpha;
-    	}
-    	dSumAlpha = Math.abs(dSumAlpha);
-    	
-    	return dSumAlpha > 359 && dSumAlpha < 361;
-    }
-    
+        List<Node> listNode = way.getNodes();
+
+        double dAlpha;
+        double dAlphaOld = calcAlpha(pos, listNode.get(listNode.size()-1));
+        double dSumAlpha = 0;
+
+        for (Node n : listNode) {
+            dAlpha = calcAlpha(pos, n);
+            dSumAlpha += checkAlpha(dAlpha - dAlphaOld);
+            dAlphaOld = dAlpha;
+        }
+        dSumAlpha = Math.abs(dSumAlpha);
+
+        return dSumAlpha > 359 && dSumAlpha < 361;
+    }
+
     private static Way getOldWay(LatLon pos) {
-    	int i;
-    	
-    	for (i = 0; i < s_oWays.size(); i++) {
-    		Way way = s_oWays.get(i);
-    		if (!isSameTag(way)) {
-    			continue;
-    		}
-    		if (isNodeInsideWay(pos, way)) {
-    			s_oWays.remove(way);
-    			return way;
-    		}
-    	}
-    	return null;
-    }
-    
+        int i;
+
+        for (i = 0; i < s_oWays.size(); i++) {
+            Way way = s_oWays.get(i);
+            if (!isSameTag(way)) {
+                continue;
+            }
+            if (isNodeInsideWay(pos, way)) {
+                s_oWays.remove(way);
+                return way;
+            }
+        }
+        return null;
+    }
+
     /**
      * Try connect way to other buildings.
@@ -148,99 +137,92 @@
         LinkedList<Command> cmds = new LinkedList<>();
         LinkedList<Command> cmds2 = new LinkedList<>();
-        
+
         s_oParam = param;
         s_bCtrl = ctrl;
         s_bAlt = alt;
-        
+
         boolean bAddWay = false;
-        
+
         calcDistance();
         getNodes(newWay);
         getWays(newWay);
-        
+
         s_oWayOld = getOldWay(pos);
-        
+
         if (s_oWayOld == null) {
-        	s_bAddNewWay = true;
-        	//cmds.add(new AddCommand(newWay));
-        	bAddWay = true;
-        	s_oWayOld = newWay;
-        	s_oWay = new Way( newWay );
+            s_bAddNewWay = true;
+            //cmds.add(new AddCommand(newWay));
+            bAddWay = true;
+            s_oWayOld = newWay;
+            s_oWay = new Way(newWay);
         } else {
             int i;
             Way tempWay;
             s_bAddNewWay = false;
-            
+
             //Main.main.getCurrentDataSet().setSelected(m_wayOld);
-            
+
             tempWay = new Way(s_oWayOld);
-            
+
             for (i = 0; i < newWay.getNodesCount(); i++) {
-            	tempWay.addNode(tempWay.getNodesCount(), newWay.getNode(i));
+                tempWay.addNode(tempWay.getNodesCount(), newWay.getNode(i));
             }
             i++;
             for (i = 0; i < s_oWayOld.getNodesCount() - 1; i++) {
-            	tempWay.removeNode( s_oWayOld.getNode(i) );
+                tempWay.removeNode(s_oWayOld.getNode(i));
             }
             //cmds.add(new ChangeCommand(m_wayOld, tempWay));
             for (i = 0; i < s_oWayOld.getNodesCount() - 1; i++) {
-            	Node n = s_oWayOld.getNode(i);
-            	List<Way> ways = getWaysOfNode(n);
-            	if (ways.size()<=1) {
-                	cmds2.add(new DeleteCommand( s_oWayOld.getNode(i) ));
-            	}
-            	s_oNodes.remove(s_oWayOld.getNode(i));
+                Node n = s_oWayOld.getNode(i);
+                List<Way> ways = getWaysOfNode(n);
+                if (ways.size() <= 1) {
+                    cmds2.add(new DeleteCommand(s_oWayOld.getNode(i)));
+                }
+                s_oNodes.remove(s_oWayOld.getNode(i));
             }
             s_oWay = tempWay;
         }
-        
-        {
-        	cmds2.addAll(connectTo());
-
-        	// add new Node
-        	Node firstNode = null;
-        	Way way = new Way(s_oWay);
-        	for (Node node : s_oWay.getNodes()) {
-        		if ( node.getDataSet() != null )
-        		{
-        			way.removeNode(node);
-        		}
-        	}
-        	if ( way.getNodes().size() > 0 )
-            {
-                if (way.firstNode() != way.lastNode() )
-                {
-                	way.addNode(way.firstNode());
-                }
-        		for (Node node : way.getNodes())
-        		{
-        			if (firstNode == null || firstNode != node) {
-        				cmds.add(new AddCommand(node));
-        			}
-        			if (firstNode == null) {
-        				firstNode = node;
-        			}
-        		}
-            }
-        	
-        	// add new way
-    		if ( bAddWay == true )
-    		{
-    			cmds.add(new AddCommand(s_oWay));
-    		}
-            
-        	cmds.add(new ChangeCommand(s_oWayOld, trySplitWayByAnyNodes(s_oWay)));
-        }
+
+        cmds2.addAll(connectTo());
+
+        // add new Node
+        Node firstNode = null;
+        Way way = new Way(s_oWay);
+        for (Node node : s_oWay.getNodes()) {
+            if (node.getDataSet() != null) {
+                way.removeNode(node);
+            }
+        }
+        if (way.getNodes().size() > 0) {
+            if (way.firstNode() != way.lastNode()) {
+                way.addNode(way.firstNode());
+            }
+            for (Node node : way.getNodes()) {
+                if (firstNode == null || firstNode != node) {
+                    cmds.add(new AddCommand(node));
+                }
+                if (firstNode == null) {
+                    firstNode = node;
+                }
+            }
+        }
+
+        // add new way
+        if (bAddWay == true) {
+            cmds.add(new AddCommand(s_oWay));
+        }
+
+        cmds.add(new ChangeCommand(s_oWayOld, trySplitWayByAnyNodes(s_oWay)));
         cmds.addAll(cmds2);
-        
+
         TracerDebug oTracerDebug = new TracerDebug();
         oTracerDebug.OutputCommands(cmds);
-        
+
         Command cmd = new SequenceCommand(tr("Merge objects nodes"), cmds);
-        
+
         return cmd;
     }
-    
-    
+
+
     /**
      * Try connect way to other buildings.
@@ -268,5 +250,5 @@
             Node nearestNode = null;
             for (Node nn : s_oNodes) {
-            	System.out.println("Node: " + nn);
+                System.out.println("Node: " + nn);
                 if (!nn.isUsable() || way.containsNode(nn) || s_oWay.containsNode(nn) || !isInSameTag(nn)) {
                     continue;
@@ -278,5 +260,5 @@
                 }
             }
-            
+
             System.out.println("Nearest: " + nearestNode + " distance: " + minDistanceSq);
             if (nearestNode == null) {
@@ -287,11 +269,11 @@
             }
         }
-        
+
         for (Map.Entry<Way, Way> e : modifiedWays.entrySet()) {
             cmds.add(new ChangeCommand(e.getKey(), e.getValue()));
         }
-        
+
         //cmds.addFirst(new ChangeCommand(way, trySplitWayByAnyNodes(newWay)));
-        
+
         List<Command> cmd = cmds;
         return cmd;
@@ -305,29 +287,28 @@
      * @return List of Commands.
      */
-    private static List<Command> mergeNodes(Node n1, Node n2){
+    private static List<Command> mergeNodes(Node n1, Node n2) {
         List<Command> cmds = new LinkedList<>();
         cmds.add(new MoveCommand(n2,
-                 (n1.getEastNorth().getX() - n2.getEastNorth().getX())/2,
-                 (n1.getEastNorth().getY() - n2.getEastNorth().getY())/2
-                 ));
-        
+                (n1.getEastNorth().getX() - n2.getEastNorth().getX())/2,
+                (n1.getEastNorth().getY() - n2.getEastNorth().getY())/2
+                ));
+
         Way newWay = new Way(s_oWay);
-        
+
         int j = s_oWay.getNodes().indexOf(n1);
         newWay.addNode(j, n2);
         if (j == 0) {
             // first + last point
-        	newWay.addNode(newWay.getNodesCount(), n2);
-        }
-        
+            newWay.addNode(newWay.getNodesCount(), n2);
+        }
+
         newWay.removeNode(n1);
- //       cmds.add(new ChangeCommand(m_way, newWay));
-        
-        if (newWay.firstNode() != newWay.lastNode() )
-        {
-        	newWay.addNode(newWay.firstNode());
+        //       cmds.add(new ChangeCommand(m_way, newWay));
+
+        if (newWay.firstNode() != newWay.lastNode()) {
+            newWay.addNode(newWay.firstNode());
         }
         s_oWay = new Way(newWay);
-        
+
         //cmds.add(new DeleteCommand(n1));
         return cmds;
@@ -341,9 +322,7 @@
      *
      * @param node Node to connect.
-     * @throws IllegalStateException
-     * @throws IndexOutOfBoundsException
      * @return List of Commands.
      */
-	private static void tryConnectNodeToAnyWay(Node node, Map<Way, Way> m)
+    private static void tryConnectNodeToAnyWay(Node node, Map<Way, Way> m)
             throws IllegalStateException, IndexOutOfBoundsException {
 
@@ -364,5 +343,5 @@
         int nearestNodeIndex = 0;
         for (Way ww : s_oWays) {
-        	System.out.println("Way: " + ww);
+            System.out.println("Way: " + ww);
             if (!ww.isUsable() || ww.containsNode(node) || !isSameTag(ww)) {
                 continue;
@@ -377,5 +356,5 @@
                 double dist = distanceFromSegment2(ll, np.a.getCoor(), np.b.getCoor());
                 //System.out.println(" distance: " + dist1 + "  " + dist);
-                
+
                 if (dist < minDist) {
                     minDist = dist;
@@ -399,26 +378,26 @@
 
     private static double distanceFromSegment2(LatLon c, LatLon a, LatLon b) {
-    	double x;
-    	double y;
-    	
+        double x;
+        double y;
+
         StraightLine oStraightLine1 = new StraightLine(
-        		new Point2D.Double(a.getX(),a.getY()),
-        		new Point2D.Double(b.getX(),b.getY())); 
+                new Point2D.Double(a.getX(), a.getY()),
+                new Point2D.Double(b.getX(), b.getY()));
         StraightLine oStraightLine2 = new StraightLine(
-        		new Point2D.Double(c.getX(),c.getY()),
-        		new Point2D.Double(c.getX() + (a.getY()-b.getY()),c.getY() - (a.getX()-b.getX())));
+                new Point2D.Double(c.getX(), c.getY()),
+                new Point2D.Double(c.getX() + (a.getY()-b.getY()), c.getY() - (a.getX()-b.getX())));
         Point2D.Double oPoint = oStraightLine1.GetIntersectionPoint(oStraightLine2);
-    	
-        if ((oPoint.x > a.getX() && oPoint.x > b.getX()) || (oPoint.x < a.getX() && oPoint.x < b.getX()) || 
-        		(oPoint.y > a.getY() && oPoint.y > b.getY()) || (oPoint.y < a.getY() && oPoint.y < b.getY())) {
-        	return 100000;
-        }
-        
-        x=c.getX()-oPoint.getX();
-        y=c.getY()-oPoint.getY();
-        
+
+        if ((oPoint.x > a.getX() && oPoint.x > b.getX()) || (oPoint.x < a.getX() && oPoint.x < b.getX()) ||
+                (oPoint.y > a.getY() && oPoint.y > b.getY()) || (oPoint.y < a.getY() && oPoint.y < b.getY())) {
+            return 100000;
+        }
+
+        x = c.getX()-oPoint.getX();
+        y = c.getY()-oPoint.getY();
+
         return Math.sqrt((x*x)+(y*y));
     }
-    
+
     /**
      * Try split way by any existing building nodes.
@@ -429,6 +408,4 @@
      *
      * @param way Way to split.
-     * @throws IndexOutOfBoundsException
-     * @throws IllegalStateException
      * @return Modified way
      */
@@ -444,5 +421,5 @@
             System.out.println(way.getNodes().get(i) + "-----" + way.getNodes().get((i + 1) % way.getNodesCount()));
             double minDistanceSq = Double.MAX_VALUE;
-//            double maxAngle = MAX_ANGLE;
+            //            double maxAngle = MAX_ANGLE;
             //List<Node> nodes = Main.main.getCurrentDataSet().searchNodes(new BBox(
             //    Math.min(n1.getX(), n2.getX()) - minDistanceSq,
@@ -460,9 +437,9 @@
                 //double dist = TracerGeometry.distanceFromSegment(nn, n1, n2);
                 double dist = distanceFromSegment2(nn, n1, n2);
-//                double angle = TracerGeometry.angleOfLines(n1, nn, nn, n2);
+                //                double angle = TracerGeometry.angleOfLines(n1, nn, nn, n2);
                 //System.out.println("Angle: " + angle + " distance: " + dist + " Node: " + nod);
-                if (!n1.equalsEpsilon(nn) && !n2.equalsEpsilon(nn) && dist < minDistanceSq){ // && Math.abs(angle) < maxAngle) {
-                	minDistanceSq = dist;
-//                	maxAngle = angle;
+                if (!n1.equalsEpsilon(nn) && !n2.equalsEpsilon(nn) && dist < minDistanceSq) { // && Math.abs(angle) < maxAngle) {
+                    minDistanceSq = dist;
+                    //                    maxAngle = angle;
                     nearestNode = nod;
                 }
@@ -490,5 +467,5 @@
         for (OsmPrimitive op : n.getReferrers()) {
             if (op instanceof Way) {
-                if (isSameTag((Way) op)) {
+                if (isSameTag(op)) {
                     return true;
                 }
@@ -497,5 +474,5 @@
         return false;
     }
-    
+
     /**
      * Determines if the specified primitive denotes a building.
@@ -503,11 +480,11 @@
      * @return True if building key is set and different from no,entrance
      */
-    protected static final boolean isSameTag(OsmPrimitive p) {
+    protected static boolean isSameTag(OsmPrimitive p) {
         String v = p.get(s_oParam.getTag());
         if (s_bCtrl || s_oParam.getTag().equals("")) {
-        	return  v == null || v.equals("no");
+            return v == null || v.equals("no");
         }
         if (s_oParam.getTag().equals("building")) {
-        	return v != null && !v.equals("no") && !v.equals("entrance");
+            return v != null && !v.equals("no") && !v.equals("entrance");
         }
         return v != null && !v.equals("no");
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/StraightLine.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/StraightLine.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/StraightLine.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -29,7 +12,7 @@
 
     public StraightLine(Double dm, Double dc, boolean bRevert) {
-    	this.m_dm = dm;
-    	this.m_dc = dc;
-    	this.m_dx = Double.NaN;
+        this.m_dm = dm;
+        this.m_dc = dc;
+        this.m_dx = Double.NaN;
         if (this.m_dm.isNaN()) {
             this.m_dAlpha = Double.NaN;
@@ -37,8 +20,8 @@
             this.m_dAlpha = CheckAlpha((Double.NEGATIVE_INFINITY == this.m_dm) ? -90.0 : 90.0);
         } else {
-            this.m_dAlpha = CheckAlpha(Math.atan(dm) * 180 / Math.PI + (bRevert ? 180 : 0) );
+            this.m_dAlpha = CheckAlpha(Math.atan(dm) * 180 / Math.PI + (bRevert ? 180 : 0));
         }
     }
-    
+
     public StraightLine(Point2D.Double oP1, Point2D.Double oP2) {
         this.m_dm = (oP2.getY() - oP1.getY()) / (oP2.getX() - oP1.getX());
@@ -50,9 +33,10 @@
         } else {
             this.m_dx = Double.NaN;
-            this.m_dAlpha = CheckAlpha(Math.atan((oP2.getY() - oP1.getY()) / (oP2.getX() - oP1.getX())) * 180 / Math.PI + (oP1.getX() > oP2.getX() ? 180 : 0));
+            this.m_dAlpha = CheckAlpha(
+                    Math.atan((oP2.getY() - oP1.getY()) / (oP2.getX() - oP1.getX())) * 180 / Math.PI + (oP1.getX() > oP2.getX() ? 180 : 0));
         }
     }
-    
-    static private Double CheckAlpha(Double dAlpha) {
+
+    private static Double CheckAlpha(Double dAlpha) {
         if (dAlpha > 180) {
             return dAlpha - 360;
@@ -63,17 +47,21 @@
         return dAlpha;
     }
-    
+
     public Double getM() {
         return m_dm;
     }
+
     public Double getC() {
         return m_dc;
     }
+
     public Double getX() {
         return m_dx;
     }
+
     public Double getAlpha() {
         return m_dAlpha;
     }
+
     public boolean IsLine() {
         return !(m_dx.isNaN() || m_dx.isInfinite() || m_dAlpha.isNaN() || m_dAlpha.isInfinite())
@@ -84,5 +72,5 @@
         Double dx;
         Double dy;
-        
+
         if (!this.IsLine() || !oLine.IsLine()) {
             // data missing
@@ -105,5 +93,5 @@
             dy = this.m_dm * dx + this.m_dc;
         }
-        
+
         return new Point2D.Double(dx, dy);
     }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TagValues.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TagValues.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TagValues.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -29,60 +12,60 @@
     private String m_strTag = "";
     private String m_strPreferredValues = "";
-    
+
     private int m_nPos = 0;
     private boolean m_bPreferred = false;
     private String[] m_astrTagValues = null;
     private String[] m_astrTagValuesPreferred = null;
-    
+
     public TagValues() {
-    	clearAll();
+        clearAll();
     }
-    
+
     public void readBuildingTags(ServerParam param) {
-        if (param==null || param.getTag() == null || param.getTag().equals("")) {
-        	clearAll();
-        	return;
+        if (param == null || param.getTag() == null || param.getTag().equals("")) {
+            clearAll();
+            return;
         }
         if (param.getTag().equals(m_strTag) && param.getPreferredValues().equals(m_strPreferredValues)) {
-        	return;
+            return;
         }
         clearAll();
-        
+
         m_strTag = param.getTag();
         m_strPreferredValues = param.getPreferredValues();
-        
-    	// get values
+
+        // get values
         List<String> tagValues = new ArrayList<>();
         List<AutoCompletionListItem> values = Main.getLayerManager().getEditDataSet().getAutoCompletionManager().getValues(m_strTag);
-        for ( AutoCompletionListItem i : values ) {
-        	tagValues.add(i.getValue());
+        for (AutoCompletionListItem i : values) {
+            tagValues.add(i.getValue());
         }
-    	m_astrTagValues = (String[])tagValues.toArray(new String[tagValues.size()]);
-        
-    	// get preferred values
-    	if ( m_strPreferredValues.equals("") ) {
-    		m_astrTagValuesPreferred = new String[0];
-    	} else {
-    		String[] prefered = m_strPreferredValues.split(";");
-    		tagValues = new ArrayList<>();
-    		
-    		for (String str: prefered) {
-    			String temp = str.trim();
-    			if (getPos(temp, m_astrTagValues) >= 0 ) {
-    				tagValues.add(temp);
-    			}
-    		}
-    		m_astrTagValuesPreferred = (String[])tagValues.toArray(new String[tagValues.size()]);
-    		
-    		// set to the first preferred
-    		m_bPreferred = true;
-   			m_nPos = 0;
-    	}
+        m_astrTagValues = tagValues.toArray(new String[tagValues.size()]);
+
+        // get preferred values
+        if (m_strPreferredValues.equals("")) {
+            m_astrTagValuesPreferred = new String[0];
+        } else {
+            String[] prefered = m_strPreferredValues.split(";");
+            tagValues = new ArrayList<>();
+
+            for (String str: prefered) {
+                String temp = str.trim();
+                if (getPos(temp, m_astrTagValues) >= 0) {
+                    tagValues.add(temp);
+                }
+            }
+            m_astrTagValuesPreferred = tagValues.toArray(new String[tagValues.size()]);
+
+            // set to the first preferred
+            m_bPreferred = true;
+            m_nPos = 0;
+        }
     }
-    
+
     private void clearAll() {
         m_strTag = "";
         m_strPreferredValues = "";
-        
+
         m_nPos = 0;
         m_bPreferred = false;
@@ -90,105 +73,105 @@
         m_astrTagValuesPreferred = null;
     }
-    
+
     public String getTag() {
-    	if (m_strTag == null || m_strTag.equals("")) {
-    		return null;
-    	}
-    	return m_strTag;
+        if (m_strTag == null || m_strTag.equals("")) {
+            return null;
+        }
+        return m_strTag;
     }
-    
+
     public String getTagValue() {
-    	if ( m_bPreferred == false ) {
-    		if (m_astrTagValues != null && m_astrTagValues.length > m_nPos) {
-    			return m_astrTagValues[m_nPos];
-    		}
-    	} else {
-    		if (m_astrTagValuesPreferred != null && m_astrTagValuesPreferred.length > m_nPos) {
-    			return m_astrTagValuesPreferred[m_nPos];
-    		}
-    	}
-    	return null;
+        if (m_bPreferred == false) {
+            if (m_astrTagValues != null && m_astrTagValues.length > m_nPos) {
+                return m_astrTagValues[m_nPos];
+            }
+        } else {
+            if (m_astrTagValuesPreferred != null && m_astrTagValuesPreferred.length > m_nPos) {
+                return m_astrTagValuesPreferred[m_nPos];
+            }
+        }
+        return null;
     }
-    
-    private int getPos( String value, String[] values) {
-    	if (value != null && values != null ) {
-    		for ( int i = 0; i<values.length ; i++ ) {
-    			if ( value.equals(values[i]) ) {
-    				return i;
-    			}
-    		}
-    	}
-    	return -1;
+
+    private int getPos(String value, String[] values) {
+        if (value != null && values != null) {
+            for (int i = 0; i < values.length; i++) {
+                if (value.equals(values[i])) {
+                    return i;
+                }
+            }
+        }
+        return -1;
     }
-    
+
     public void left() {
-    	if (m_astrTagValues == null || m_astrTagValues.length == 0) {
-    		return;
-    	}
-    	if (m_bPreferred == false) {
-    		if (m_astrTagValuesPreferred == null || m_astrTagValuesPreferred.length == 0) {
-    			return;
-    		}
-    		m_bPreferred = true;
-    		m_nPos = getPos( m_astrTagValues[m_nPos], m_astrTagValuesPreferred);
-    		if ( m_nPos < 0 ) {
-    			m_nPos = 0;
-        		return;
-    		}
-    	}
-		m_nPos--;
-    	if (m_nPos < 0) m_nPos = m_astrTagValuesPreferred.length-1;
+        if (m_astrTagValues == null || m_astrTagValues.length == 0) {
+            return;
+        }
+        if (m_bPreferred == false) {
+            if (m_astrTagValuesPreferred == null || m_astrTagValuesPreferred.length == 0) {
+                return;
+            }
+            m_bPreferred = true;
+            m_nPos = getPos(m_astrTagValues[m_nPos], m_astrTagValuesPreferred);
+            if (m_nPos < 0) {
+                m_nPos = 0;
+                return;
+            }
+        }
+        m_nPos--;
+        if (m_nPos < 0) m_nPos = m_astrTagValuesPreferred.length-1;
     }
-    
+
     public void right() {
-    	if (m_astrTagValues == null || m_astrTagValues.length == 0) {
-    		return;
-    	}
-    	if (m_bPreferred == false) {
-    		if (m_astrTagValuesPreferred == null || m_astrTagValuesPreferred.length == 0) {
-    			return;
-    		}
-    		m_bPreferred = true;
-    		m_nPos = getPos( m_astrTagValues[m_nPos], m_astrTagValuesPreferred);
-    		if ( m_nPos < 0 ) {
-    			m_nPos = 0;
-        		return;
-    		}
-    	}
-		m_nPos++;
-    	if (m_nPos >= m_astrTagValuesPreferred.length) m_nPos = 0;
+        if (m_astrTagValues == null || m_astrTagValues.length == 0) {
+            return;
+        }
+        if (m_bPreferred == false) {
+            if (m_astrTagValuesPreferred == null || m_astrTagValuesPreferred.length == 0) {
+                return;
+            }
+            m_bPreferred = true;
+            m_nPos = getPos(m_astrTagValues[m_nPos], m_astrTagValuesPreferred);
+            if (m_nPos < 0) {
+                m_nPos = 0;
+                return;
+            }
+        }
+        m_nPos++;
+        if (m_nPos >= m_astrTagValuesPreferred.length) m_nPos = 0;
     }
-    
+
     public void up() {
-    	if (m_astrTagValues == null || m_astrTagValues.length == 0) {
-    		return;
-    	}
-    	if (m_bPreferred == true) {
-    		m_bPreferred = false;
-    		m_nPos = getPos( m_astrTagValuesPreferred[m_nPos], m_astrTagValues);
-    		if ( m_nPos < 0 ) {
-    			m_nPos = 0;
-        		return;
-    		}
-    	}
-    	m_nPos--;
-    	if (m_nPos < 0) m_nPos = m_astrTagValues.length-1;
+        if (m_astrTagValues == null || m_astrTagValues.length == 0) {
+            return;
+        }
+        if (m_bPreferred == true) {
+            m_bPreferred = false;
+            m_nPos = getPos(m_astrTagValuesPreferred[m_nPos], m_astrTagValues);
+            if (m_nPos < 0) {
+                m_nPos = 0;
+                return;
+            }
+        }
+        m_nPos--;
+        if (m_nPos < 0) m_nPos = m_astrTagValues.length-1;
     }
-    
+
     public void down() {
-    	if (m_astrTagValues == null || m_astrTagValues.length == 0) {
-    		return;
-    	}
-    	if (m_bPreferred == true) {
-    		m_bPreferred = false;
-    		m_nPos = getPos( m_astrTagValuesPreferred[m_nPos], m_astrTagValues);
-    		if ( m_nPos < 0 ) {
-    			m_nPos = 0;
-        		return;
-    		}
-    	}
-		m_nPos++;
-    	if (m_nPos >= m_astrTagValues.length) m_nPos = 0;
+        if (m_astrTagValues == null || m_astrTagValues.length == 0) {
+            return;
+        }
+        if (m_bPreferred == true) {
+            m_bPreferred = false;
+            m_nPos = getPos(m_astrTagValuesPreferred[m_nPos], m_astrTagValues);
+            if (m_nPos < 0) {
+                m_nPos = 0;
+                return;
+            }
+        }
+        m_nPos++;
+        if (m_nPos >= m_astrTagValues.length) m_nPos = 0;
     }
-    
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerAction.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerAction.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerAction.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -62,81 +45,78 @@
     private static final long serialVersionUID = 1L;
     private static boolean s_bServerVersionOK = false;
-    
+
     protected boolean m_bCancel;
-    private boolean m_bCtrl;	// if pressed no tag is added + changes and connection are made to ways without tag
-    private boolean m_bAlt;		// 
-    private boolean m_bShift;	// if pressed the new way will be add to the current selected
+    private boolean m_bCtrl;    // if pressed no tag is added + changes and connection are made to ways without tag
+    private boolean m_bAlt;     //
+    private boolean m_bShift;   // if pressed the new way will be add to the current selected
     private boolean m_bEnter = false;
-    
+
     private TagValues m_oTagValues = new TagValues();
-    
+
     TracerPlugin m_oPlugin;
-    
-    public TracerAction(MapFrame mapFrame) {
-        super(tr("Tracer2"), "tracer2-sml", tr("Tracer2."), Shortcut.registerShortcut("tools:tracer2", tr("Tool: {0}", tr("Tracer2")), KeyEvent.VK_T, Shortcut.DIRECT), mapFrame, getCursor());
-    }
-    
+
+    TracerAction(MapFrame mapFrame) {
+        super(tr("Tracer2"), "tracer2-sml", tr("Tracer2."),
+                Shortcut.registerShortcut("tools:tracer2", tr("Tool: {0}", tr("Tracer2")), KeyEvent.VK_T, Shortcut.DIRECT),
+                mapFrame, getCursor());
+    }
+
     @Override
     public void keyPressed(KeyEvent e) {
-    	//System.out.println("keyPressed: key:" + e.getKeyChar() + " code" + e.getKeyCode() + " Loc" + e.getKeyLocation()+ " ID" + KeyEvent.getKeyText(e.getKeyCode()));
-        
-    	Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
-    	List<Command> commands = new ArrayList<>();
-    	
-    	if ( checkActiveServerParam() == false ) return;
-    	
-    	switch (e.getKeyCode()) {
-    	case 37: // left
-    		m_oTagValues.left();
-    		break;
-    	case 38: // up
-    		m_oTagValues.up();
-    		break;
-    	case 39: // right
-    		m_oTagValues.right();
-    		break;
-    	case 40: // down
-    		m_oTagValues.down();
-    		break;
-    	default:
-    		return;
-    	}
-    	
-        if (selection.isEmpty())
-        {
+        Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
+        List<Command> commands = new ArrayList<>();
+
+        if (checkActiveServerParam() == false) return;
+
+        switch (e.getKeyCode()) {
+        case 37: // left
+            m_oTagValues.left();
+            break;
+        case 38: // up
+            m_oTagValues.up();
+            break;
+        case 39: // right
+            m_oTagValues.right();
+            break;
+        case 40: // down
+            m_oTagValues.down();
+            break;
+        default:
             return;
         }
-        
+
+        if (selection.isEmpty()) {
+            return;
+        }
+
         String strTag = m_oTagValues.getTag();
         String strTagValue = m_oTagValues.getTagValue();
-        
-        if ( strTag != null && strTagValue != null ) {
-	    	commands.add(new ChangePropertyCommand(selection, strTag, strTagValue));
-	    	
-	    	if (!commands.isEmpty()) {
-	    		Main.main.undoRedo.add( new SequenceCommand( tr("Change tag {0} to {1}", strTag, strTagValue), commands ));
-	        }
-        }
-    }
-    
-    @Override
-    public void keyReleased ( KeyEvent e ) {
-    	//System.out.println("keyReleased: key:" + e.getKeyChar() + " code" + e.getKeyCode() + " Loc" + e.getKeyLocation()+ " chra" + KeyEvent.getKeyText(e.getKeyCode()));
-    }
-    
-    @Override
-    public void keyTyped ( KeyEvent e ) {
-    	//System.out.println("keyTyped: key:" + e.getKeyChar() + " code" + e.getKeyCode() + " Loc" + e.getKeyLocation()+ " ID" + KeyEvent.getKeyText(e.getKeyCode()));
-    }
-    
+
+        if (strTag != null && strTagValue != null) {
+            commands.add(new ChangePropertyCommand(selection, strTag, strTagValue));
+
+            if (!commands.isEmpty()) {
+                Main.main.undoRedo.add(new SequenceCommand(tr("Change tag {0} to {1}", strTag, strTagValue), commands));
+            }
+        }
+    }
+
+    @Override
+    public void keyReleased(KeyEvent e) {
+    }
+
+    @Override
+    public void keyTyped(KeyEvent e) {
+    }
+
     @Override
     public void enterMode() {
-    	m_bEnter = true;
-    	
-    	// is not working hear
-    	// because if JOSM exit it is called too
-    	//checkActiveServerParam();
-    	
-    	if (!isEnabled()) {
+        m_bEnter = true;
+
+        // is not working hear
+        // because if JOSM exit it is called too
+        //checkActiveServerParam();
+
+        if (!isEnabled()) {
             return;
         }
@@ -146,18 +126,18 @@
         Main.map.mapView.addKeyListener(this);
     }
-    
+
     @Override
     public void exitMode() {
-    	m_bEnter = false;
-    	
+        m_bEnter = false;
+
         super.exitMode();
         Main.map.mapView.removeMouseListener(this);
         Main.map.mapView.removeKeyListener(this);
     }
-    
+
     private static Cursor getCursor() {
         return ImageProvider.getCursor("crosshair", "tracer2-sml");
     }
-    
+
     protected void traceAsync(Point clickPoint) {
         m_bCancel = false;
@@ -166,5 +146,5 @@
          */
         final LatLon pos = Main.map.mapView.getLatLon(clickPoint.x, clickPoint.y);
-        
+
         try {
             PleaseWaitRunnable tracerTask = new PleaseWaitRunnable(tr("Tracing")) {
@@ -173,9 +153,9 @@
                     traceSync(pos, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
                 }
-                
+
                 @Override
                 protected void finish() {
                 }
-                
+
                 @Override
                 protected void cancel() {
@@ -189,126 +169,126 @@
         }
     }
-    
+
     private void tagBuilding(Way way) {
         String strTag = m_oTagValues.getTag();
         String strTagValue = m_oTagValues.getTagValue();
-        
-        if ( strTag != null && strTagValue != null && !m_bCtrl) {
-        	way.put(strTag, strTagValue);
-        }
-    }
-    
+
+        if (strTag != null && strTagValue != null && !m_bCtrl) {
+            way.put(strTag, strTagValue);
+        }
+    }
+
     private boolean checkServerVersion() {
-    	int nMajor = 1;
-    	int nMinor = 1;
-    	
-    	if (s_bServerVersionOK == false) {
-            GetVersion  oGetVersion = new GetVersion();
+        int nMajor = 1;
+        int nMinor = 1;
+
+        if (s_bServerVersionOK == false) {
+            GetVersion oGetVersion = new GetVersion();
             oGetVersion.start();
-            
+
             int nRetray = 500; // 5 seconds
-            	
-            while(oGetVersion.isAlive() && nRetray > 0) {
-	            try {
-	            	Thread.sleep(10);
-	            } catch (Exception e) {
-	            	break;
-	            }
-	            nRetray--;
-	        }
-            
+
+            while (oGetVersion.isAlive() && nRetray > 0) {
+                try {
+                    Thread.sleep(10);
+                } catch (Exception e) {
+                    break;
+                }
+                nRetray--;
+            }
+
             if (oGetVersion.m_nVersionMajor < 0 || oGetVersion.m_nVersionMinor < 0) {
-            	return false;
+                return false;
             }
             if (oGetVersion.m_nVersionMajor != nMajor) {
-                JOptionPane.showMessageDialog(Main.parent, tr("The Tracer2Server version isn''t compatible with this plugin. Please download version {0} from\n{1}.", nMajor + ".x",
-                		"http://sourceforge.net/projects/tracer2server/"), tr("Error"),  JOptionPane.ERROR_MESSAGE);
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("The Tracer2Server version isn''t compatible with this plugin. Please download version {0} from\n{1}.", nMajor + ".x",
+                                "http://sourceforge.net/projects/tracer2server/"), tr("Error"), JOptionPane.ERROR_MESSAGE);
                 return false;
             }
             if (oGetVersion.m_nVersionMinor < nMinor) {
-                JOptionPane.showMessageDialog(Main.parent, tr("New version of Tracer2Server is available. For best results please upgrade to version {0}.",nMajor + "." + nMinor ), tr("Information"),  JOptionPane.INFORMATION_MESSAGE);
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("New version of Tracer2Server is available. For best results please upgrade to version {0}.", nMajor + "." + nMinor),
+                        tr("Information"), JOptionPane.INFORMATION_MESSAGE);
             }
             s_bServerVersionOK = true;
-    	}
-    	return true;
-    }
-    
+        }
+        return true;
+    }
+
     private boolean checkActiveServerParam() {
-    	if (checkServerVersion() == false) {
-    		return false;
-    	}
-    	if ( m_bEnter == true || TracerPlugin.s_oPlugin.m_oParamList.getActivParam() == null ) {
-    		
-    		ServerParamList listParam = TracerPlugin.s_oPlugin.m_oParamList;
-    		List<ServerParam> listEnableParam = listParam.getEnableParamList();
-    		
+        if (checkServerVersion() == false) {
+            return false;
+        }
+        if (m_bEnter == true || TracerPlugin.s_oPlugin.m_oParamList.getActivParam() == null) {
+
+            ServerParamList listParam = TracerPlugin.s_oPlugin.m_oParamList;
+            List<ServerParam> listEnableParam = listParam.getEnableParamList();
+
             if (listEnableParam == null || listEnableParam.size() == 0) {
-            	listParam.setActivParam(null);
-                JOptionPane.showMessageDialog(Main.parent, tr("No set of parameter is active!"), tr("Error"),  JOptionPane.ERROR_MESSAGE);
-            	return false;
-            }
-            if ( listEnableParam.size() == 1 ) {
-            	ServerParam param = listEnableParam.get(0);
-            	listParam.setActivParam(param);
-            	m_oTagValues.readBuildingTags(param);
-            	return true;
-            }
-            
+                listParam.setActivParam(null);
+                JOptionPane.showMessageDialog(Main.parent, tr("No set of parameter is active!"), tr("Error"), JOptionPane.ERROR_MESSAGE);
+                return false;
+            }
+            if (listEnableParam.size() == 1) {
+                ServerParam param = listEnableParam.get(0);
+                listParam.setActivParam(param);
+                m_oTagValues.readBuildingTags(param);
+                return true;
+            }
+
             ServerParamSelectDialog dialog = new ServerParamSelectDialog(listEnableParam, listParam.getActivParam());
-            
+
             if (dialog.getShow()) {
                 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
                 JDialog dlg = pane.createDialog(Main.parent, tr("Tracer2") + " - " + tr("Select parameter"));
-            	dlg.setVisible(true);
-            	Object obj = pane.getValue();
+                dlg.setVisible(true);
+                Object obj = pane.getValue();
                 dlg.dispose();
-            	if(obj != null && ((Integer)obj) == JOptionPane.OK_OPTION) {
-            		TracerPlugin.s_oPlugin.m_oParamList.setActivParam(dialog.getSelectedParam());
-            	} else {
-            		return false;
-            	}
-            }
-       	}
-    	ServerParam param = TracerPlugin.s_oPlugin.m_oParamList.getActivParam();
-    	if ( param == null ) {
-    		return false;
-    	}
-    	m_bEnter = false;
-    	m_oTagValues.readBuildingTags(param);
-    	return true;
-    }
-    
+                if (obj != null && ((Integer) obj) == JOptionPane.OK_OPTION) {
+                    TracerPlugin.s_oPlugin.m_oParamList.setActivParam(dialog.getSelectedParam());
+                } else {
+                    return false;
+                }
+            }
+        }
+        ServerParam param = TracerPlugin.s_oPlugin.m_oParamList.getActivParam();
+        if (param == null) {
+            return false;
+        }
+        m_bEnter = false;
+        m_oTagValues.readBuildingTags(param);
+        return true;
+    }
+
     private void traceSync(LatLon pos, ProgressMonitor progressMonitor) {
         Collection<Command> commands = new LinkedList<>();
-        
+
         progressMonitor.beginTask(null, 3);
         try {
             ArrayList<LatLon> coordList;
-            
-            if ( checkActiveServerParam() == false ) return;
-            
+
+            if (checkActiveServerParam() == false) return;
+
             ServerParam param = TracerPlugin.s_oPlugin.m_oParamList.getActivParam();
-            GetTrace  oTraceSimple = new GetTrace(pos, param);
+            GetTrace oTraceSimple = new GetTrace(pos, param);
             oTraceSimple.start();
-            try
-            {
-            	while(oTraceSimple.isAlive())
-	            {
-	            	Thread.sleep(50);
-	            	if (m_bCancel == true)
-	            	{
-	            		oTraceSimple.interrupt();
-	            		break;
-	            	}
-	            }
-	            coordList = oTraceSimple.m_listLatLon;
-        	} catch (Exception e) {
-            	coordList = new ArrayList<>();
-            }
-           
+            try {
+                while (oTraceSimple.isAlive()) {
+                    Thread.sleep(50);
+                    if (m_bCancel == true) {
+                        oTraceSimple.interrupt();
+                        break;
+                    }
+                }
+                coordList = oTraceSimple.m_listLatLon;
+            } catch (Exception e) {
+                coordList = new ArrayList<>();
+            }
+
             if (m_bCancel == true || coordList.size() == 0) {
                 return;
             }
-            
+
             // make nodes a way
             Way way = new Way();
@@ -323,19 +303,19 @@
             }
             way.addNode(firstNode);
-            
+
             tagBuilding(way);
-            
+
             // connect to other buildings
             commands.add(ConnectWays.connect(way, pos, param, m_bCtrl, m_bAlt));
-            
+
             if (!commands.isEmpty()) {
-            	String strCommand;
-            	if (ConnectWays.s_bAddNewWay == true) {
-            		strCommand = tr("Tracer2: add a way with {0} points", coordList.size());
-            	} else {
-            		strCommand = tr("Tracer2: modify way to {0} points", coordList.size());
-            	}
-            	Main.main.undoRedo.add(new SequenceCommand(strCommand, commands));
-            	
+                String strCommand;
+                if (ConnectWays.s_bAddNewWay == true) {
+                    strCommand = tr("Tracer2: add a way with {0} points", coordList.size());
+                } else {
+                    strCommand = tr("Tracer2: modify way to {0} points", coordList.size());
+                }
+                Main.main.undoRedo.add(new SequenceCommand(strCommand, commands));
+
                 if (m_bShift) {
                     getLayerManager().getEditDataSet().addSelected(ConnectWays.s_oWay);
@@ -346,26 +326,26 @@
                 System.out.println("Failed");
             }
-            
+
         } finally {
             progressMonitor.finishTask();
         }
     }
-    
+
     public void cancel() {
         m_bCancel = true;
     }
-    
+
     @Override
     public void mouseClicked(MouseEvent e) {
     }
-    
+
     @Override
     public void mouseEntered(MouseEvent e) {
     }
-    
+
     @Override
     public void mouseExited(MouseEvent e) {
     }
-    
+
     @Override
     public void mousePressed(MouseEvent e) {
@@ -379,5 +359,5 @@
         }
     }
-    
+
     @Override
     protected void updateKeyModifiers(MouseEvent e) {
@@ -386,9 +366,9 @@
         m_bShift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0;
     }
-    
+
     @Override
     public void mouseReleased(MouseEvent e) {
     }
-    
+
 }
 
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerDebug.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerDebug.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerDebug.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -34,94 +17,94 @@
 
     private static String FormatPrimitive(String strIn) {
-    	while (strIn.contains("{")) {
-    		strIn = strIn.replace("{", "xxxxx");
-    	}
-		return strIn.replaceAll("xxxxx", "\r\n	{");
+        while (strIn.contains("{")) {
+            strIn = strIn.replace("{", "xxxxx");
+        }
+        return strIn.replaceAll("xxxxx", "\r\n    {");
     }
 
-	public  void OutputOsmPrimitive(Collection<OsmPrimitive> cOsmPrimitive) {
-		if (cOsmPrimitive != null) {
-    		for (OsmPrimitive p : cOsmPrimitive) {
-    	    	System.out.println(" OsmPrimitive: " + FormatPrimitive(p.toString()));
-    	    }
-		}
-	}
-	
-	public  void OutputOsmExtendsPrimitive(Collection<? extends OsmPrimitive> cOsmPrimitive) {
-		if (cOsmPrimitive != null) {
-    		for (OsmPrimitive p : cOsmPrimitive) {
-    	    	System.out.println(" OsmPrimitive x: " + FormatPrimitive(p.toString()));
-    	    }
-		}
-	}
-	
-	public void OutputCommands(LinkedList<Command> cmds) {
-		
-		for (Command c : cmds) {
-			System.out.println("");
+    public void OutputOsmPrimitive(Collection<OsmPrimitive> cOsmPrimitive) {
+        if (cOsmPrimitive != null) {
+            for (OsmPrimitive p : cOsmPrimitive) {
+                System.out.println(" OsmPrimitive: " + FormatPrimitive(p.toString()));
+            }
+        }
+    }
 
-			Collection<OsmPrimitive> cp1 = null;
-        	Collection<OsmPrimitive> cp2 = null;
-        	Collection<OsmPrimitive> cp3 = null;
-        	Collection<? extends OsmPrimitive> cpx = null;
-        	
-        	List<OsmPrimitive> lp1 = new LinkedList<>();
-        	List<OsmPrimitive> lp2 = new LinkedList<>();
-        	List<OsmPrimitive> lp3 = new LinkedList<>();
-        	List<OsmPrimitive> lp = new LinkedList<>();
-        	
-        	cp1 = lp1;
-        	cp2 = lp2;
-        	cp3 = lp3;
-        	cpx = lp;
-        	
-        	//OsmPrimitive op = new OsmPrimitive();
-        	OsmPrimitive op1 = new Way();
-        	
-        	System.out.println("Command: " + c.toString());
-        	
-        	if (c instanceof AddCommand) {
-        	    AddCommand x = (AddCommand) c;
-         		x.fillModifiedData(cp1, cp2, cp3);
-         		OutputOsmPrimitive(cp1);
-         		OutputOsmPrimitive(cp2);
-         		OutputOsmPrimitive(cp3);
-         		cpx = x.getParticipatingPrimitives();
-         		OutputOsmExtendsPrimitive(cpx);
-         	} else if (c instanceof ChangeCommand) { // order is important!
-         		ChangeCommand x = (ChangeCommand) c;
-         		x.fillModifiedData(cp1, cp2, cp3);
-         		x.getOrig(op1);
-         		OutputOsmPrimitive(cp1);
-         		OutputOsmPrimitive(cp2);
-         		OutputOsmPrimitive(cp3);
-         		cpx = x.getParticipatingPrimitives();
-         		OutputOsmExtendsPrimitive(cpx);
-        	} else if (c instanceof DeleteCommand) {
-        		DeleteCommand x = (DeleteCommand) c;
-         		x.fillModifiedData(cp1, cp2, cp3);
-         		OutputOsmPrimitive(cp1);
-         		OutputOsmPrimitive(cp2);
-         		OutputOsmPrimitive(cp3);
-         		cpx = x.getParticipatingPrimitives();
-         		OutputOsmExtendsPrimitive(cpx);
-         	} else if (c instanceof MoveCommand) { // order is important!
-         		MoveCommand x = (MoveCommand) c;
-         		x.fillModifiedData(cp1, cp2, cp3);
-         		OutputOsmPrimitive(cp1);
-         		OutputOsmPrimitive(cp2);
-         		OutputOsmPrimitive(cp3);
-         		cpx = x.getParticipatingPrimitives();
-         		OutputOsmExtendsPrimitive(cpx);
-        	} else {
-         		c.fillModifiedData(cp1, cp2, cp3);
-         		OutputOsmPrimitive(cp1);
-         		OutputOsmPrimitive(cp2);
-         		OutputOsmPrimitive(cp3);
-         		cpx = c.getParticipatingPrimitives();
-         		OutputOsmExtendsPrimitive(cpx);
-        	}
+    public void OutputOsmExtendsPrimitive(Collection<? extends OsmPrimitive> cOsmPrimitive) {
+        if (cOsmPrimitive != null) {
+            for (OsmPrimitive p : cOsmPrimitive) {
+                System.out.println(" OsmPrimitive x: " + FormatPrimitive(p.toString()));
+            }
         }
-	}
-	
+    }
+
+    public void OutputCommands(LinkedList<Command> cmds) {
+
+        for (Command c : cmds) {
+            System.out.println("");
+
+            Collection<OsmPrimitive> cp1 = null;
+            Collection<OsmPrimitive> cp2 = null;
+            Collection<OsmPrimitive> cp3 = null;
+            Collection<? extends OsmPrimitive> cpx = null;
+
+            List<OsmPrimitive> lp1 = new LinkedList<>();
+            List<OsmPrimitive> lp2 = new LinkedList<>();
+            List<OsmPrimitive> lp3 = new LinkedList<>();
+            List<OsmPrimitive> lp = new LinkedList<>();
+
+            cp1 = lp1;
+            cp2 = lp2;
+            cp3 = lp3;
+            cpx = lp;
+
+            //OsmPrimitive op = new OsmPrimitive();
+            OsmPrimitive op1 = new Way();
+
+            System.out.println("Command: " + c.toString());
+
+            if (c instanceof AddCommand) {
+                AddCommand x = (AddCommand) c;
+                x.fillModifiedData(cp1, cp2, cp3);
+                OutputOsmPrimitive(cp1);
+                OutputOsmPrimitive(cp2);
+                OutputOsmPrimitive(cp3);
+                cpx = x.getParticipatingPrimitives();
+                OutputOsmExtendsPrimitive(cpx);
+            } else if (c instanceof ChangeCommand) { // order is important!
+                ChangeCommand x = (ChangeCommand) c;
+                x.fillModifiedData(cp1, cp2, cp3);
+                x.getOrig(op1);
+                OutputOsmPrimitive(cp1);
+                OutputOsmPrimitive(cp2);
+                OutputOsmPrimitive(cp3);
+                cpx = x.getParticipatingPrimitives();
+                OutputOsmExtendsPrimitive(cpx);
+            } else if (c instanceof DeleteCommand) {
+                DeleteCommand x = (DeleteCommand) c;
+                x.fillModifiedData(cp1, cp2, cp3);
+                OutputOsmPrimitive(cp1);
+                OutputOsmPrimitive(cp2);
+                OutputOsmPrimitive(cp3);
+                cpx = x.getParticipatingPrimitives();
+                OutputOsmExtendsPrimitive(cpx);
+            } else if (c instanceof MoveCommand) { // order is important!
+                MoveCommand x = (MoveCommand) c;
+                x.fillModifiedData(cp1, cp2, cp3);
+                OutputOsmPrimitive(cp1);
+                OutputOsmPrimitive(cp2);
+                OutputOsmPrimitive(cp3);
+                cpx = x.getParticipatingPrimitives();
+                OutputOsmExtendsPrimitive(cpx);
+            } else {
+                c.fillModifiedData(cp1, cp2, cp3);
+                OutputOsmPrimitive(cp1);
+                OutputOsmPrimitive(cp2);
+                OutputOsmPrimitive(cp3);
+                cpx = c.getParticipatingPrimitives();
+                OutputOsmExtendsPrimitive(cpx);
+            }
+        }
+    }
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerException.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerException.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerException.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -24,13 +7,13 @@
 
     /**
-	 * 
-	 */
-	private static final long serialVersionUID = 4404064875119981715L;
+     *
+     */
+    private static final long serialVersionUID = 4404064875119981715L;
 
-	public TracerException() {
+    TracerException() {
         super(tr("An unknown error has occurred"));
     }
 
-    public TracerException(String err) {
+    TracerException(String err) {
         super(err);
     }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerGeometry.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerGeometry.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerGeometry.java	(revision 32788)
@@ -1,25 +1,12 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
 import org.openstreetmap.josm.data.coor.LatLon;
 
-public class TracerGeometry {
+public final class TracerGeometry {
+
+    private TracerGeometry() {
+        // Hide default constructor for utilities classes
+    }
 
     /**
@@ -31,8 +18,8 @@
      * @return Angle in degrees.
      */
-    static public double angleOfLines(LatLon a, LatLon b, LatLon c, LatLon d) {
+    public static double angleOfLines(LatLon a, LatLon b, LatLon c, LatLon d) {
         return (Math.abs(
-                    Math.atan2(a.lat() - b.lat(), a.lon() - b.lon()) -
-                    Math.atan2(c.lat() - d.lat(), c.lon() - d.lon())
+                Math.atan2(a.lat() - b.lat(), a.lon() - b.lon()) -
+                Math.atan2(c.lat() - d.lat(), c.lon() - d.lon())
                 ) / Math.PI * 180) % 360;
     }
@@ -45,16 +32,16 @@
      * @return Distance.
      */
-    static public double distanceFromSegment(LatLon c, LatLon a, LatLon b) {
+    public static double distanceFromSegment(LatLon c, LatLon a, LatLon b) {
         return distanceFromSegment(
                 c.getX(), c.getY(),
                 a.getX(), a.getY(),
                 b.getX(), b.getY()
-        );
+                );
     }
 
-    static private double distanceFromSegment(double cx, double cy, double ax, double ay, double bx, double by) {
+    private static double distanceFromSegment(double cx, double cy, double ax, double ay, double bx, double by) {
         double r_numerator = (cx - ax) * (bx - ax) + (cy - ay) * (by - ay);
         double r_denomenator = (bx - ax) * (bx - ax) + (by - ay) * (by - ay);
-        if(r_denomenator == 0)System.out.println("r_denomenator == 0    ------------");
+        if (r_denomenator == 0)System.out.println("r_denomenator == 0    ------------");
         double r = r_numerator / r_denomenator;
         double s = ((ay - cy) * (bx - ax) - (ax - cx) * (by - ay)) / r_denomenator;
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerPlugin.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerPlugin.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerPlugin.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2;
 
@@ -30,27 +13,26 @@
 
 public class TracerPlugin extends Plugin {
-	
+
     public static TracerPlugin s_oPlugin;
-    
+
     public final ServerParamList m_oParamList;
-	
+
     public TracerPlugin(PluginInformation info) {
         super(info);
         MainMenu.add(Main.main.menu.moreToolsMenu, new TracerAction(Main.map));
-        
+
         s_oPlugin = this;
-        
+
         File plugindir = new File(this.getPluginDir());
         if (!plugindir.exists()) {
             plugindir.mkdirs();
         }
-        
+
         m_oParamList = new ServerParamList(new File(plugindir, "serverParam.cfg").getAbsolutePath());
     }
-    
+
     @Override
     public PreferenceSetting getPreferenceSetting() {
         return new ServerParamPreference(this);
     }
-    
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParam.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParam.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParam.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -35,5 +18,5 @@
 
 public class ServerParam {
-	
+
     protected boolean m_bEnabled;
     private String m_strName = "Name";
@@ -48,102 +31,114 @@
     private String m_strTag = "building";
     private String m_strPreferredValues = "yes;house;garage";
-    
+
     protected JMenuItem m_oMenuItem;
-    
+
     public boolean isEnabled() {
         return m_bEnabled;
     }
+
     public void setEnabled(boolean enabled) {
-    	if (!m_bEnabled ^ enabled)
+        if (!m_bEnabled ^ enabled)
             return;
         m_bEnabled = enabled;
     }
-    
+
     public String getName() {
         return m_strName;
     }
+
     public void setName(String name) {
         m_strName = name;
     }
-    
+
     public String getDescription() {
         return m_strDescription;
     }
+
     public void setDescription(String description) {
         m_strDescription = description;
     }
-    
+
     public String getUrl() {
         return m_strUrl;
     }
+
     public void setUrl(String url) {
         m_strUrl = url;
     }
-    
+
     public String getTileSize() {
         return m_strTileSize;
     }
+
     public void setTileSize(String tileSize) {
         m_strTileSize = tileSize;
     }
-    
+
     public String getResolution() {
         return m_strResolution;
     }
+
     public void setResolution(String resolution) {
         m_strResolution = resolution;
     }
-    
+
     public String getSkipBottom() {
         return m_strSkipBottom;
     }
+
     public void setSkipBottom(String skipBottom) {
         m_strSkipBottom = skipBottom;
     }
-    
+
     public String getMode() {
         return m_strMode;
     }
+
     public void setMode(String mode) {
         m_strMode = mode;
     }
-    
+
     public String getThreshold() {
         return m_strThreshold;
     }
+
     public void setThreshold(String threshold) {
         m_strThreshold = threshold;
     }
-    
+
     public String getPointsPerCircle() {
         return m_strPointsPerCircle;
     }
+
     public void setPointsPerCircle(String pointsPerCircle) {
         m_strPointsPerCircle = pointsPerCircle;
     }
-    
+
     public String getTag() {
         return m_strTag;
     }
+
     public void setTag(String tag) {
         m_strTag = tag;
     }
-    
+
     public String getPreferredValues() {
         return m_strPreferredValues;
     }
+
     public void setPreferredValues(String preferredValues) {
         m_strPreferredValues = preferredValues;
     }
-    
+
     public ServerParam() {
         m_bEnabled = false;
     }
-    
+
     public ServerParam(String name) {
         this();
         m_strName = name;
     }
-    
+
     public String serialize() {
         StringBuilder oBuilder = new StringBuilder();
@@ -163,7 +158,7 @@
         return oBuilder.toString();
     }
-    
+
     public static ServerParam unserialize(String str) {
-    	ServerParam oParam = new ServerParam();
+        ServerParam oParam = new ServerParam();
         String[] lines = str.split("\n");
         for (String line : lines) {
@@ -196,8 +191,8 @@
         return oParam;
     }
-    
+
     protected void showErrorMessage(String message, String details) {
         final JPanel p = new JPanel(new GridBagLayout());
-        p.add(new JMultilineLabel(message),GBC.eol());
+        p.add(new JMultilineLabel(message), GBC.eol());
         if (details != null) {
             JTextArea info = new JTextArea(details, 20, 60);
@@ -207,4 +202,5 @@
         }
         SwingUtilities.invokeLater(new Runnable() {
+            @Override
             public void run() {
                 JOptionPane.showMessageDialog(Main.parent, p, tr("Tracer2 error"), JOptionPane.ERROR_MESSAGE);
@@ -212,4 +208,4 @@
         });
     }
-    
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -41,19 +24,19 @@
 public class ServerParamDialog extends ExtendedDialog {
     /**
-	 * 
-	 */
-	private static final long serialVersionUID = -3229680217088662218L;
-	
-	private String[] m_astrTileSize = new String[] {"0.0001", "0.0002", "0.0004", "0.0008", "0.001", "0.002", "0.004", "0.008", "0.01"};
-	private String[] m_astrResolution = new String[] {"512", "1024", "2048", "4096"};
-	private String[] m_astrMode = new String[] {"boundary", "match color"};
-	private String[] m_astrPointsPerCircle = new String[] {"0", "8", "12", "16", "20", "24", "32"};
-	
-	private ServerParam m_oParam;
-	
+     *
+     */
+    private static final long serialVersionUID = -3229680217088662218L;
+
+    private String[] m_astrTileSize = new String[] {"0.0001", "0.0002", "0.0004", "0.0008", "0.001", "0.002", "0.004", "0.008", "0.01"};
+    private String[] m_astrResolution = new String[] {"512", "1024", "2048", "4096"};
+    private String[] m_astrMode = new String[] {"boundary", "match color"};
+    private String[] m_astrPointsPerCircle = new String[] {"0", "8", "12", "16", "20", "24", "32"};
+
+    private ServerParam m_oParam;
+
     private JPanel m_oPanel = new JPanel(new GridBagLayout());
     private JTextField m_oName = new JTextField();
     private JTextField m_oDescription = new JTextField();
-    private JTextArea m_oUrl = new JTextArea(5,5);
+    private JTextArea m_oUrl = new JTextArea(5, 5);
     private JComboBox<String> m_oTileSize;
     private JComboBox<String> m_oResolution;
@@ -64,11 +47,11 @@
     private JTextField m_oTag = new JTextField();
     private JTextField m_oPreferredValues = new JTextField();
-    
+
     private JScrollPane m_oScrollpaneUrl;
-    
+
     public ServerParam getServerParam() {
-    	return m_oParam;
+        return m_oParam;
     }
-    
+
     private void addLabelled(String str, Component c) {
         JLabel label = new JLabel(str);
@@ -77,74 +60,74 @@
         m_oPanel.add(c, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
     }
-    
+
     private void addGap() {
         JPanel p = new JPanel();
-        p.setMinimumSize(new Dimension(10,0));
+        p.setMinimumSize(new Dimension(10, 0));
         m_oPanel.add(p, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
     }
-    
+
     private void load() {
         m_oName.setText(m_oParam.getName());
         m_oDescription.setText(m_oParam.getDescription());
         m_oUrl.setText(m_oParam.getUrl());
-        loadComboBox( m_oTileSize, m_oParam.getTileSize(), m_astrTileSize);
-        loadComboBox( m_oResolution, m_oParam.getResolution(), m_astrResolution);
+        loadComboBox(m_oTileSize, m_oParam.getTileSize(), m_astrTileSize);
+        loadComboBox(m_oResolution, m_oParam.getResolution(), m_astrResolution);
         //m_oSkipBottom.setText(param.getSkipBottom());
-        loadComboBox( m_oMode, m_oParam.getMode(), m_astrMode);
+        loadComboBox(m_oMode, m_oParam.getMode(), m_astrMode);
         m_oThreshold.setText(m_oParam.getThreshold());
-        loadComboBox( m_oPointsPerCircle, m_oParam.getPointsPerCircle(), m_astrPointsPerCircle);
+        loadComboBox(m_oPointsPerCircle, m_oParam.getPointsPerCircle(), m_astrPointsPerCircle);
         m_oTag.setText(m_oParam.getTag());
         m_oPreferredValues.setText(m_oParam.getPreferredValues());
     }
-    
+
     private void save() {
-    	m_oParam.setName(m_oName.getText());
-    	m_oParam.setDescription(m_oDescription.getText());
-    	m_oParam.setUrl(m_oUrl.getText());
-    	m_oParam.setTileSize(saveComboBox(m_oTileSize, m_astrTileSize));
-    	m_oParam.setResolution(saveComboBox(m_oResolution, m_astrResolution));
-    	//m_oParam.setSkipBottom(m_oSkipBottom.getText());
-    	m_oParam.setMode(saveComboBox(m_oMode, m_astrMode));
-    	m_oParam.setThreshold(m_oThreshold.getText());
-    	m_oParam.setPointsPerCircle(saveComboBox(m_oPointsPerCircle, m_astrPointsPerCircle));
-    	m_oParam.setTag(m_oTag.getText());
-    	m_oParam.setPreferredValues(m_oPreferredValues.getText());
+        m_oParam.setName(m_oName.getText());
+        m_oParam.setDescription(m_oDescription.getText());
+        m_oParam.setUrl(m_oUrl.getText());
+        m_oParam.setTileSize(saveComboBox(m_oTileSize, m_astrTileSize));
+        m_oParam.setResolution(saveComboBox(m_oResolution, m_astrResolution));
+        //m_oParam.setSkipBottom(m_oSkipBottom.getText());
+        m_oParam.setMode(saveComboBox(m_oMode, m_astrMode));
+        m_oParam.setThreshold(m_oThreshold.getText());
+        m_oParam.setPointsPerCircle(saveComboBox(m_oPointsPerCircle, m_astrPointsPerCircle));
+        m_oParam.setTag(m_oTag.getText());
+        m_oParam.setPreferredValues(m_oPreferredValues.getText());
     }
-    
-    private void loadComboBox( JComboBox<?> c, String strValue, String[] astrValues ) {
+
+    private void loadComboBox(JComboBox<?> c, String strValue, String[] astrValues) {
         int pos = 0;
-        for ( String str: astrValues ) {
-        	if (strValue.equals(str)) {
-            	c.setSelectedIndex(pos);
-            	return;
-        	}
-        	pos++;
+        for (String str: astrValues) {
+            if (strValue.equals(str)) {
+                c.setSelectedIndex(pos);
+                return;
+            }
+            pos++;
         }
     }
-    
-    private String saveComboBox( JComboBox<?> c, String[] astrValues ) {
+
+    private String saveComboBox(JComboBox<?> c, String[] astrValues) {
         return astrValues[c.getSelectedIndex()];
     }
-    
+
     public ServerParamDialog(ServerParam param) {
         super(Main.parent, tr("Tracer2") + " - " + tr("Parameter for server request"),
-                new String[] { tr("OK"), tr("Cancel") },
+                new String[] {tr("OK"), tr("Cancel")},
                 true);
         if (param == null) {
-        	m_oParam = new ServerParam();
+            m_oParam = new ServerParam();
         } else {
-        	m_oParam = param;
+            m_oParam = param;
         }
-        
+
         contentInsets = new Insets(15, 15, 5, 15);
-        setButtonIcons(new String[] { "ok.png", "cancel.png" });
-        
+        setButtonIcons(new String[] {"ok.png", "cancel.png"});
+
         m_oTileSize = new JComboBox<>(m_astrTileSize);
         m_oResolution = new JComboBox<>(m_astrResolution);
         m_oMode = new JComboBox<>(m_astrMode);
         m_oPointsPerCircle = new JComboBox<>(m_astrPointsPerCircle);
-        
+
         load();
-        
+
         addLabelled(tr("Name:"), m_oName);
         addLabelled(tr("Description:"), m_oDescription);
@@ -165,11 +148,11 @@
         addLabelled(tr("Tag:"), m_oTag);
         addLabelled(tr("Preferred values:"), m_oPreferredValues);
-        
+
         setMinimumSize(new Dimension(500, 0));
-        
+
         setContent(m_oPanel);
         setupDialog();
     }
-    
+
     @Override
     protected void buttonAction(int buttonIndex, ActionEvent evt) {
@@ -177,5 +160,5 @@
             save();
         } else {
-        	m_oParam = null;
+            m_oParam = null;
         }
         super.buttonAction(buttonIndex, evt);
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamList.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamList.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamList.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -38,7 +21,7 @@
         this.m_strFilename = filename;
         if (filename == null) {
-        	loadDefault();
+            loadDefault();
         } else {
-        	load();
+            load();
         }
     }
@@ -49,12 +32,12 @@
             String strLine;
             while ((strLine = oReader.readLine()) != null) {
-            	oBuilder.append(strLine).append('\n');
+                oBuilder.append(strLine).append('\n');
                 if (strLine.equals("")) {
-                	m_listServerParam.add(ServerParam.unserialize(oBuilder.toString()));
-                	oBuilder = new StringBuilder();
+                    m_listServerParam.add(ServerParam.unserialize(oBuilder.toString()));
+                    oBuilder = new StringBuilder();
                 }
             }
         } catch (Exception e) {
-        	loadDefault();
+            loadDefault();
         }
     }
@@ -62,18 +45,18 @@
     public void loadDefault() {
         try (
-        	InputStream oIP = getClass().getResourceAsStream("/resources/serverParam.cfg");
-            BufferedReader oReader = new BufferedReader(new InputStreamReader(oIP));
-        ) {
+                InputStream oIP = getClass().getResourceAsStream("/resources/serverParam.cfg");
+                BufferedReader oReader = new BufferedReader(new InputStreamReader(oIP));
+                ) {
             StringBuilder oBuilder = new StringBuilder();
             String strLine;
             while ((strLine = oReader.readLine()) != null) {
-            	oBuilder.append(strLine).append('\n');
+                oBuilder.append(strLine).append('\n');
                 if (strLine.equals("")) {
-                	m_listServerParam.add(ServerParam.unserialize(oBuilder.toString()));
-                	oBuilder = new StringBuilder();
+                    m_listServerParam.add(ServerParam.unserialize(oBuilder.toString()));
+                    oBuilder = new StringBuilder();
                 }
             }
         } catch (Exception e) {
-        	Main.warn("Tracer2 warning: can't load file " + m_strFilename);
+            Main.warn("Tracer2 warning: can't load file " + m_strFilename);
         }
     }
@@ -82,8 +65,8 @@
         try (OutputStreamWriter oWriter = new OutputStreamWriter(new FileOutputStream(m_strFilename), "UTF-8")) {
             for (ServerParam param : m_listServerParam) {
-            	oWriter.write(param.serialize());
+                oWriter.write(param.serialize());
             }
         } catch (Exception e) {
-        	Main.warn("Tracer2 warning: can't save file " + m_strFilename);
+            Main.warn("Tracer2 warning: can't save file " + m_strFilename);
         }
     }
@@ -96,27 +79,28 @@
         return m_oActivParam;
     }
+
     public void setActivParam(ServerParam param) {
-    	if ( m_listServerParam.contains(param)) {
-    		m_oActivParam = param;
-    	}
+        if (m_listServerParam.contains(param)) {
+            m_oActivParam = param;
+        }
     }
 
     public List<ServerParam> getEnableParamList() {
-    	List<ServerParam> listParam = new ArrayList<>();
-    	for ( ServerParam param: m_listServerParam) {
-        	if (param.isEnabled()) {
-        		listParam.add(param);
-        	}
+        List<ServerParam> listParam = new ArrayList<>();
+        for (ServerParam param: m_listServerParam) {
+            if (param.isEnabled()) {
+                listParam.add(param);
+            }
         }
-    	return listParam;
+        return listParam;
     }
 
     public void addParam(ServerParam param) {
-    	m_listServerParam.add(param);
+        m_listServerParam.add(param);
     }
 
     public void removeParam(ServerParam param) {
-    	param.setEnabled(false);
-    	m_listServerParam.remove(param);
+        param.setEnabled(false);
+        m_listServerParam.remove(param);
     }
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPanel.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPanel.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPanel.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -36,16 +19,16 @@
 
 public class ServerParamPanel extends JPanel {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6174275926314685531L;
-	
-	ServerParamList m_listParam;
-	
+    /**
+     *
+     */
+    private static final long serialVersionUID = -6174275926314685531L;
+
+    ServerParamList m_listParam;
+
     public ServerParamPanel(ServerParamList listParam) {
         super(new GridBagLayout());
         m_listParam = listParam;
     }
-    
+
     public void refresh() {
         removeAll();
@@ -54,13 +37,14 @@
         gbc.fill = GridBagConstraints.HORIZONTAL;
         gbc.insets = new Insets(2, 5, 2, 5);
-        
+
         for (final ServerParam param : m_listParam.getParamList()) {
             gbc.gridx = 0;
             gbc.weightx = 1.0;
             gbc.anchor = GridBagConstraints.WEST;
-            
+
             final JCheckBox cbParam = new JCheckBox(param.getName());
             cbParam.setSelected(param.isEnabled());
             cbParam.addActionListener(new ActionListener() {
+                @Override
                 public void actionPerformed(ActionEvent e) {
                     param.setEnabled(cbParam.isSelected());
@@ -68,9 +52,9 @@
             });
             add(cbParam, gbc);
-            
+
             gbc.gridx = 1;
             gbc.weightx = 0;
             gbc.anchor = GridBagConstraints.EAST;
-            
+
             final JButton bEdit = new JButton(tr("Edit"));
             bEdit.addActionListener(new ActionListener() {
@@ -84,5 +68,5 @@
             });
             add(bEdit, gbc);
-            
+
             gbc.gridx = 2;
             final JButton bDel = new JButton(tr("Delete"));
@@ -94,7 +78,6 @@
                             tr("Are you sure?"),
                             JOptionPane.YES_NO_OPTION,
-                            JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
-                    {
-                    	m_listParam.removeParam(param);
+                            JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
+                        m_listParam.removeParam(param);
                         refresh();
                     }
@@ -102,5 +85,5 @@
             });
             add(bDel, gbc);
-            
+
             gbc.gridy++;
         }
@@ -108,7 +91,7 @@
         gbc.fill = GridBagConstraints.NONE;
         gbc.anchor = GridBagConstraints.WEST;
-        
+
         JPanel p = new JPanel(new GridBagLayout());
-        
+
         final JButton bNew = new JButton(tr("Add new"));
         bNew.addActionListener(new ActionListener() {
@@ -118,5 +101,5 @@
                 dlg.setVisible(true);
                 dlg.dispose();
-                ServerParam param = ((ServerParamDialog)dlg).getServerParam();
+                ServerParam param = ((ServerParamDialog) dlg).getServerParam();
                 if (param != null && param.getName() != null && (!"".equals(param.getName()))) {
                     m_listParam.addParam(param);
@@ -127,33 +110,33 @@
         });
         p.add(bNew);
-        
+
         final JButton bPredefined = new JButton(tr("Add predefined"));
         bPredefined.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent arg0) {
-            	ServerParamList myParamList;
+                ServerParamList myParamList;
 
-            	myParamList = new ServerParamList(null);
-            	
-            	ServerParamSelectDialog dialog = new ServerParamSelectDialog(myParamList.getParamList(), null);
-            	
+                myParamList = new ServerParamList(null);
+
+                ServerParamSelectDialog dialog = new ServerParamSelectDialog(myParamList.getParamList(), null);
+
                 if (dialog.getShow()) {
                     JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
                     JDialog dlg = pane.createDialog(Main.parent, tr("Tracer2") + " - " + tr("Select predefined parameter"));
-                	dlg.setVisible(true);
-                	Object obj = pane.getValue();
+                    dlg.setVisible(true);
+                    Object obj = pane.getValue();
                     dlg.dispose();
-                	if(obj != null && ((Integer)obj) == JOptionPane.OK_OPTION) {
-                		ServerParam param = dialog.getSelectedParam();
+                    if (obj != null && ((Integer) obj) == JOptionPane.OK_OPTION) {
+                        ServerParam param = dialog.getSelectedParam();
 
-                		dlg = new ServerParamDialog(param);
-                		dlg.setVisible(true);
-                		dlg.dispose();
-                        param = ((ServerParamDialog)dlg).getServerParam();
+                        dlg = new ServerParamDialog(param);
+                        dlg.setVisible(true);
+                        dlg.dispose();
+                        param = ((ServerParamDialog) dlg).getServerParam();
                         if (param != null && param.getName() != null && (!"".equals(param.getName()))) {
                             m_listParam.addParam(param);
                             param.setEnabled(true);
                         }
-                	}
+                    }
                 }
                 refresh();
@@ -161,8 +144,8 @@
         });
         p.add(bPredefined);
-        
+
         add(p, gbc);
         gbc.gridy++;
-        
+
         gbc.weightx = 1.0;
         gbc.weighty = 1.0;
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPreference.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPreference.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPreference.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -32,13 +15,13 @@
 
 public class ServerParamPreference extends DefaultTabPreferenceSetting {
-	
-	TracerPlugin m_oPlugin;
-	
+
+    TracerPlugin m_oPlugin;
+
     public ServerParamPreference(TracerPlugin plugin) {
-    	super("tracer2", tr("Tracer2") + " - " + tr("Preferences"), tr("Modify list of parameter for server request."));
+        super("tracer2", tr("Tracer2") + " - " + tr("Preferences"), tr("Modify list of parameter for server request."));
 
         m_oPlugin = plugin;
     }
-    
+
     @Override
     public void addGui(PreferenceTabbedPane gui) {
@@ -49,5 +32,5 @@
         p.add(sp, GBC.eol().fill(GridBagConstraints.BOTH));
     }
-    
+
     @Override
     public boolean ok() {
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamSelectDialog.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamSelectDialog.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamSelectDialog.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.preferences;
 
@@ -33,46 +16,46 @@
 
 public class ServerParamSelectDialog extends JPanel {
-	
-	private JComboBox<String> m_oComboBox;
+
+    private JComboBox<String> m_oComboBox;
     List<ServerParam> m_listServerParam;
     private boolean m_bShow = true;
-    
+
     public boolean getShow() {
-    	return m_bShow;
+        return m_bShow;
     }
-    
-	public ServerParamSelectDialog(List<ServerParam> listParam) {
-		Init(m_listServerParam, null);
-	}
-	
-	public ServerParamSelectDialog(List<ServerParam> listServerParam, ServerParam activParam) {
-		Init(listServerParam, activParam);
-	}
-	
-	private void Init(List<ServerParam> listParam, ServerParam activParam) {
+
+    public ServerParamSelectDialog(List<ServerParam> listParam) {
+        Init(m_listServerParam, null);
+    }
+
+    public ServerParamSelectDialog(List<ServerParam> listServerParam, ServerParam activParam) {
+        Init(listServerParam, activParam);
+    }
+
+    private void Init(List<ServerParam> listParam, ServerParam activParam) {
         GridBagConstraints c = new GridBagConstraints();
-        
+
         String[] astr = new String[listParam.size()];
-        
+
         m_listServerParam = listParam;
-        
-        if ( activParam == null ) {
-        	activParam = m_listServerParam.get(0);
+
+        if (activParam == null) {
+            activParam = m_listServerParam.get(0);
         }
         int i = 0;
         int pos = 0;
-        for ( ServerParam param: m_listServerParam ) {
-        	astr[i] = param.getName();
-        	if (param.equals(activParam)) {
-        		pos = i;
-        	}
-        	i++;
+        for (ServerParam param: m_listServerParam) {
+            astr[i] = param.getName();
+            if (param.equals(activParam)) {
+                pos = i;
+            }
+            i++;
         }
         m_oComboBox = new JComboBox<>(astr);
         m_oComboBox.setSelectedIndex(pos);
-        
+
         setLayout(new GridBagLayout());
-        
-        c.insets = new Insets(4,4,4,4);
+
+        c.insets = new Insets(4, 4, 4, 4);
         c.gridwidth = 1;
         c.weightx = 0.8;
@@ -81,5 +64,5 @@
         c.gridy = 0;
         add(new JLabel(tr("Parameter:")), c);
-        
+
         c.gridwidth = 1;
         c.gridx = 1;
@@ -87,14 +70,15 @@
         c.weightx = 1.5;
         add(m_oComboBox, c);
-	}
-	
-	public ServerParam getSelectedParam() {
-     	int nSel = m_oComboBox.getSelectedIndex();
+    }
+
+    public ServerParam getSelectedParam() {
+        int nSel = m_oComboBox.getSelectedIndex();
         return m_listServerParam.get(nSel);
     }
-	public void checkComboBox() {
-     	int nSel = m_oComboBox.getSelectedIndex();
+
+    public void checkComboBox() {
+        int nSel = m_oComboBox.getSelectedIndex();
         TracerPlugin.s_oPlugin.m_oParamList.setActivParam(m_listServerParam.get(nSel));
     }
-	
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetTrace.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetTrace.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetTrace.java	(revision 32788)
@@ -1,33 +1,17 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.server;
 
 import java.util.ArrayList;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.plugins.tracer2.preferences.ServerParam;
 
 public class GetTrace extends Request {
-	
-	private LatLon m_oLatLon;
-	private ServerParam m_oServerParam;
+
+    private LatLon m_oLatLon;
+    private ServerParam m_oServerParam;
     public ArrayList<LatLon> m_listLatLon = new ArrayList<>();
-    
+
     /**
      * Trace s simple shape on position.
@@ -35,81 +19,82 @@
      * @param oParam parameter for tracing.
      */
-   public GetTrace(LatLon oLatLon, ServerParam oParam) {
-    	m_oLatLon = oLatLon;
-    	m_oServerParam = oParam;
+    public GetTrace(LatLon oLatLon, ServerParam oParam) {
+        m_oLatLon = oLatLon;
+        m_oServerParam = oParam;
     }
-    
-   /**
-    * Thread that get a shape from the Server.
-    */
+
+    /**
+     * Thread that get a shape from the Server.
+     */
+    @Override
     public void run() {
-    	m_listLatLon = new ArrayList<>();
-    	
+        m_listLatLon = new ArrayList<>();
+
         try {
             String strResponse = callServer("traceOrder=GetTrace"
-            		+ "&traceLat=" + m_oLatLon.lat()
-            		+ "&traceLon=" + m_oLatLon.lon()
-            		+ "&traceName=" + m_oServerParam.getName()
-            		+ "&traceUrl=" + m_oServerParam.getUrl()
-            		+ "&traceTileSize=" + m_oServerParam.getTileSize()
-            		+ "&traceResolution=" + m_oServerParam.getResolution()
-            		//+ "&traceSkipBottom=" + param.getSkipBottom()
-            		+ "&traceMode=" + m_oServerParam.getMode()
-            		+ "&traceThreshold=" + m_oServerParam.getThreshold()
-            		+ "&tracePointsPerCircle=" + m_oServerParam.getPointsPerCircle()
-            );
-            
+                    + "&traceLat=" + m_oLatLon.lat()
+                    + "&traceLon=" + m_oLatLon.lon()
+                    + "&traceName=" + m_oServerParam.getName()
+                    + "&traceUrl=" + m_oServerParam.getUrl()
+                    + "&traceTileSize=" + m_oServerParam.getTileSize()
+                    + "&traceResolution=" + m_oServerParam.getResolution()
+                    //+ "&traceSkipBottom=" + param.getSkipBottom()
+                    + "&traceMode=" + m_oServerParam.getMode()
+                    + "&traceThreshold=" + m_oServerParam.getThreshold()
+                    + "&tracePointsPerCircle=" + m_oServerParam.getPointsPerCircle()
+                    );
+
             if (strResponse == null || strResponse.equals("")) {
-            	return;
+                return;
             }
-            
+
             if (checkError(strResponse) == true) {
-            	return;
+                return;
             }
-            
+
             if (strResponse.startsWith("(")) {
-            	GetPoints(strResponse);
-            	return;
+                GetPoints(strResponse);
+                return;
             }
             String[] astrParts = strResponse.split("&");
 
             for (String strPart : astrParts) {
-            	if (strPart.contains("tracePoints="))
-            	{
-            		String strPoints = strPart.replace("tracePoints=", "");
-            		GetPoints(strPoints);
-            		return;
-            	}
+                if (strPart.contains("tracePoints=")) {
+                    String strPoints = strPart.replace("tracePoints=", "");
+                    GetPoints(strPoints);
+                    return;
+                }
             }
         } catch (Exception e) {
-        	//m_listLatLon = new ArrayList<>();
+            //m_listLatLon = new ArrayList<>();
+            Main.warn(e);
         }
     }
-    
-    
+
     /**
      * Get points from string
      */
-     public void GetPoints(String strResponse) {
-         try {
-             if (!strResponse.startsWith("(") || !strResponse.endsWith(")")){
-             	return;
-             }
-             strResponse = strResponse.substring(1, strResponse.length()-1);
-             
-             ArrayList<LatLon> nodelist = new ArrayList<>();
-             
-             String[] astrPoints = strResponse.split("\\)\\(");
-             for (String strPoint : astrPoints) {
-                 String[] astrParts = strPoint.split(":");
-                 double x = Double.parseDouble(astrParts[0]);
-                 double y = Double.parseDouble(astrParts[1]);
-                 nodelist.add(new LatLon(x, y));
-             }
-             m_listLatLon = nodelist;
-         } catch (Exception e) {
-         	//m_listLatLon = new ArrayList<>();
-         }
-     }
-    
+    public void GetPoints(String strResponse) {
+        try {
+            if (!strResponse.startsWith("(") || !strResponse.endsWith(")")) {
+                return;
+            }
+            strResponse = strResponse.substring(1, strResponse.length()-1);
+
+            ArrayList<LatLon> nodelist = new ArrayList<>();
+
+            String[] astrPoints = strResponse.split("\\)\\(");
+            for (String strPoint : astrPoints) {
+                String[] astrParts = strPoint.split(":");
+                double x = Double.parseDouble(astrParts[0]);
+                double y = Double.parseDouble(astrParts[1]);
+                nodelist.add(new LatLon(x, y));
+            }
+            m_listLatLon = nodelist;
+        } catch (Exception e) {
+            //m_listLatLon = new ArrayList<>();
+            Main.warn(e);
+        }
+    }
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetVersion.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetVersion.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetVersion.java	(revision 32788)
@@ -1,53 +1,39 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.server;
 
+import org.openstreetmap.josm.Main;
+
 public class GetVersion extends Request {
-	
+
     public int m_nVersionMajor = -1;
     public int m_nVersionMinor = -1;
     public int m_nVersionBuild = -1;
     public int m_nVersionRevision = -1;
-    
+
     /**
      * Get version from server.
      */
-	public GetVersion() {
+    public GetVersion() {
     }
-    
-	/**
-	 * Thread that get the version of the Server.
-	 */
+
+    /**
+     * Thread that get the version of the Server.
+     */
+    @Override
     public void run() {
         try {
-            String strResponse = callServer("traceOrder=GetVersion" );
-            
+            String strResponse = callServer("traceOrder=GetVersion");
+
             if (strResponse == null || strResponse.equals("")) {
-            	return;
+                return;
             }
-            
+
             if (checkError(strResponse) == true) {
-            	return;
+                return;
             }
-            
+
             String[] astrParts = strResponse.split(":");
             if (astrParts.length < 2) {
-            	return;
+                return;
             }
             if (astrParts.length > 0) m_nVersionMajor = Integer.parseInt(astrParts[0]);
@@ -56,6 +42,7 @@
             if (astrParts.length > 3) m_nVersionRevision = Integer.parseInt(astrParts[3]);
         } catch (Exception e) {
+            Main.warn(e);
         }
     }
-    
+
 }
Index: applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java
===================================================================
--- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java	(revision 32699)
+++ applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java	(revision 32788)
@@ -1,20 +1,3 @@
-/**
- *  Tracer2 - plug-in for JOSM to capture contours
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tracer2.server;
 
@@ -31,10 +14,10 @@
 
 public class Request extends Thread {
-	
+
     static final String URL = "http://localhost:49243/";
-    
+
     public Request() {
     }
-    
+
     /**
      * Send request to the server.
@@ -53,13 +36,15 @@
             return oBuilder.toString();
         } catch (ConnectException e) {
-            JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server isn''t running. Please start the Server.\nIf you don''t have the server, please download it from\n{0}.",
-            		"http://sourceforge.net/projects/tracer2server/") , tr("Error"),  JOptionPane.ERROR_MESSAGE);
+            JOptionPane.showMessageDialog(Main.parent,
+                    tr("Tracer2Server isn''t running. Please start the Server.\nIf you don''t have the server, please download it from\n{0}.",
+                            "http://sourceforge.net/projects/tracer2server/"), tr("Error"), JOptionPane.ERROR_MESSAGE);
             return "";
         } catch (Exception e) {
-            JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server hasn''t found anything.") + "\n", tr("Error"),  JOptionPane.ERROR_MESSAGE);
-    		return "";
-    	}
+            JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server hasn''t found anything.") + "\n",
+                    tr("Error"), JOptionPane.ERROR_MESSAGE);
+            return "";
+        }
     }
-    
+
     /**
      * Checks errors in response from the server.
@@ -70,13 +55,14 @@
         String strIdentifier = "&traceError=";
         if (strResponse.contains(strIdentifier)) {
-        	String strError = strResponse.replaceFirst(strIdentifier, "").trim();
-            JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server has detected an error.") + "\n" + strError, tr("Error"),  JOptionPane.ERROR_MESSAGE);
-        	return true;
+            String strError = strResponse.replaceFirst(strIdentifier, "").trim();
+            JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server has detected an error.") + "\n" + strError,
+                    tr("Error"), JOptionPane.ERROR_MESSAGE);
+            return true;
         }
         return false;
     }
-    
+
+    @Override
     public void run() {
     }
-    
 }
