Index: applications/editors/josm/plugins/turnlanes/.checkstyle
===================================================================
--- applications/editors/josm/plugins/turnlanes/.checkstyle	(revision 33085)
+++ applications/editors/josm/plugins/turnlanes/.checkstyle	(revision 33085)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value=".svn"/>
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="resources"/>
+    <filter-data value="styles"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: applications/editors/josm/plugins/turnlanes/.project
===================================================================
--- applications/editors/josm/plugins/turnlanes/.project	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/.project	(revision 33085)
@@ -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/turnlanes/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/turnlanes/.settings/org.eclipse.jdt.ui.prefs	(revision 33085)
+++ applications/editors/josm/plugins/turnlanes/.settings/org.eclipse.jdt.ui.prefs	(revision 33085)
@@ -0,0 +1,59 @@
+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=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=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
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/CollectionUtils.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/CollectionUtils.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/CollectionUtils.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes;
 
@@ -9,5 +10,10 @@
 import java.util.Set;
 
-public class CollectionUtils {
+public final class CollectionUtils {
+
+    private CollectionUtils() {
+        // Hide default constructor for utilities classes
+    }
+
     public static <E> Iterable<E> reverse(final List<E> list) {
         return new Iterable<E>() {
@@ -15,5 +21,5 @@
             public Iterator<E> iterator() {
                 final ListIterator<E> it = list.listIterator(list.size());
-                
+
                 return new Iterator<E>() {
                     @Override
@@ -21,10 +27,10 @@
                         return it.hasPrevious();
                     }
-                    
+
                     @Override
                     public E next() {
                         return it.previous();
                     }
-                    
+
                     @Override
                     public void remove() {
@@ -35,22 +41,22 @@
         };
     }
-    
+
     public static <E> Set<E> toSet(Iterable<? extends E> iterable) {
         final Set<E> set = new HashSet<>();
-        
+
         for (E e : iterable) {
             set.add(e);
         }
-        
+
         return Collections.unmodifiableSet(set);
     }
-    
+
     public static <E> List<E> toList(Iterable<? extends E> iterable) {
         final List<E> list = new ArrayList<>();
-        
+
         for (E e : iterable) {
             list.add(e);
         }
-        
+
         return Collections.unmodifiableList(list);
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/TurnLanesPlugin.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/TurnLanesPlugin.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/TurnLanesPlugin.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes;
 
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -27,13 +28,13 @@
     static final Color RED = new Color(234, 66, 108);
     static final Color GREEN = new Color(66, 234, 108);
-    
+
     private static final GuiContainer EMPTY = new GuiContainer(ModelContainer.empty());
-    
+
     public static GuiContainer empty() {
         return EMPTY;
     }
-    
+
     private final ModelContainer mc;
-    
+
     private final Point2D translation;
     /**
@@ -43,20 +44,20 @@
     private final double scale;
     private final double laneWidth;
-    
+
     private final Map<Junction, JunctionGui> junctions = new HashMap<>();
     private final Map<Road, RoadGui> roads = new HashMap<>();
-    
+
     private final Stroke connectionStroke;
-    
-    public GuiContainer(ModelContainer mc) {
+
+    GuiContainer(ModelContainer mc) {
         final Point2D origin = avgOrigin(locs(mc.getPrimaryJunctions()));
-        
+
         final LatLon originCoor = Main.getProjection().eastNorth2latlon(new EastNorth(origin.getX(), origin.getY()));
         final LatLon relCoor = Main.getProjection().eastNorth2latlon(
                 new EastNorth(origin.getX() + 1, origin.getY() + 1));
-        
+
         // meters per source unit
         final double mpsu = relCoor.greatCircleDistance(originCoor) / sqrt(2);
-        
+
         this.mc = mc;
         this.translation = new Point2D.Double(-origin.getX(), -origin.getY());
@@ -64,28 +65,28 @@
         this.scale = mpsu / mpp;
         this.laneWidth = 2 / mpp;
-        
+
         this.connectionStroke = new BasicStroke((float) (laneWidth / 4), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
-        
+
         for (Junction j : mc.getPrimaryJunctions()) {
             getGui(j);
         }
     }
-    
+
     private static Point2D avgOrigin(List<Point2D> locs) {
         if (locs.isEmpty()) {
             return new Point2D.Double(0, 0);
         }
-        
+
         double x = 0;
         double y = 0;
-        
+
         for (Point2D l : locs) {
             x += l.getX();
             y += l.getY();
         }
-        
+
         return new Point2D.Double(x / locs.size(), y / locs.size());
     }
-    
+
     public JunctionGui getGui(Junction j) {
         final JunctionGui existing = junctions.get(j);
@@ -93,8 +94,8 @@
             return existing;
         }
-        
+
         return new JunctionGui(this, j);
     }
-    
+
     void register(JunctionGui j) {
         if (junctions.put(j.getModel(), j) != null) {
@@ -102,8 +103,8 @@
         }
     }
-    
+
     public RoadGui getGui(Road r) {
         final RoadGui gui = roads.get(r);
-        
+
         if (gui == null) {
             final RoadGui newGui = new RoadGui(this, r);
@@ -111,12 +112,12 @@
             return newGui;
         }
-        
+
         return gui;
     }
-    
+
     Point2D translateAndScale(Point2D loc) {
         return new Point2D.Double((loc.getX() + translation.getX()) * scale, (loc.getY() + translation.getY()) * scale);
     }
-    
+
     /**
      * @return meters per pixel
@@ -125,20 +126,20 @@
         return mpp;
     }
-    
+
     public double getScale() {
         return scale;
     }
-    
+
     public double getLaneWidth() {
         return laneWidth;
     }
-    
+
     public Stroke getConnectionStroke() {
         return connectionStroke;
     }
-    
+
     public LaneGui getGui(Lane lane) {
         final RoadGui roadGui = roads.get(lane.getRoad());
-        
+
         for (LaneGui l : roadGui.getLanes()) {
             if (l.getModel().equals(lane)) {
@@ -146,17 +147,17 @@
             }
         }
-        
+
         throw new IllegalArgumentException(tr("No such lane."));
     }
-    
+
     public ModelContainer getModel() {
         return mc;
     }
-    
+
     public Rectangle2D getBounds() {
         if (isEmpty()) {
             return new Rectangle2D.Double(-1, -1, 2, 2);
         }
-        
+
         final List<Junction> primaries = new ArrayList<>(mc.getPrimaryJunctions());
         final List<Double> top = new ArrayList<>();
@@ -164,9 +165,9 @@
         final List<Double> right = new ArrayList<>();
         final List<Double> bottom = new ArrayList<>();
-        
+
         for (Junction j : primaries) {
             final JunctionGui g = getGui(j);
             final Rectangle2D b = g.getBounds();
-            
+
             top.add(b.getMinY());
             left.add(b.getMinX());
@@ -174,25 +175,25 @@
             bottom.add(b.getMaxY());
         }
-        
+
         final double t = Collections.min(top);
         final double l = Collections.min(left);
         final double r = Collections.max(right);
         final double b = Collections.max(bottom);
-        
+
         return new Rectangle2D.Double(l, t, r - l, b - t);
     }
-    
+
     public GuiContainer recalculate() {
         return new GuiContainer(mc.recalculate());
     }
-    
+
     public Iterable<RoadGui> getRoads() {
         return roads.values();
     }
-    
+
     public Iterable<JunctionGui> getJunctions() {
         return junctions.values();
     }
-    
+
     public boolean isEmpty() {
         return mc.isEmpty();
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiUtil.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiUtil.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiUtil.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -16,5 +17,10 @@
 import org.openstreetmap.josm.plugins.turnlanes.model.Junction;
 
-class GuiUtil {
+final class GuiUtil {
+
+    private GuiUtil() {
+        // Hide default constructor for utilities classes
+    }
+
     static double normalize(double a) {
         while (a < 0) {
@@ -26,22 +32,22 @@
         return a;
     }
-    
+
     // control point factor for curves (circle segment of angle a)
     static double cpf(double a, double scale) {
         return 4.0 / 3 * Math.tan(min(abs(a), PI - 0.001) / 4) * scale;
     }
-    
+
     static Point2D intersection(Line2D a, Line2D b) {
         final double aa = GuiUtil.angle(a);
         final double ab = GuiUtil.angle(b);
-        
+
         // less than 1/2 degree => no intersection
         if (Math.abs(Math.PI - abs(minAngleDiff(aa, ab))) < PI / 360) {
             return null;
         }
-        
+
         final double d = (a.getX1() - a.getX2()) * (b.getY1() - b.getY2()) - (a.getY1() - a.getY2())
             * (b.getX1() - b.getX2());
-        
+
         final double x = ((b.getX1() - b.getX2()) * (a.getX1() * a.getY2() - a.getY1() * a.getX2()) - (a.getX1() - a
             .getX2()) * (b.getX1() * b.getY2() - b.getY1() * b.getX2()))
@@ -50,96 +56,96 @@
             .getY2()) * (b.getX1() * b.getY2() - b.getY1() * b.getX2()))
             / d;
-        
+
         return new Point2D.Double(x, y);
     }
-    
+
     static Point2D closest(Line2D l, Point2D p) {
         final Point2D lv = vector(l.getP1(), l.getP2());
         final double numerator = dot(vector(l.getP1(), p), lv);
-        
+
         if (numerator < 0) {
             return l.getP1();
         }
-        
+
         final double denominator = dot(lv, lv);
         if (numerator >= denominator) {
             return l.getP2();
         }
-        
+
         final double r = numerator / denominator;
         return new Point2D.Double(l.getX1() + r * lv.getX(), l.getY1() + r * lv.getY());
     }
-    
+
     private static double dot(Point2D a, Point2D b) {
         return a.getX() * b.getX() + a.getY() * b.getY();
     }
-    
+
     private static Point2D vector(Point2D from, Point2D to) {
         return new Point2D.Double(to.getX() - from.getX(), to.getY() - from.getY());
     }
-    
+
     public static double angle(Point2D from, Point2D to) {
         final double dx = to.getX() - from.getX();
         final double dy = -(to.getY() - from.getY());
-        
+
         return normalize(Math.atan2(dy, dx));
     }
-    
+
     public static Point2D relativePoint(Point2D p, double r, double a) {
-        return new Point2D.Double( //
-            p.getX() + r * Math.cos(a), //
-            p.getY() - r * Math.sin(a) //
+        return new Point2D.Double(
+            p.getX() + r * Math.cos(a),
+            p.getY() - r * Math.sin(a)
         );
     }
-    
+
     public static Line2D relativeLine(Line2D l, double r, double a) {
         final double dx = r * Math.cos(a);
         final double dy = -r * Math.sin(a);
-        
-        return new Line2D.Double( //
-            l.getX1() + dx, //
-            l.getY1() + dy, //
-            l.getX2() + dx, //
-            l.getY2() + dy //
+
+        return new Line2D.Double(
+            l.getX1() + dx,
+            l.getY1() + dy,
+            l.getX2() + dx,
+            l.getY2() + dy
         );
     }
-    
+
     public static double angle(Line2D l) {
         return angle(l.getP1(), l.getP2());
     }
-    
+
     public static double minAngleDiff(double a1, double a2) {
         final double d = normalize(a2 - a1);
-        
+
         return d > Math.PI ? -(2 * Math.PI - d) : d;
     }
-    
-    public static final Point2D middle(Point2D a, Point2D b) {
+
+    public static Point2D middle(Point2D a, Point2D b) {
         return relativePoint(a, a.distance(b) / 2, angle(a, b));
     }
-    
-    public static final Point2D middle(Line2D l) {
+
+    public static Point2D middle(Line2D l) {
         return middle(l.getP1(), l.getP2());
     }
-    
+
     public static Line2D line(Point2D p, double a) {
         return new Line2D.Double(p, relativePoint(p, 1, a));
     }
-    
+
     public static Point2D loc(Node node) {
         final EastNorth loc = Main.getProjection().latlon2eastNorth(node.getCoor());
         return new Point2D.Double(loc.getX(), -loc.getY());
     }
-    
+
     public static List<Point2D> locs(Iterable<Junction> junctions) {
         final List<Point2D> locs = new ArrayList<>();
-        
+
         for (Junction j : junctions) {
             locs.add(loc(j.getNode()));
         }
-        
+
         return locs;
     }
-    
+
     static void area(Path2D area, Path inner, Path outer) {
         area.append(inner.getIterator(), false);
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/InteractiveElement.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/InteractiveElement.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/InteractiveElement.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -13,31 +14,31 @@
         Type VIA_CONNECTOR = new Type() {};
     }
-    
+
     public void paintBackground(Graphics2D g2d, State state) {}
-    
+
     abstract void paint(Graphics2D g2d, State state);
-    
+
     abstract boolean contains(Point2D p, State state);
-    
+
     abstract Type getType();
-    
+
     State activate(State old) {
         return old;
     }
-    
+
     boolean beginDrag(double x, double y) {
         return false;
     }
-    
+
     State drag(double x, double y, InteractiveElement target, State old) {
         return old;
     }
-    
+
     State drop(double x, double y, InteractiveElement target, State old) {
         return old;
     }
-    
+
     abstract int getZIndex();
-    
+
     State click(State old) {
         return old;
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionGui.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionGui.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionGui.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -39,13 +40,13 @@
     private final class TurnConnection extends InteractiveElement {
         private final Turn turn;
-        
+
         private Point2D dragBegin;
         private double dragOffsetX = 0;
         private double dragOffsetY = 0;
-        
-        public TurnConnection(Turn turn) {
+
+        TurnConnection(Turn turn) {
             this.turn = turn;
         }
-        
+
         @Override
         void paint(Graphics2D g2d, State state) {
@@ -58,13 +59,13 @@
             }
         }
-        
+
         private Path2D getPath() {
             final Path2D path = new Path2D.Double();
-            
+
             final LaneGui laneGui = getContainer().getGui(turn.getFrom());
             final RoadGui roadGui = getContainer().getGui(turn.getTo().getRoad());
-            
+
             path.moveTo(laneGui.outgoing.getCenter().getX(), laneGui.outgoing.getCenter().getY());
-            
+
             Junction j = laneGui.getModel().getOutgoingJunction();
             for (Road v : turn.getVia()) {
@@ -77,14 +78,14 @@
                     j = v.getFromEnd().getJunction();
                 }
-                
+
                 path.append(it, true);
             }
-            
+
             path.lineTo(roadGui.getConnector(turn.getTo()).getCenter().getX(), roadGui.getConnector(turn.getTo()).getCenter()
                 .getY());
-            
+
             return path;
         }
-        
+
         private boolean isVisible(State state) {
             if (state instanceof State.AllTurns) {
@@ -95,8 +96,8 @@
                 return turn.getTo().equals(((State.IncomingActive) state).getRoadEnd());
             }
-            
+
             return false;
         }
-        
+
         @Override
         boolean contains(Point2D p, State state) {
@@ -104,5 +105,5 @@
                 return false;
             }
-            
+
             final PathIterator it = new FlatteningPathIterator(getPath().getPathIterator(null), 0.05 / getContainer()
                 .getMpp());
@@ -113,33 +114,33 @@
                 if (it.currentSegment(coords) == PathIterator.SEG_LINETO) {
                     final Point2D closest = closest(new Line2D.Double(lastX, lastY, coords[0], coords[1]), p);
-                    
+
                     if (p.distance(closest) <= strokeWidth() / 2) {
                         return true;
                     }
                 }
-                
+
                 lastX = coords[0];
                 lastY = coords[1];
                 it.next();
             }
-            
+
             return false;
         }
-        
+
         private double strokeWidth() {
             final BasicStroke stroke = (BasicStroke) getContainer().getConnectionStroke();
             return stroke.getLineWidth();
         }
-        
+
         @Override
         Type getType() {
             return Type.TURN_CONNECTION;
         }
-        
+
         @Override
         int getZIndex() {
             return 0;
         }
-        
+
         @Override
         boolean beginDrag(double x, double y) {
@@ -149,5 +150,5 @@
             return true;
         }
-        
+
         @Override
         State drag(double x, double y, InteractiveElement target, State old) {
@@ -156,13 +157,13 @@
             return old;
         }
-        
+
         @Override
         State drop(double x, double y, InteractiveElement target, State old) {
             drag(x, y, target, old);
-            
+
             if (isRemoveDragOffset()) {
                 turn.remove();
             }
-            
+
             dragBegin = null;
             dragOffsetX = 0;
@@ -170,5 +171,5 @@
             return new State.Dirty(old);
         }
-        
+
         private boolean isRemoveDragOffset() {
             final double r = getContainer().getGui(turn.getFrom().getRoad()).connectorRadius;
@@ -177,19 +178,19 @@
         }
     }
-    
+
     private final class Corner {
         final double x1;
         final double y1;
-        
+
         final double cx1;
         final double cy1;
-        
+
         final double cx2;
         final double cy2;
-        
+
         final double x2;
         final double y2;
-        
-        public Corner(Point2D c1, Point2D cp1, Point2D cp2, Point2D c2) {
+
+        Corner(Point2D c1, Point2D cp1, Point2D cp2, Point2D c2) {
             this.x1 = c1.getX();
             this.y1 = c1.getY();
@@ -201,5 +202,5 @@
             this.y2 = c2.getY();
         }
-        
+
         @Override
         public String toString() {
@@ -208,35 +209,35 @@
         }
     }
-    
+
     private final class Linkage implements Comparable<Linkage> {
         final RoadGui roadGui;
         final Road.End roadEnd;
         final double angle;
-        
+
         double lTrim;
         double rTrim;
-        
-        public Linkage(Road.End roadEnd) {
+
+        Linkage(Road.End roadEnd) {
             this.roadGui = getContainer().getGui(roadEnd.getRoad());
             this.roadEnd = roadEnd;
             this.angle = normalize(roadGui.getAngle(roadEnd) + PI);
-            
+
             roads.put(angle, this);
         }
-        
+
         @Override
         public int compareTo(Linkage o) {
             return Double.compare(angle, o.angle);
         }
-        
+
         public void trimLeft(Linkage right) {
             right.trimRight(this);
-            
+
             final Line2D leftCurb = roadGui.getLeftCurb(roadEnd);
             final Line2D rightCurb = right.roadGui.getRightCurb(right.roadEnd);
-            
+
             final double leftAngle = angle(leftCurb);
             final double rightAngle = angle(rightCurb);
-            
+
             final Point2D isect;
             if (abs(PI - normalize(rightAngle - leftAngle)) > PI / 12) {
@@ -245,17 +246,17 @@
                 isect = GuiUtil.relativePoint(leftCurb.getP1(), roadGui.getWidth(roadEnd) / 2, angle);
             }
-            
+
             if (Math.abs(leftAngle - angle(leftCurb.getP1(), isect)) < 0.1) {
                 lTrim = leftCurb.getP1().distance(isect);
             }
         }
-        
+
         private void trimRight(Linkage left) {
             final Line2D rightCurb = roadGui.getRightCurb(roadEnd);
             final Line2D leftCurb = left.roadGui.getLeftCurb(left.roadEnd);
-            
+
             final double rightAngle = angle(rightCurb);
             final double leftAngle = angle(leftCurb);
-            
+
             final Point2D isect;
             if (abs(PI - normalize(rightAngle - leftAngle)) > PI / 12) {
@@ -264,55 +265,55 @@
                 isect = GuiUtil.relativePoint(rightCurb.getP1(), roadGui.getWidth(roadEnd) / 2, angle);
             }
-            
+
             if (Math.abs(rightAngle - angle(rightCurb.getP1(), isect)) < 0.1) {
                 rTrim = rightCurb.getP1().distance(isect);
             }
         }
-        
+
         public void trimAdjust() {
             final double MAX_TAN = tan(PI / 2 - MAX_ANGLE);
-            
+
             final double sin = roadGui.getWidth(roadEnd);
             final double cos = abs(lTrim - rTrim);
             final double tan = sin / cos;
-            
+
             if (tan < MAX_TAN) {
                 lTrim = max(lTrim, rTrim - sin / MAX_TAN);
                 rTrim = max(rTrim, lTrim - sin / MAX_TAN);
             }
-            
+
             lTrim += container.getLaneWidth() / 2;
             rTrim += container.getLaneWidth() / 2;
         }
     }
-    
+
     // max angle between corners
     private static final double MAX_ANGLE = Math.toRadians(30);
-    
+
     private final GuiContainer container;
     private final Junction junction;
-    
+
     final double x;
     final double y;
-    
+
     private final NavigableMap<Double, Linkage> roads = new TreeMap<>();
-    
+
     private final Path2D area = new Path2D.Double();
-    
-    public JunctionGui(GuiContainer container, Junction j) {
+
+    JunctionGui(GuiContainer container, Junction j) {
         this.container = container;
         this.junction = j;
-        
+
         container.register(this);
-        
+
         final Point2D loc = container.translateAndScale(loc(j.getNode()));
         this.x = loc.getX();
         this.y = loc.getY();
-        
+
         final Set<Road> done = new HashSet<>();
         for (Road r : j.getRoads()) {
             if (!done.contains(r)) {
                 done.add(r);
-                
+
                 if (r.getFromEnd().getJunction().equals(j)) {
                     new Linkage(r.getFromEnd());
@@ -323,8 +324,8 @@
             }
         }
-        
+
         recalculate();
     }
-    
+
     void recalculate() {
         for (Linkage l : roads.values()) {
@@ -332,10 +333,10 @@
             l.rTrim = 0;
         }
-        
+
         area.reset();
         if (roads.size() < 2) {
             return;
         }
-        
+
         Linkage last = roads.lastEntry().getValue();
         for (Linkage l : roads.values()) {
@@ -346,5 +347,5 @@
             l.trimAdjust();
         }
-        
+
         boolean first = true;
         for (Corner c : corners()) {
@@ -355,14 +356,14 @@
                 area.lineTo(c.x1, c.y1);
             }
-            
+
             area.curveTo(c.cx1, c.cy1, c.cx2, c.cy2, c.x2, c.y2);
         }
-        
+
         area.closePath();
     }
-    
+
     private Iterable<Corner> corners() {
         final List<Corner> result = new ArrayList<>(roads.size());
-        
+
         Linkage last = roads.lastEntry().getValue();
         for (Linkage l : roads.values()) {
@@ -370,43 +371,43 @@
             last = l;
         }
-        
+
         return result;
     }
-    
+
     private Corner corner(Linkage right, Linkage left) {
         final Line2D rightCurb = right.roadGui.getRightCurb(right.roadEnd);
         final Line2D leftCurb = left.roadGui.getLeftCurb(left.roadEnd);
-        
+
         final double rightAngle = angle(rightCurb);
         final double leftAngle = angle(leftCurb);
-        
+
         final double delta = normalize(leftAngle - rightAngle);
-        
+
         final boolean wide = delta > PI;
         final double a = wide ? max(0, delta - (PI + 2 * MAX_ANGLE)) : delta;
-        
+
         final double cpf1 = cpf(a, container.getLaneWidth() / 2 + (wide ? right.roadGui.getWidth(right.roadEnd) : 0));
         final double cpf2 = cpf(a, container.getLaneWidth() / 2 + (wide ? left.roadGui.getWidth(left.roadEnd) : 0));
-        
+
         final Point2D c1 = relativePoint(rightCurb.getP1(), cpf1, right.angle + PI);
         final Point2D c2 = relativePoint(leftCurb.getP1(), cpf2, left.angle + PI);
-        
+
         return new Corner(rightCurb.getP1(), c1, c2, leftCurb.getP1());
     }
-    
+
     public Set<RoadGui> getRoads() {
         final Set<RoadGui> result = new HashSet<>();
-        
+
         for (Linkage l : roads.values()) {
             result.add(l.roadGui);
         }
-        
+
         return Collections.unmodifiableSet(result);
     }
-    
+
     double getLeftTrim(Road.End end) {
         return getLinkage(end).lTrim;
     }
-    
+
     private Linkage getLinkage(Road.End end) {
         final double a = normalize(getContainer().getGui(end.getRoad()).getAngle(end) + PI);
@@ -414,27 +415,27 @@
         return e != null ? e.getValue() : null;
     }
-    
+
     double getRightTrim(Road.End end) {
         return getLinkage(end).rTrim;
     }
-    
+
     Point2D getPoint() {
         return new Point2D.Double(x, y);
     }
-    
+
     public GuiContainer getContainer() {
         return container;
     }
-    
+
     public Junction getModel() {
         return junction;
     }
-    
+
     public List<InteractiveElement> paint(Graphics2D g2d) {
         g2d.setColor(new Color(96, 96, 96));
         g2d.fill(area);
-        
+
         final List<InteractiveElement> result = new ArrayList<>();
-        
+
         if (getModel().isPrimary()) {
             for (Road.End r : new HashSet<>(getModel().getRoadEnds())) {
@@ -444,8 +445,8 @@
             }
         }
-        
+
         return result;
     }
-    
+
     public Rectangle2D getBounds() {
         return area.getBounds2D();
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionPane.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionPane.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionPane.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -39,10 +40,11 @@
         private int originY;
         private int button;
-        
+
+        @Override
         public void mousePressed(MouseEvent e) {
             JunctionPane.this.requestFocus();
-            
+
             button = e.getButton();
-            
+
             if (button == MouseEvent.BUTTON1) {
                 final Point2D mouse = translateMouseCoords(e);
@@ -55,9 +57,9 @@
                 }
             }
-            
+
             originX = e.getX();
             originY = e.getY();
         }
-        
+
         @Override
         public void mouseReleased(MouseEvent e) {
@@ -66,9 +68,9 @@
                 setState(dragging.drop(mouse.getX(), mouse.getY(), dropTarget(mouse), state));
             }
-            
+
             dragging = null;
             repaint();
         }
-        
+
         private InteractiveElement dropTarget(Point2D mouse) {
             for (InteractiveElement ie : interactives()) {
@@ -77,8 +79,8 @@
                 }
             }
-            
+
             return null;
         }
-        
+
         @Override
         public void mouseClicked(MouseEvent e) {
@@ -93,9 +95,10 @@
             }
         }
-        
+
+        @Override
         public void mouseDragged(MouseEvent e) {
             if (button == MouseEvent.BUTTON1) {
                 final Point2D mouse = translateMouseCoords(e);
-                
+
                 if (dragging == null) {
                     final Point2D origin = translateCoords(originX, originY);
@@ -105,10 +108,10 @@
                                 dragging = ie;
                             }
-                            
+
                             break;
                         }
                     }
                 }
-                
+
                 if (dragging != null) {
                     setState(dragging.drag(mouse.getX(), mouse.getY(), dropTarget(mouse), state));
@@ -116,40 +119,40 @@
             } else if (button == MouseEvent.BUTTON3) {
                 translate(e.getX() - originX, e.getY() - originY);
-                
+
                 originX = e.getX();
                 originY = e.getY();
             }
         }
-        
+
         @Override
         public void mouseWheelMoved(MouseWheelEvent e) {
             scale(e.getX(), e.getY(), Math.pow(0.8, e.getWheelRotation()));
         }
-        
+
         private Point2D translateMouseCoords(MouseEvent e) {
             return translateCoords(e.getX(), e.getY());
         }
-        
+
         private Point2D translateCoords(int x, int y) {
             final double c = Math.cos(-rotation);
             final double s = Math.sin(-rotation);
-            
+
             final double x2 = -translationX + x / scale;
             final double y2 = -translationY + y / scale;
-            
+
             return new Point2D.Double(x2 * c - y2 * s, x2 * s + y2 * c);
         }
     }
-    
+
     private static final long serialVersionUID = 6917061040674799271L;
-    
+
     private static final Color TRANSPARENT = new Color(0, 0, 0, 0);
-    
+
     private final MouseInputProcessor mip = new MouseInputProcessor();
-    
+
     private GuiContainer container;
-    
+
     private final JLabel error = new JLabel("");
-    
+
     private int width = 0;
     private int height = 0;
@@ -161,23 +164,23 @@
     private BufferedImage passive;
     private BufferedImage interactive;
-    
+
     private final NavigableMap<Integer, List<InteractiveElement>> interactives = new TreeMap<>();
     private State state;
     private InteractiveElement dragging;
-    
-    public JunctionPane(GuiContainer container) {
+
+    JunctionPane(GuiContainer container) {
         setJunction(container);
-        
+
         setLayout(new GridBagLayout());
         error.setOpaque(false);
         add(error, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                 new Insets(8, 8, 8, 8), 0, 0));
-        
+
         setFocusable(true);
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), "refresh");
         getActionMap().put("refresh", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -185,10 +188,10 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0), "zoomIn");
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0), "zoomIn");
         getActionMap().put("zoomIn", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -196,10 +199,10 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, 0), "zoomOut");
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0), "zoomOut");
         getActionMap().put("zoomOut", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -207,9 +210,9 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "center");
         getActionMap().put("center", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -217,9 +220,9 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK), "toggleAllTurns");
         getActionMap().put("toggleAllTurns", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -227,9 +230,9 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_DOWN_MASK), "rotateLeft");
         getActionMap().put("rotateLeft", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -238,9 +241,9 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK), "rotateRight");
         getActionMap().put("rotateRight", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -249,9 +252,9 @@
             }
         });
-        
+
         getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete");
         getActionMap().put("delete", new AbstractAction() {
             private static final long serialVersionUID = 1L;
-            
+
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -260,5 +263,5 @@
         });
     }
-    
+
     public void setJunction(GuiContainer container) {
         removeMouseListener(mip);
@@ -267,27 +270,27 @@
         this.interactives.clear();
         this.dragging = null;
-        
+
         this.container = container;
         center();
         setState(new State.Invalid(new State.Default()));
-        
+
         addMouseListener(mip);
         addMouseMotionListener(mip);
         addMouseWheelListener(mip);
     }
-    
+
     private void center() {
         final Rectangle2D bounds = container.getBounds();
-        
+
         rotation = 0;
-        
+
         scale = Math.min(getHeight() / 2 / bounds.getHeight(), getWidth() / 2 / bounds.getWidth());
-        
+
         translationX = -bounds.getCenterX();
         translationY = -bounds.getCenterY();
-        
+
         translate(getWidth() / 2d, getHeight() / 2d);
     }
-    
+
     private void toggleAllTurns() {
         if (state instanceof State.AllTurns) {
@@ -297,8 +300,8 @@
         }
     }
-    
+
     private void setState(State state) {
         error.setText("");
-        
+
         if (state instanceof State.AllTurns) {
             dirty = true;
@@ -307,10 +310,10 @@
             dirty = true;
             setState(((State.Invalid) state).unwrap());
-            
+
             try {
                 final GuiContainer old = container;
-                
+
                 container = container.recalculate();
-                
+
                 if (old.isEmpty() != container.isEmpty()) {
                     center();
@@ -327,12 +330,12 @@
             this.state = state.carryOver(container);
         }
-        
+
         repaint();
     }
-    
+
     private void displayError(UnexpectedDataException e) {
         if (e.getKind() == UnexpectedDataException.Kind.MISSING_TAG
                 && UnexpectedDataException.Kind.MISSING_TAG.format("lanes").equals(e.getMessage())) {
-            
+
             error.setText(tr("<html>The number of lanes is not specified for one or more roads;"
                     + " please add missing lanes tags.</html>"));
@@ -341,5 +344,5 @@
         }
     }
-    
+
     private void displayError(RuntimeException e) {
         error.setText(tr("<html>An error occurred while constructing the model."
@@ -347,30 +350,30 @@
                 + "<br><br>Error: {0}</html>", e.getMessage()));
     }
-    
+
     void scale(int x, int y, double scale) {
         this.scale *= scale;
-        
+
         final double w = getWidth();
         final double h = getHeight();
-        
+
         translationX -= (w * (scale - 1)) / (2 * this.scale);
         translationY -= (h * (scale - 1)) / (2 * this.scale);
-        
+
         dirty = true;
         repaint();
     }
-    
+
     void scale(double scale) {
         scale(getWidth() / 2, getHeight() / 2, scale);
     }
-    
+
     void translate(double x, double y) {
         translationX += x / scale;
         translationY += y / scale;
-        
+
         dirty = true;
         repaint();
     }
-    
+
     @Override
     protected void paintComponent(Graphics g) {
@@ -379,10 +382,10 @@
             width = getWidth();
             height = getHeight();
-            
+
             // translate already set dirty flag
             passive = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
             interactive = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         }
-        
+
         if (dirty) {
             paintPassive((Graphics2D) passive.getGraphics());
@@ -390,13 +393,13 @@
         }
         paintInteractive((Graphics2D) interactive.getGraphics());
-        
+
         final Graphics2D g2d = (Graphics2D) g;
-        
+
         g2d.drawImage(passive, 0, 0, getWidth(), getHeight(), null);
         g2d.drawImage(interactive, 0, 0, getWidth(), getHeight(), null);
-        
+
         paintChildren(g);
     }
-    
+
     private void paintInteractive(Graphics2D g2d) {
         g2d.setBackground(TRANSPARENT);
@@ -405,11 +408,11 @@
         g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
         g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
-        
+
         g2d.scale(scale, scale);
         g2d.translate(translationX, translationY);
         g2d.rotate(rotation);
-        
+
         g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.7f));
-        
+
         for (Map.Entry<Integer, List<InteractiveElement>> e : interactives.entrySet()) {
             for (InteractiveElement ie : e.getValue()) {
@@ -421,32 +424,32 @@
         }
     }
-    
+
     private List<InteractiveElement> interactives() {
         final List<InteractiveElement> result = new ArrayList<>();
-        
+
         for (List<InteractiveElement> ies : interactives.descendingMap().values()) {
             result.addAll(ies);
         }
-        
+
         return result;
     }
-    
+
     private void paintPassive(Graphics2D g2d) {
         interactives.clear();
-        
+
         g2d.setBackground(new Color(100, 160, 240));
         g2d.clearRect(0, 0, getWidth(), getHeight());
-        
+
         g2d.scale(scale, scale);
         g2d.translate(translationX, translationY);
         g2d.rotate(rotation);
-        
+
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-        
+
         g2d.setColor(Color.GRAY);
         for (RoadGui r : container.getRoads()) {
             addAllInteractives(r.paint(g2d));
         }
-        
+
         for (JunctionGui j : container.getJunctions()) {
             addAllInteractives(j.paint(g2d));
@@ -454,9 +457,9 @@
         }
     }
-    
+
     private void addAllInteractives(List<InteractiveElement> ies) {
         for (InteractiveElement ie : ies) {
             final List<InteractiveElement> existing = interactives.get(ie.getZIndex());
-            
+
             final List<InteractiveElement> list;
             if (existing == null) {
@@ -466,22 +469,22 @@
                 list = existing;
             }
-            
+
             list.add(ie);
         }
     }
-    
+
     static void dot(Graphics2D g2d, Point2D p, double r, Color c) {
         final Color old = g2d.getColor();
-        
+
         g2d.setColor(c);
         g2d.fill(new Ellipse2D.Double(p.getX() - r, p.getY() - r, 2 * r, 2 * r));
-        
+
         g2d.setColor(old);
     }
-    
+
     static void dot(Graphics2D g2d, Point2D p, double r) {
         dot(g2d, p, r, Color.RED);
     }
-    
+
     void refresh() {
         setState(new State.Invalid(state));
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/LaneGui.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/LaneGui.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/LaneGui.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -29,9 +30,9 @@
         private final Point2D center = new Point2D.Double();
         private final Ellipse2D circle = new Ellipse2D.Double();
-        
+
         private Point2D dragDelta;
-        
+
         private LengthSlider() {}
-        
+
         @Override
         public void paint(Graphics2D g2d, State state) {
@@ -39,5 +40,5 @@
                 g2d.setColor(Color.BLUE);
                 g2d.fill(circle);
-                
+
                 final String len = METER_FORMAT.format(getLength() * getRoad().getContainer().getMpp());
                 final Rectangle2D bounds = circle.getBounds2D();
@@ -46,23 +47,23 @@
             }
         }
-        
+
         private boolean isVisible(State state) {
             if (state instanceof State.OutgoingActive) {
                 return LaneGui.this.equals(((State.OutgoingActive) state).getLane());
             }
-            
+
             return false;
         }
-        
+
         @Override
         public boolean contains(Point2D p, State state) {
             return isVisible(state) && circle.contains(p);
         }
-        
+
         @Override
         public Type getType() {
             return Type.INCOMING_CONNECTOR;
         }
-        
+
         @Override
         boolean beginDrag(double x, double y) {
@@ -70,5 +71,5 @@
             return true;
         }
-        
+
         @Override
         State drag(double x, double y, InteractiveElement target, State old) {
@@ -76,5 +77,5 @@
             return new State.Dirty(old);
         }
-        
+
         @Override
         State drop(double x, double y, InteractiveElement target, State old) {
@@ -82,31 +83,31 @@
             return old;
         }
-        
+
         void move(double x, double y, boolean updateModel) {
             final double r = getRoad().connectorRadius;
-            
+
             final double offset = getRoad().getOffset(x, y);
             final double newLength = getModel().getOutgoingRoadEnd().isFromEnd() ? offset : getRoad().getLength()
                     - offset;
             final double adjustedLength = min(max(newLength, 0.1), getRoad().getLength());
-            
+
             length = adjustedLength;
             if (updateModel) {
                 getModel().setLength(adjustedLength * getRoad().getContainer().getMpp());
             }
-            
+
             center.setLocation(x, y);
             circle.setFrame(x - r, y - r, 2 * r, 2 * r);
         }
-        
+
         public void move(Point2D loc) {
             final double x = loc.getX();
             final double y = loc.getY();
             final double r = getRoad().connectorRadius;
-            
+
             center.setLocation(x, y);
             circle.setFrame(x - r, y - r, 2 * r, 2 * r);
         }
-        
+
         @Override
         int getZIndex() {
@@ -114,14 +115,14 @@
         }
     }
-    
+
     final class OutgoingConnector extends InteractiveElement {
         private final Point2D center = new Point2D.Double();
         private final Ellipse2D circle = new Ellipse2D.Double();
-        
+
         private Point2D dragLocation;
         private IncomingConnector dropTarget;
-        
+
         private OutgoingConnector() {}
-        
+
         @Override
         public void paintBackground(Graphics2D g2d, State state) {
@@ -129,16 +130,16 @@
                 final Composite old = g2d.getComposite();
                 g2d.setComposite(((AlphaComposite) old).derive(0.2f));
-                
+
                 g2d.setColor(new Color(255, 127, 31));
                 LaneGui.this.fill(g2d);
-                
+
                 g2d.setComposite(old);
             }
-            
+
             if (dragLocation != null) {
                 final State.Connecting s = (State.Connecting) state;
                 final Path2D path = new Path2D.Double();
                 path.moveTo(center.getX(), center.getY());
-                
+
                 final List<RoadGui.ViaConnector> vias = s.getViaConnectors();
                 for (int i = 0; i < vias.size() - 1; i += 2) {
@@ -151,5 +152,5 @@
                     path.lineTo(last.getCenter().getX(), last.getCenter().getY());
                 }
-                
+
                 if (dropTarget == null) {
                     g2d.setColor(GuiContainer.RED);
@@ -159,10 +160,10 @@
                     path.lineTo(dropTarget.getCenter().getX(), dropTarget.getCenter().getY());
                 }
-                
+
                 g2d.setStroke(getContainer().getConnectionStroke());
                 g2d.draw(path);
             }
         }
-        
+
         @Override
         public void paint(Graphics2D g2d, State state) {
@@ -172,5 +173,5 @@
                     g2d.setComposite(((AlphaComposite) old).derive(1f));
                 }
-                
+
                 g2d.setColor(Color.WHITE);
                 g2d.fill(circle);
@@ -178,59 +179,59 @@
             }
         }
-        
+
         private boolean isActive(State state) {
             return state instanceof State.OutgoingActive
                     && LaneGui.this.equals(((State.OutgoingActive) state).getLane());
         }
-        
+
         private boolean isVisible(State state) {
             if (state instanceof State.Connecting) {
                 return ((State.Connecting) state).getLane().equals(getModel());
             }
-            
+
             return !getRoad().getModel().isPrimary() && getModel().getOutgoingJunction().isPrimary();
         }
-        
+
         @Override
         public boolean contains(Point2D p, State state) {
             return isVisible(state) && (circle.contains(p) || LaneGui.this.contains(p));
         }
-        
+
         @Override
         public Type getType() {
             return Type.OUTGOING_CONNECTOR;
         }
-        
+
         @Override
         public State activate(State old) {
             return new State.OutgoingActive(LaneGui.this);
         }
-        
+
         @Override
         boolean beginDrag(double x, double y) {
             return circle.contains(x, y);
         }
-        
+
         @Override
         State.Connecting drag(double x, double y, InteractiveElement target, State old) {
             dragLocation = new Point2D.Double(x, y);
             dropTarget = null;
-            
+
             if (!(old instanceof State.Connecting)) {
                 return new State.Connecting(getModel());
             }
-            
+
             final State.Connecting s = (State.Connecting) old;
             if (target != null && target.getType() == Type.INCOMING_CONNECTOR) {
                 dropTarget = (IncomingConnector) target;
-                
+
                 return (s.getViaConnectors().size() & 1) == 0 ? s : s.pop();
             } else if (target != null && target.getType() == Type.VIA_CONNECTOR) {
                 return s.next((RoadGui.ViaConnector) target);
             }
-            
+
             return s;
         }
-        
+
         @Override
         State drop(double x, double y, InteractiveElement target, State old) {
@@ -240,5 +241,5 @@
                 return activate(old);
             }
-            
+
             final List<Road> via = new ArrayList<>();
             assert (s.getViaConnectors().size() & 1) == 0;
@@ -249,21 +250,21 @@
                 via.add(a.getRoadEnd().getRoad());
             }
-            
+
             getModel().addTurn(via, dropTarget.getRoadEnd());
             dropTarget = null;
             return new State.Dirty(activate(old));
         }
-        
+
         public Point2D getCenter() {
             return (Point2D) center.clone();
         }
-        
+
         void move(double x, double y) {
             final double r = getRoad().connectorRadius;
-            
+
             center.setLocation(x, y);
             circle.setFrame(x - r, y - r, 2 * r, 2 * r);
         }
-        
+
         @Override
         int getZIndex() {
@@ -271,19 +272,19 @@
         }
     }
-    
+
     static final NumberFormat METER_FORMAT = new DecimalFormat("0.0m");
-    
+
     private final RoadGui road;
     private final Lane lane;
-    
+
     final Path2D area = new Path2D.Double();
-    
+
     final OutgoingConnector outgoing = new OutgoingConnector();
     final LengthSlider lengthSlider;
-    
+
     private Shape clip;
     private double length;
-    
-    public LaneGui(RoadGui road, Lane lane) {
+
+    LaneGui(RoadGui road, Lane lane) {
         this.road = road;
         this.lane = lane;
@@ -291,29 +292,29 @@
         this.length = lane.isExtra() ? lane.getLength() / road.getContainer().getMpp() : Double.NaN;
     }
-    
+
     public double getLength() {
         return lane.isExtra() ? length : road.getLength();
     }
-    
+
     public Lane getModel() {
         return lane;
     }
-    
+
     public RoadGui getRoad() {
         return road;
     }
-    
+
     public GuiContainer getContainer() {
         return getRoad().getContainer();
     }
-    
+
     public Path recalculate(Path inner, Path2D innerLine) {
         area.reset();
-        
+
         final double W = getContainer().getLaneWidth();
         final double L = getLength();
-        
+
         final double WW = 3 / getContainer().getMpp();
-        
+
         final LaneGui left = left();
         final Lane leftModel = left == null ? null : left.getModel();
@@ -321,15 +322,15 @@
                 || !leftModel.getOutgoingRoadEnd().equals(getModel().getOutgoingRoadEnd()) ? Double.NEGATIVE_INFINITY
                 : leftModel.getKind() == Lane.Kind.EXTRA_LEFT ? left.getLength() : L;
-        
+
         final Path outer;
         if (getModel().getKind() == Lane.Kind.EXTRA_LEFT) {
             final double AL = 30 / getContainer().getMpp();
             final double SL = max(L, leftLength + AL);
-            
+
             outer = inner.offset(W, SL, SL + AL, 0);
             area(area, inner.subpath(0, L, true), outer.subpath(0, L + WW, true));
-            
+
             lengthSlider.move(inner.getPoint(L, true));
-            
+
             if (L > leftLength) {
                 innerLine.append(inner.subpath(leftLength + WW, L, true).getIterator(), leftLength >= 0
@@ -341,10 +342,10 @@
             outer = inner.offset(W, L, L + WW, 0);
             area(area, inner.subpath(0, L + WW, true), outer.subpath(0, L, true));
-            
+
             lengthSlider.move(outer.getPoint(L, true));
         } else {
             outer = inner.offset(W, -1, -1, W);
             area(area, inner, outer);
-            
+
             if (leftLength < L) {
                 innerLine.append(inner.subpath(leftLength + WW, L, true).getIterator(), leftLength >= 0
@@ -352,8 +353,8 @@
             }
         }
-        
+
         return outer;
     }
-    
+
     private LaneGui left() {
         final List<LaneGui> lanes = getRoad().getLanes(getModel().getOutgoingRoadEnd());
@@ -361,5 +362,5 @@
         return i > 0 ? lanes.get(i - 1) : null;
     }
-    
+
     public void fill(Graphics2D g2d) {
         final Shape old = g2d.getClip();
@@ -368,9 +369,9 @@
         g2d.setClip(old);
     }
-    
+
     public void setClip(Shape clip) {
         this.clip = clip;
     }
-    
+
     public boolean contains(Point2D p) {
         return area.contains(p) && clip.contains(p);
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/Path.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/Path.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/Path.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -22,5 +23,5 @@
  * A path that allows constructing offset curves/parallel curves with a somewhat crude straight
  * skeleton implementation.
- * 
+ *
  * @author Ben Schulz
  */
@@ -28,30 +29,30 @@
     private static final class SimplePathIterator implements PathIterator {
         private final SimplePathIterator previous;
-        
+
         private final int type;
         private final double[] coords;
-        
+
         private boolean done = false;
-        
-        public SimplePathIterator(SimplePathIterator previous, int type, double... coords) {
+
+        SimplePathIterator(SimplePathIterator previous, int type, double... coords) {
             this.previous = previous;
             this.type = type;
             this.coords = coords;
         }
-        
-        public SimplePathIterator(int type, double... coords) {
+
+        SimplePathIterator(int type, double... coords) {
             this(null, type, coords);
         }
-        
+
         @Override
         public int getWindingRule() {
             return WIND_NON_ZERO;
         }
-        
+
         @Override
         public boolean isDone() {
             return done;
         }
-        
+
         @Override
         public void next() {
@@ -62,5 +63,5 @@
             }
         }
-        
+
         @Override
         public int currentSegment(float[] coords) {
@@ -70,12 +71,12 @@
                 throw new NoSuchElementException("Iterator is already done.");
             }
-            
+
             for (int i = 0; i < 6; ++i) {
                 coords[i] = (float) this.coords[i];
             }
-            
+
             return type;
         }
-        
+
         @Override
         public int currentSegment(double[] coords) {
@@ -85,75 +86,75 @@
                 throw new NoSuchElementException("Iterator is already done.");
             }
-            
+
             for (int i = 0; i < 6; ++i) {
                 coords[i] = this.coords[i];
             }
-            
+
             return type;
         }
-        
-    }
-    
+
+    }
+
     private static final class Line extends Path {
         private final Path previous;
-        
+
         private final double endX;
         private final double endY;
-        
+
         private final double angle;
-        
+
         private final double length;
-        
-        public Line(Path previous, double x, double y, double length) {
+
+        Line(Path previous, double x, double y, double length) {
             this.previous = previous;
-            
+
             this.endX = x;
             this.endY = y;
-            
+
             this.angle = angle(previous.getEnd(), getEnd());
-            
+
             this.length = length;
         }
-        
+
         @Override
         public Point2D getStart() {
             return previous.getStart();
         }
-        
+
         @Override
         public Point2D getEnd() {
             return new Point2D.Double(endX, endY);
         }
-        
+
         @Override
         public double getEndAngle() {
             return angle;
         }
-        
+
         @Override
         public double getLength() {
             return previous.getLength() + length;
         }
-        
+
         @Override
         public Path offset(double ws, double m1, double m2, double we) {
             return offsetInternal(ws, m1, m2, we, angle);
         }
-        
+
         @Override
         Path offsetInternal(double ws, double m1, double m2, double we, double endAngle) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             final Path prev = previous.offsetInternal(ws, m1, m2, we, angle);
-            
+
             final double wStart = PL <= m1 ? ws : m2 <= PL ? we : ws + (PL - m1) * (we - ws) / (m2 - m1);
             final Point2D from = prev.getEnd();
             final Point2D to = offsetEnd(wStart, endAngle);
-            
+
             if (abs(minAngleDiff(angle, angle(from, to))) > PI / 100) {
                 return previous.offsetInternal(ws, m1, m2, we, endAngle);
             }
-            
+
             if (ML <= m1) {
                 return simpleOffset(prev, ws, endAngle);
@@ -161,30 +162,30 @@
                 return simpleOffset(prev, we, endAngle);
             }
-            
+
             final double LL = from.distance(to);
-            
+
             final Point2D m1o = PL <= m1 ? relativePoint(prev.getEnd(), LL * (m1 - PL) / length, angle) : null;
             final Point2D m2t = m2 <= ML ? relativePoint(getEnd(), LL * (ML - m2) / length, angle + PI) : null;
             final Point2D m2o = m2t == null ? null : relativePoint(m2t, we, (angle + endAngle - PI) / 2);
-            
+
             if (m1o != null && m2o != null) {
                 final Line l1 = new Line(prev, m1o.getX(), m1o.getY(), m1 - PL);
                 final Line l2 = new Line(l1, m2o.getX(), m2o.getY(), m2 - m1);
-                
+
                 final Point2D end = offsetEnd(we, endAngle);
-                
+
                 return new Line(l2, end.getX(), end.getY(), ML - m2);
             } else if (m1o != null) {
                 final Line l1 = new Line(prev, m1o.getX(), m1o.getY(), m1 - PL);
-                
+
                 final double w = ws + (ML - m1) * (we - ws) / (m2 - m1);
                 final Point2D end = offsetEnd(w, endAngle);
-                
+
                 return new Line(l1, end.getX(), end.getY(), ML - m1);
             } else if (m2o != null) {
                 final Line l2 = new Line(prev, m2o.getX(), m2o.getY(), m2 - PL);
-                
+
                 final Point2D end = offsetEnd(we, endAngle);
-                
+
                 return new Line(l2, end.getX(), end.getY(), ML - m2);
             } else {
@@ -194,17 +195,17 @@
             }
         }
-        
+
         private Path simpleOffset(Path prev, double w, double endAngle) {
             final Point2D offset = offsetEnd(w, endAngle);
             return new Line(prev, offset.getX(), offset.getY(), length);
         }
-        
+
         private Point2D offsetEnd(double w, double endAngle) {
             final double da2 = minAngleDiff(angle, endAngle) / 2;
             final double hypotenuse = w / cos(da2);
-            
+
             return relativePoint(getEnd(), hypotenuse, angle + PI / 2 + da2);
         }
-        
+
         @Override
         public SimplePathIterator getIterator() {
@@ -212,10 +213,10 @@
                     0, 0, 0);
         }
-        
+
         @Override
         public Path subpath(double from, double to) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             if (from > ML) {
                 throw new IllegalArgumentException("from > length");
@@ -223,11 +224,11 @@
                 throw new IllegalArgumentException("to > length");
             }
-            
+
             if (to < PL) {
                 return previous.subpath(from, to);
             }
-            
+
             final Point2D end = to < ML ? getPoint(to) : new Point2D.Double(endX, endY);
-            
+
             final double EL = min(ML, to);
             if (PL <= from) {
@@ -238,14 +239,14 @@
             }
         }
-        
+
         @Override
         public Point2D getPoint(double offset) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             if (offset > ML) {
                 throw new IllegalArgumentException("offset > length");
             }
-            
+
             if (offset <= ML && offset >= PL) {
                 final double LL = previous.getEnd().distance(getEnd());
@@ -255,5 +256,5 @@
             }
         }
-        
+
         @Override
         SimplePathIterator getIteratorInternal(double endAngle) {
@@ -261,25 +262,25 @@
         }
     }
-    
+
     // TODO curves are still somewhat broken
     private static class Curve extends Path {
         private final Path previous;
-        
+
         private final double height;
-        
+
         private final double centerX;
         private final double centerY;
         private final double centerToFromAngle;
-        
+
         private final double endX;
         private final double endY;
-        
+
         private final double fromAngle;
         private final double fromRadius;
         private final double toRadius;
         private final double angle;
-        
+
         private final double length;
-        
+
         private Curve(Path previous, double r1, double r2, double a, double length, double fromAngle) {
             this.previous = previous;
@@ -289,55 +290,56 @@
             this.angle = a;
             this.length = length;
-            
+
             final Point2D from = previous.getEnd();
             this.centerToFromAngle = fromAngle - signum(a) * PI / 2;
             final Point2D center = relativePoint(from, r1, centerToFromAngle + PI);
-            
+
             final double toAngle = centerToFromAngle + a;
             this.endX = center.getX() + r2 * cos(toAngle);
             this.endY = center.getY() - r2 * sin(toAngle);
-            
+
             this.centerX = center.getX();
             this.centerY = center.getY();
-            
+
             final double y = new Line2D.Double(center, from).ptLineDist(endX, endY);
             this.height = y / sin(angle);
         }
-        
-        public Curve(Path previous, double r1, double r2, double a, double length) {
+
+        Curve(Path previous, double r1, double r2, double a, double length) {
             this(previous, r1, r2, a, length, previous.getEndAngle());
         }
-        
+
+        @Override
         public Point2D getStart() {
             return previous.getStart();
         }
-        
+
         @Override
         public Point2D getEnd() {
             return new Point2D.Double(endX, endY);
         }
-        
+
         @Override
         public double getEndAngle() {
             return fromAngle + angle;
         }
-        
+
         @Override
         public double getLength() {
             return previous.getLength() + length;
         }
-        
+
         @Override
         public Path offset(double ws, double m1, double m2, double we) {
             return offsetInternal(ws, m1, m2, we, previous.getEndAngle() + angle);
         }
-        
+
         @Override
         Path offsetInternal(double ws, double m1, double m2, double we, double endAngle) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             final Path prev = previous.offsetInternal(ws, m1, m2, we, fromAngle);
-            
+
             if (ML <= m1) {
                 return simpleOffset(prev, ws);
@@ -345,20 +347,20 @@
                 return simpleOffset(prev, we);
             }
-            
+
             final double s = signum(angle);
-            
+
             if (PL < m1 && m2 < ML) {
                 final double l1 = m1 - PL;
                 final double a1 = angle(l1);
                 final double r1 = radius(a1) - s * ws;
-                
+
                 final Curve c1 = new Curve(prev, fromRadius - ws, r1, offsetAngle(prev, a1), l1, fromAngle);
-                
+
                 final double l2 = m2 - m1;
                 final double a2 = angle(l2);
                 final double r2 = radius(a2) - s * we;
-                
+
                 final Curve c2 = new Curve(c1, r1, r2, a2 - a1, l2);
-                
+
                 return new Curve(c2, r2, toRadius - s * we, angle - a2, ML - m2);
             } else if (PL < m1) {
@@ -366,57 +368,57 @@
                 final double a1 = angle(l1);
                 final double r1 = radius(a1) - s * ws;
-                
+
                 final Curve c1 = new Curve(prev, fromRadius - s * ws, r1, offsetAngle(prev, a1), l1, fromAngle);
-                
+
                 final double w = ws + (ML - m1) * (we - ws) / (m2 - m1);
-                
+
                 return new Curve(c1, r1, toRadius - s * w, angle - a1, ML - m1);
             } else if (m2 < ML) {
                 final double w = ws + (PL - m1) * (we - ws) / (m2 - m1);
-                
+
                 final double l2 = m2 - PL;
                 final double a2 = angle(l2);
                 final double r2 = radius(a2) - s * we;
-                
+
                 final Curve c2 = new Curve(prev, fromRadius - s * w, r2, offsetAngle(prev, a2), l2, fromAngle);
-                
+
                 return new Curve(c2, r2, toRadius - s * we, angle - a2, ML - m2);
             } else {
                 final double w1 = ws + (PL - m1) * (we - ws) / (m2 - m1);
                 final double w2 = we - (m2 - ML) * (we - ws) / (m2 - m1);
-                
+
                 return new Curve(prev, fromRadius - s * w1, toRadius - s * w2, offsetAngle(prev, angle), length,
                         fromAngle);
             }
         }
-        
+
         private double angle(double l) {
             return l * angle / length;
         }
-        
+
         private double radius(double a) {
             return hypot(fromRadius * cos(a), height * sin(a));
         }
-        
+
         private double offsetAngle(Path prev, double a) {
-            return a;// + GuiUtil.normalize(previous.getEndAngle()
+            return a; // + GuiUtil.normalize(previous.getEndAngle()
             // - prev.getEndAngle());
         }
-        
+
         private Path simpleOffset(Path prev, double w) {
             final double s = signum(angle);
             return new Curve(prev, fromRadius - s * w, toRadius - s * w, offsetAngle(prev, angle), length, fromAngle);
         }
-        
+
         @Override
         public SimplePathIterator getIterator() {
             return getIteratorInternal(previous.getEndAngle() + angle);
         }
-        
+
         @Override
         public Path subpath(double from, double to) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             if (from > ML) {
                 throw new IllegalArgumentException("from > length");
@@ -424,22 +426,22 @@
                 throw new IllegalArgumentException("to > length");
             }
-            
+
             if (to < PL) {
                 return previous.subpath(from, to);
             }
-            
+
             final double toA = to < ML ? angle(to - PL) : angle;
             final double toR = to < ML ? radius(toA) : toRadius;
-            
+
             final double fromA = from > PL ? angle(from - PL) : 0;
             final double fromR = from > PL ? radius(fromA) : fromRadius;
-            
+
             final double a = toA - fromA;
             final double l = min(ML, to) - max(PL, from);
-            
+
             if (from >= PL) {
                 final Point2D start = getPoint(from);
                 final double fa = fromAngle + fromA;
-                
+
                 return new Curve(new Start(start.getX(), start.getY(), fa), fromR, toR, a, l, fa);
             } else {
@@ -447,19 +449,19 @@
             }
         }
-        
+
         @Override
         public Point2D getPoint(double offset) {
             final double PL = previous.getLength();
             final double ML = PL + length;
-            
+
             if (offset <= ML && offset >= PL) {
                 final double a = abs(angle(offset - PL));
                 final double w = fromRadius * cos(a);
                 final double h = -height * sin(a);
-                
+
                 final double r = centerToFromAngle; // rotation angle
                 final double x = w * cos(r) + h * sin(r);
                 final double y = -w * sin(r) + h * cos(r);
-                
+
                 return new Point2D.Double(centerX + x, centerY + y);
             } else {
@@ -467,41 +469,43 @@
             }
         }
-        
+
         @Override
         SimplePathIterator getIteratorInternal(double endAngle) {
             final Point2D cp1 = relativePoint(previous.getEnd(), cpf(angle, fromRadius), previous.getEndAngle());
             final Point2D cp2 = relativePoint(getEnd(), cpf(angle, toRadius), endAngle + PI);
-            
+
             return new SimplePathIterator(previous.getIteratorInternal(getEndAngle()), PathIterator.SEG_CUBICTO, //
                     cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), endX, endY //
             );
-            
-        }
-    }
-    
+
+        }
+    }
+
     private static class Start extends Path {
         private final double x;
         private final double y;
-        
+
         private final double endAngle;
-        
-        public Start(double x, double y, double endAngle) {
+
+        Start(double x, double y, double endAngle) {
             this.x = x;
             this.y = y;
             this.endAngle = endAngle;
         }
-        
-        public Start(double x, double y) {
+
+        Start(double x, double y) {
             this(x, y, Double.NaN);
         }
-        
+
+        @Override
         public Point2D getStart() {
             return new Point2D.Double(x, y);
         }
-        
+
+        @Override
         public Point2D getEnd() {
             return new Point2D.Double(x, y);
         }
-        
+
         @Override
         public double getEndAngle() {
@@ -509,18 +513,18 @@
                 throw new UnsupportedOperationException();
             }
-            
+
             return endAngle;
         }
-        
+
         @Override
         public double getLength() {
             return 0;
         }
-        
+
         @Override
         public Path offset(double ws, double m1, double m2, double we) {
             throw new UnsupportedOperationException();
         }
-        
+
         @Override
         Path offsetInternal(double ws, double m1, double m2, double we, double endAngle) {
@@ -528,10 +532,10 @@
             return new Start(offset.getX(), offset.getY(), endAngle);
         }
-        
+
         @Override
         public SimplePathIterator getIterator() {
             return new SimplePathIterator(PathIterator.SEG_MOVETO, x, y, 0, 0, 0, 0);
         }
-        
+
         @Override
         public Path subpath(double from, double to) {
@@ -542,8 +546,8 @@
                 throw new IllegalArgumentException("from < 0");
             }
-            
+
             return this;
         }
-        
+
         @Override
         public Point2D getPoint(double offset) {
@@ -554,5 +558,5 @@
             }
         }
-        
+
         @Override
         SimplePathIterator getIteratorInternal(double endAngle) {
@@ -560,35 +564,35 @@
         }
     }
-    
+
     public static Path create(double x, double y) {
         return new Start(x, y);
     }
-    
+
     public Path lineTo(double x, double y, double length) {
         return new Line(this, x, y, length);
     }
-    
+
     public Path curveTo(double r1, double r2, double a, double length) {
         return new Curve(this, r1, r2, a, length);
     }
-    
+
     public abstract Path offset(double ws, double m1, double m2, double we);
-    
+
     abstract Path offsetInternal(double ws, double m1, double m2, double we, double endAngle);
-    
+
     public abstract double getLength();
-    
+
     public abstract double getEndAngle();
-    
+
     public abstract Point2D getStart();
-    
+
     public abstract Point2D getEnd();
-    
+
     public abstract SimplePathIterator getIterator();
-    
+
     abstract SimplePathIterator getIteratorInternal(double endAngle);
-    
+
     public abstract Path subpath(double from, double to);
-    
+
     public Path subpath(double from, double to, boolean fixArgs) {
         if (fixArgs) {
@@ -596,15 +600,15 @@
             to = min(max(to, 0), getLength());
         }
-        
+
         return subpath(from, to);
     }
-    
+
     public abstract Point2D getPoint(double offset);
-    
+
     public Point2D getPoint(double offset, boolean fixArgs) {
         if (fixArgs) {
             offset = min(max(offset, 0), getLength());
         }
-        
+
         return getPoint(offset);
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ReversePathIterator.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ReversePathIterator.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ReversePathIterator.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -6,5 +7,5 @@
 /**
  * Path iterator which reverses the path of a given iterator.
- * 
+ *
  * <p>
  * The given (unreversed) iterator must start with a {@code PathIterator.SEG_MOVETO} and must not
@@ -12,8 +13,8 @@
  * returned by {@code Path.getIterator} which has exactly those properties.
  * </p>
- * 
+ *
  * @author Ben Schulz
  */
-class ReversePathIterator implements PathIterator {
+final class ReversePathIterator implements PathIterator {
     private static final int[] COUNTS = {
         2, // SEG_MOVETO = 0
@@ -23,9 +24,9 @@
         0, // SEG_CLOSE = 4
     };
-    
+
     public static ReversePathIterator reverse(PathIterator it) {
         return new ReversePathIterator(it);
     }
-    
+
     private static int[] reverseTypes(int[] types, int length) {
         if (length > 0 && types[0] != SEG_MOVETO) {
@@ -33,29 +34,29 @@
             throw new IllegalArgumentException("Can not reverse path without initial SEG_MOVETO.");
         }
-        
+
         final int[] result = new int[length];
-        
+
         result[0] = SEG_MOVETO;
-        
+
         int lower = 1;
         int upper = length - 1;
-        
+
         while (lower <= upper) {
             result[lower] = types[upper];
             result[upper] = types[lower];
-            
+
             ++lower;
             --upper;
         }
-        
+
         return result;
     }
-    
+
     private static double[] reverseCoords(double[] coords, int length) {
         final double[] result = new double[length];
-        
+
         int lower = 0;
         int upper = length - 2;
-        
+
         while (lower <= upper) {
             result[lower] = coords[upper];
@@ -63,39 +64,39 @@
             result[upper] = coords[lower];
             result[upper + 1] = coords[lower + 1];
-            
+
             lower += 2;
             upper -= 2;
         }
-        
+
         return result;
     }
-    
+
     private final int winding;
-    
+
     private final int[] types;
     private int typesIndex = 0;
-    
+
     private final double[] coords;
     private int coordsIndex = 0;
-    
+
     private ReversePathIterator(PathIterator it) {
         this.winding = it.getWindingRule();
-        
+
         double[] tmpCoords = new double[62];
         int[] tmpTypes = new int[11];
-        
+
         int tmpCoordsI = 0;
         int tmpTypesI = 0;
-        
+
         while (!it.isDone()) {
             if (tmpTypesI >= tmpTypes.length) {
                 tmpTypes = Arrays.copyOf(tmpTypes, 2 * tmpTypes.length);
             }
-            
+
             final double[] cs = new double[6];
             final int t = it.currentSegment(cs);
             tmpTypes[tmpTypesI++] = t;
             final int count = COUNTS[t];
-            
+
             if (tmpCoordsI + count > tmpCoords.length) {
                 tmpCoords = Arrays.copyOf(tmpCoords, 2 * tmpCoords.length);
@@ -103,22 +104,22 @@
             System.arraycopy(cs, 0, tmpCoords, tmpCoordsI, count);
             tmpCoordsI += count;
-            
+
             it.next();
         }
-        
+
         this.types = reverseTypes(tmpTypes, tmpTypesI);
         this.coords = reverseCoords(tmpCoords, tmpCoordsI);
     }
-    
+
     @Override
     public int getWindingRule() {
         return winding;
     }
-    
+
     @Override
     public boolean isDone() {
         return typesIndex >= types.length;
     }
-    
+
     @Override
     public void next() {
@@ -126,10 +127,10 @@
         ++typesIndex;
     }
-    
+
     @Override
     public int currentSegment(float[] coords) {
         final double[] tmp = new double[6];
         final int type = currentSegment(tmp);
-        
+
         coords[0] = (float) tmp[0];
         coords[1] = (float) tmp[1];
@@ -138,8 +139,8 @@
         coords[4] = (float) tmp[4];
         coords[5] = (float) tmp[5];
-        
+
         return type;
     }
-    
+
     @Override
     public int currentSegment(double[] coords) {
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/RoadGui.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/RoadGui.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/RoadGui.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -43,14 +44,14 @@
     final class ViaConnector extends InteractiveElement {
         private final Road.End end;
-        
+
         private final Line2D line;
         private final float strokeWidth;
-        
-        public ViaConnector(Road.End end) {
+
+        ViaConnector(Road.End end) {
             this.end = end;
             this.line = new Line2D.Double(getLeftCorner(end), getRightCorner(end));
             this.strokeWidth = (float) (3 * getContainer().getLaneWidth() / 4);
         }
-        
+
         @Override
         void paint(Graphics2D g2d, State state) {
@@ -61,5 +62,5 @@
             }
         }
-        
+
         @Override
         boolean contains(Point2D p, State state) {
@@ -67,16 +68,16 @@
                 return false;
             }
-            
+
             final Point2D closest = closest(line, p);
             return p.distance(closest) <= strokeWidth / 2;
         }
-        
+
         private boolean isVisible(State state) {
             if (!(state instanceof State.Connecting)) {
                 return false;
             }
-            
+
             final State.Connecting s = (State.Connecting) state;
-            
+
             if (s.getJunction().equals(end.getJunction()) || equals(s.getBacktrackViaConnector())) {
                 return true;
@@ -85,47 +86,47 @@
                 return true;
             }
-            
+
             return false;
         }
-        
+
         private Road getRoadModel() {
             return getModel();
         }
-        
+
         public RoadGui getRoad() {
             return RoadGui.this;
         }
-        
+
         @Override
         Type getType() {
             return Type.VIA_CONNECTOR;
         }
-        
+
         @Override
         int getZIndex() {
             return 1;
         }
-        
+
         public Road.End getRoadEnd() {
             return end;
         }
-        
+
         public Point2D getCenter() {
             return relativePoint(line.getP1(), line.getP1().distance(line.getP2()) / 2, angle(line.getP1(), line.getP2()));
         }
     }
-    
+
     private final class Extender extends InteractiveElement {
         private final Road.End end;
         private final Way way;
-        
+
         private final Line2D line;
-        
-        public Extender(Road.End end, Way way, double angle) {
+
+        Extender(Road.End end, Way way, double angle) {
             this.end = end;
             this.way = way;
             this.line = new Line2D.Double(a.getPoint(), relativePoint(a.getPoint(), getContainer().getLaneWidth() * 4, angle));
         }
-        
+
         @Override
         void paint(Graphics2D g2d, State state) {
@@ -134,14 +135,14 @@
             g2d.draw(line);
         }
-        
+
         @Override
         boolean contains(Point2D p, State state) {
             final BasicStroke stroke = (BasicStroke) getContainer().getConnectionStroke();
             final double strokeWidth = stroke.getLineWidth();
-            
+
             final Point2D closest = closest(line, p);
             return p.distance(closest) <= strokeWidth / 2;
         }
-        
+
         @Override
         State click(State old) {
@@ -149,10 +150,10 @@
             return new State.Invalid(old);
         }
-        
+
         @Override
         Type getType() {
             return Type.EXTENDER;
         }
-        
+
         @Override
         int getZIndex() {
@@ -160,20 +161,20 @@
         }
     }
-    
+
     private final class LaneAdder extends InteractiveElement {
         private final Road.End end;
         private final Lane.Kind kind;
-        
+
         private final Point2D center;
         private final Ellipse2D background;
-        
-        public LaneAdder(Road.End end, Lane.Kind kind) {
+
+        LaneAdder(Road.End end, Lane.Kind kind) {
             this.end = end;
             this.kind = kind;
-            
+
             final double a = getAngle(end) + PI;
             final Point2D lc = getLeftCorner(end);
             final Point2D rc = getRightCorner(end);
-            
+
             final double r = connectorRadius;
             final double cx;
@@ -182,5 +183,5 @@
                 final JunctionGui j = getContainer().getGui(end.getJunction());
                 final Point2D i = intersection(line(j.getPoint(), a), new Line2D.Double(lc, rc));
-                
+
                 cx = i.getX() + 21d / 16 * r * (2 * cos(a) + cos(a - PI / 2));
                 cy = i.getY() - 21d / 16 * r * (2 * sin(a) + sin(a - PI / 2));
@@ -189,9 +190,9 @@
                 cy = rc.getY() - 21d / 16 * r * (2 * sin(a) + sin(a + PI / 2));
             }
-            
+
             center = new Point2D.Double(cx, cy);
             background = new Ellipse2D.Double(cx - r, cy - r, 2 * r, 2 * r);
         }
-        
+
         @Override
         void paint(Graphics2D g2d, State state) {
@@ -199,12 +200,12 @@
                 return;
             }
-            
+
             g2d.setColor(Color.DARK_GRAY);
             g2d.fill(background);
-            
+
             final double l = 2 * connectorRadius / 3;
             final Line2D v = new Line2D.Double(center.getX(), center.getY() - l, center.getX(), center.getY() + l);
             final Line2D h = new Line2D.Double(center.getX() - l, center.getY(), center.getX() + l, center.getY());
-            
+
             g2d.setStroke(new BasicStroke((float) (connectorRadius / 5)));
             g2d.setColor(Color.WHITE);
@@ -212,24 +213,24 @@
             g2d.draw(h);
         }
-        
+
         private boolean isVisible(State state) {
             return end.getJunction().isPrimary();
         }
-        
+
         @Override
         boolean contains(Point2D p, State state) {
             return isVisible(state) && background.contains(p);
         }
-        
+
         @Override
         Type getType() {
             return Type.LANE_ADDER;
         }
-        
+
         @Override
         int getZIndex() {
             return 2;
         }
-        
+
         @Override
         public State click(State old) {
@@ -238,15 +239,15 @@
         }
     }
-    
+
     final class IncomingConnector extends InteractiveElement {
         private final Road.End end;
         private final List<LaneGui> lanes;
-        
+
         private final Point2D center = new Point2D.Double();
         private final Ellipse2D circle = new Ellipse2D.Double();
-        
+
         private IncomingConnector(Road.End end) {
             this.end = end;
-            
+
             final List<LaneGui> lanes = new ArrayList<>(end.getLanes().size());
             for (Lane l : end.getOppositeEnd().getLanes()) {
@@ -255,5 +256,5 @@
             this.lanes = Collections.unmodifiableList(lanes);
         }
-        
+
         @Override
         public void paintBackground(Graphics2D g2d, State state) {
@@ -261,15 +262,15 @@
                 final Composite old = g2d.getComposite();
                 g2d.setComposite(((AlphaComposite) old).derive(0.2f));
-                
+
                 g2d.setColor(new Color(255, 127, 31));
-                
+
                 for (LaneGui l : lanes) {
                     l.fill(g2d);
                 }
-                
+
                 g2d.setComposite(old);
             }
         }
-        
+
         @Override
         public void paint(Graphics2D g2d, State state) {
@@ -279,22 +280,22 @@
                     g2d.setComposite(((AlphaComposite) old).derive(1f));
                 }
-                
+
                 g2d.setColor(Color.LIGHT_GRAY);
                 g2d.fill(circle);
-                
+
                 g2d.setComposite(old);
             }
         }
-        
+
         private boolean isActive(State state) {
             if (!(state instanceof State.IncomingActive)) {
                 return false;
             }
-            
+
             final Road.End roadEnd = ((State.IncomingActive) state).getRoadEnd();
-            
+
             return roadEnd.equals(getRoadEnd());
         }
-        
+
         private boolean isVisible(State state) {
             if (getModel().isPrimary() || !getRoadEnd().getJunction().isPrimary()
@@ -302,12 +303,12 @@
                 return false;
             }
-            
+
             if (state instanceof State.Connecting) {
                 return ((State.Connecting) state).getJunction().equals(getRoadEnd().getJunction());
             }
-            
+
             return true;
         }
-        
+
         @Override
         public boolean contains(Point2D p, State state) {
@@ -317,5 +318,5 @@
                 return true;
             }
-            
+
             for (LaneGui l : lanes) {
                 if (l.contains(p)) {
@@ -323,62 +324,62 @@
                 }
             }
-            
+
             return false;
         }
-        
+
         @Override
         public Type getType() {
             return Type.INCOMING_CONNECTOR;
         }
-        
+
         @Override
         public State activate(State old) {
             return new State.IncomingActive(getRoadEnd());
         }
-        
+
         public Point2D getCenter() {
             return (Point2D) center.clone();
         }
-        
+
         void move(double x, double y) {
             final double r = connectorRadius;
-            
+
             center.setLocation(x, y);
             circle.setFrame(x - r, y - r, 2 * r, 2 * r);
         }
-        
+
         public Road.End getRoadEnd() {
             return end;
         }
-        
+
         public List<LaneGui> getLanes() {
             return lanes;
         }
-        
+
         @Override
         int getZIndex() {
             return 1;
         }
-        
+
         public void add(LaneGui lane) {
             lanes.add(lane);
         }
     }
-    
+
     // TODO rework to be a SegmentGui (with getModel())
     private final class Segment {
         final Point2D to;
         final Point2D from;
-        
+
         final Segment prev;
         final Segment next;
-        
+
         final double length;
         final double angle;
-        
-        public Segment(Segment next, List<Point2D> bends, JunctionGui a) {
+
+        Segment(Segment next, List<Point2D> bends, JunctionGui a) {
             final Point2D head = (Point2D) bends.get(0).clone();
             final List<Point2D> tail = bends.subList(1, bends.size());
-            
+
             this.next = next;
             this.to = head;
@@ -387,40 +388,40 @@
             this.length = from.distance(to);
             this.angle = angle(from, to);
-            
+
             // TODO create a factory method for the segments list and pass it to
             // the constructor(s)
             segments.add(this);
         }
-        
-        public Segment(JunctionGui b, List<Point2D> bends, JunctionGui a) {
+
+        Segment(JunctionGui b, List<Point2D> bends, JunctionGui a) {
             this((Segment) null, prepended(bends, (Point2D) b.getPoint().clone()), a);
         }
-        
+
         private double getFromOffset() {
             return prev == null ? 0 : prev.getFromOffset() + prev.length;
         }
-        
+
         public double getOffset(double x, double y) {
             return getOffsetInternal(new Point2D.Double(x, y), -1, Double.POSITIVE_INFINITY);
         }
-        
+
         private double getOffsetInternal(Point2D p, double offset, double quality) {
             final Point2D closest = closest(new Line2D.Double(from, to), p);
             final double myQuality = closest.distance(p);
-            
+
             if (myQuality < quality) {
                 quality = myQuality;
-                
+
                 final Line2D normal = line(p, angle + PI / 2);
                 final Point2D isect = intersection(normal, new Line2D.Double(from, to));
                 final double d = from.distance(isect);
                 final boolean negative = Math.abs(angle(from, isect) - angle) > 1;
-                
+
                 offset = getFromOffset() + (negative ? -1 : 1) * d;
             }
-            
+
             return next == null ? offset : next.getOffsetInternal(p, offset, quality);
         }
-        
+
         public Path append(Path path, boolean forward, double offset) {
             if (ROUND_CORNERS) {
@@ -428,21 +429,21 @@
                 final Point2D s = forward ? to : from;
                 final Point2D e = forward ? from : to;
-                
+
                 if (n == null) {
                     return path.lineTo(e.getX(), e.getY(), length - offset);
                 }
-                
+
                 final double a = minAngleDiff(angle, n.angle);
                 final double d = 3 * outerMargin + getWidth(getModel().getToEnd(), (forward && a < 0) || (!forward && a > 0));
                 final double l = d * tan(abs(a));
-                
+
                 if (length - offset < l / 2 || n.length < l / 2) {
                     return n.append(path.lineTo(e.getX(), e.getY(), length - offset), forward, 0);
                 } else {
                     final Point2D p = relativePoint(e, l / 2, angle(e, s));
-                    
+
                     final Path line = path.lineTo(p.getX(), p.getY(), length - l / 2 - offset);
                     final Path curve = line.curveTo(d, d, a, l);
-                    
+
                     return n.append(curve, forward, l / 2);
                 }
@@ -456,5 +457,5 @@
         }
     }
-    
+
     /**
      * This should become a setting, but rounding is (as of yet) still slightly buggy and a low
@@ -462,6 +463,6 @@
      */
     private static final boolean ROUND_CORNERS = false;
-    
-    private static final List<Point2D> prepended(List<Point2D> bends, Point2D point) {
+
+    private static List<Point2D> prepended(List<Point2D> bends, Point2D point) {
         final List<Point2D> result = new ArrayList<>(bends.size() + 1);
         result.add(point);
@@ -469,36 +470,36 @@
         return result;
     }
-    
+
     private final GuiContainer container;
     private final double innerMargin;
     private final double outerMargin;
-    
+
     private final float lineWidth;
     private final Stroke regularStroke;
     private final Stroke dashedStroke;
-    
+
     private final JunctionGui a;
     private final JunctionGui b;
     private final double length;
-    
+
     private final IncomingConnector incomingA;
     private final IncomingConnector incomingB;
-    
+
     private final Road road;
     private final List<Segment> segments = new ArrayList<>();
-    
+
     final double connectorRadius;
-    
-    public RoadGui(GuiContainer container, Road road) {
+
+    RoadGui(GuiContainer container, Road road) {
         this.container = container;
-        
+
         this.road = road;
-        
+
         this.a = container.getGui(road.getFromEnd().getJunction());
         this.b = container.getGui(road.getToEnd().getJunction());
-        
+
         this.incomingA = new IncomingConnector(road.getFromEnd());
         this.incomingB = new IncomingConnector(road.getToEnd());
-        
+
         final List<Point2D> bends = new ArrayList<>();
         final List<Node> nodes = road.getRoute().getNodes();
@@ -506,5 +507,5 @@
             bends.add(container.translateAndScale(loc(nodes.get(i))));
         }
-        
+
         // they add themselves to this.segments
         new Segment(b, bends, a);
@@ -514,5 +515,5 @@
         }
         this.length = l;
-        
+
         this.innerMargin = !incomingA.getLanes().isEmpty() && !incomingB.getLanes().isEmpty() ? 1 * container
             .getLaneWidth() / 15 : 0;
@@ -525,29 +526,29 @@
         }, 0);
     }
-    
+
     public JunctionGui getA() {
         return a;
     }
-    
+
     public JunctionGui getB() {
         return b;
     }
-    
+
     public Line2D getLeftCurb(Road.End end) {
         return GuiUtil.line(getCorner(end, true), getAngle(end) + PI);
     }
-    
+
     public Line2D getRightCurb(Road.End end) {
         return GuiUtil.line(getCorner(end, false), getAngle(end) + PI);
     }
-    
+
     private Point2D getLeftCorner(Road.End end) {
         return getCorner(end, true);
     }
-    
+
     private Point2D getRightCorner(Road.End end) {
         return getCorner(end, false);
     }
-    
+
     private Point2D getCorner(Road.End end, boolean left) {
         final JunctionGui j = end.isFromEnd() ? a : b;
@@ -556,22 +557,22 @@
         final double a = getAngle(end) + PI;
         final double t = left ? j.getLeftTrim(end) : j.getRightTrim(end);
-        
+
         final double dx = s * cos(PI / 2 - a) * w + cos(a) * t;
         final double dy = s * sin(PI / 2 - a) * w - sin(a) * t;
-        
+
         return new Point2D.Double(j.x + dx, j.y + dy);
     }
-    
+
     private double getWidth(Road.End end, boolean left) {
         if (!end.getRoad().equals(road)) {
             throw new IllegalArgumentException();
         }
-        
+
         final int lcForward = incomingA.getLanes().size();
         final int lcBackward = incomingB.getLanes().size();
-        
+
         final double LW = getContainer().getLaneWidth();
         final double M = innerMargin + outerMargin;
-        
+
         if (end.isToEnd()) {
             return (left ? lcBackward : lcForward) * LW + M;
@@ -580,10 +581,10 @@
         }
     }
-    
+
     List<InteractiveElement> paint(Graphics2D g2d) {
         final List<InteractiveElement> result = new ArrayList<>();
-        
+
         result.addAll(paintLanes(g2d));
-        
+
         if (getModel().isPrimary()) {
             result.add(new ViaConnector(getModel().getFromEnd()));
@@ -594,36 +595,36 @@
             result.addAll(extenders(getModel().getToEnd()));
         }
-        
+
         g2d.setColor(Color.RED);
         for (Segment s : segments) {
             g2d.fill(new Ellipse2D.Double(s.from.getX() - 1, s.from.getY() - 1, 2, 2));
         }
-        
+
         return result;
     }
-    
+
     private List<LaneAdder> laneAdders() {
         final List<LaneAdder> result = new ArrayList<>(4);
-        
+
         if (!incomingA.getLanes().isEmpty()) {
             result.add(new LaneAdder(getModel().getToEnd(), Lane.Kind.EXTRA_LEFT));
             result.add(new LaneAdder(getModel().getToEnd(), Lane.Kind.EXTRA_RIGHT));
         }
-        
+
         if (!incomingB.getLanes().isEmpty()) {
             result.add(new LaneAdder(getModel().getFromEnd(), Lane.Kind.EXTRA_LEFT));
             result.add(new LaneAdder(getModel().getFromEnd(), Lane.Kind.EXTRA_RIGHT));
         }
-        
+
         return result;
     }
-    
+
     private List<Extender> extenders(Road.End end) {
         if (!end.isExtendable()) {
             return Collections.emptyList();
         }
-        
+
         final List<Extender> result = new ArrayList<>();
-        
+
         final Node n = end.getJunction().getNode();
         for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
@@ -634,29 +635,29 @@
             }
         }
-        
+
         return result;
     }
-    
+
     public Road getModel() {
         return road;
     }
-    
+
     public IncomingConnector getConnector(Road.End end) {
         return end.isFromEnd() ? incomingA : incomingB;
     }
-    
+
     private List<InteractiveElement> paintLanes(Graphics2D g2d) {
         final Path2D middleLines = new Path2D.Double();
-        
+
         g2d.setStroke(regularStroke);
-        
+
         final boolean forward = !incomingA.getLanes().isEmpty();
         final boolean backward = !incomingB.getLanes().isEmpty();
-        
+
         final Path2D middleArea;
         if (forward && backward) {
             paintLanes(g2d, middleLines, true);
             paintLanes(g2d, middleLines, false);
-            
+
             middleLines.closePath();
             middleArea = middleLines;
@@ -664,5 +665,5 @@
         } else if (forward || backward) {
             paintLanes(g2d, middleLines, forward);
-            
+
             middleArea = new Path2D.Double();
             middleArea.append(middleLines.getPathIterator(null), false);
@@ -673,21 +674,21 @@
             throw new AssertionError();
         }
-        
+
         g2d.fill(middleArea);
         g2d.setColor(Color.WHITE);
         g2d.draw(middleLines);
-        
+
         final List<InteractiveElement> result = new ArrayList<>();
-        
+
         moveIncoming(getModel().getFromEnd());
         moveIncoming(getModel().getToEnd());
         result.add(incomingA);
         result.add(incomingB);
-        
+
         for (IncomingConnector c : Arrays.asList(incomingA, incomingB)) {
             int offset = 0;
             for (LaneGui l : c.getLanes()) {
                 moveOutgoing(l, offset++);
-                
+
                 result.add(l.outgoing);
                 if (l.getModel().isExtra()) {
@@ -696,18 +697,18 @@
             }
         }
-        
+
         return result;
     }
-    
+
     private void paintLanes(Graphics2D g2d, Path2D middleLines, boolean forward) {
         final Shape clip = clip();
         g2d.clip(clip);
-        
+
         final Path middle = middlePath(forward);
-        
+
         Path innerPath = middle.offset(innerMargin, -1, -1, innerMargin);
         final List<Path> linePaths = new ArrayList<>();
         linePaths.add(innerPath);
-        
+
         for (LaneGui l : forward ? incomingA.getLanes() : incomingB.getLanes()) {
             l.setClip(clip);
@@ -715,15 +716,15 @@
             linePaths.add(innerPath);
         }
-        
+
         final Path2D area = new Path2D.Double();
         area(area, middle, innerPath.offset(outerMargin, -1, -1, outerMargin));
         g2d.setColor(Color.GRAY);
         g2d.fill(area);
-        
+
         g2d.setColor(Color.WHITE);
         final Path2D lines = new Path2D.Double();
         lines.append(innerPath.getIterator(), false);
         g2d.draw(lines);
-        
+
         // g2d.setColor(new Color(32, 128, 192));
         g2d.setColor(Color.WHITE);
@@ -735,32 +736,32 @@
         }
         g2d.setStroke(regularStroke);
-        
+
         // g2d.setColor(new Color(32, 128, 192));
         // lines.reset();
         // lines.append(middle.getIterator(), false);
         // g2d.draw(lines);
-        
+
         g2d.setClip(null);
     }
-    
+
     private Shape clip() {
         final Area clip = new Area(new Rectangle2D.Double(-100000, -100000, 200000, 200000));
         clip.subtract(new Area(negativeClip(true)));
         clip.subtract(new Area(negativeClip(false)));
-        
+
         return clip;
     }
-    
+
     private Shape negativeClip(boolean forward) {
         final Road.End end = forward ? getModel().getToEnd() : getModel().getFromEnd();
         final JunctionGui j = forward ? b : a;
-        
+
         final Line2D lc = getLeftCurb(end);
         final Line2D rc = getRightCurb(end);
-        
+
         final Path2D negativeClip = new Path2D.Double();
-        
+
         final double d = rc.getP1().distance(j.getPoint()) + lc.getP1().distance(j.getPoint());
-        
+
         final double cm = 0.01 / getContainer().getMpp(); // 1 centimeter
         final double rca = angle(rc) + PI;
@@ -770,5 +771,5 @@
         final Point2D l1 = relativePoint(relativePoint(lc.getP1(), 1, angle(rc.getP1(), lc.getP1())), cm, lca);
         final Point2D l2 = relativePoint(l1, d, lca);
-        
+
         negativeClip.moveTo(r1.getX(), r1.getY());
         negativeClip.lineTo(r2.getX(), r2.getY());
@@ -776,70 +777,70 @@
         negativeClip.lineTo(l1.getX(), l1.getY());
         negativeClip.closePath();
-        
+
         return negativeClip;
     }
-    
+
     public Path getLaneMiddle(boolean forward) {
         final Path mid = middlePath(!forward);
         final double w = getWidth(forward ? getModel().getFromEnd() : getModel().getToEnd(), true);
         final double o = (w - outerMargin) / 2;
-        
+
         return o > 0 ? mid.offset(-o, -1, -1, -o) : mid;
     }
-    
+
     private Path middlePath(boolean forward) {
         final Path path = forward ? Path.create(b.x, b.y) : Path.create(a.x, a.y);
         final Segment first = forward ? segments.get(segments.size() - 1) : segments.get(0);
-        
+
         return first.append(path, forward, 0);
     }
-    
+
     private void moveIncoming(Road.End end) {
         final Point2D lc = getLeftCorner(end);
         final Point2D rc = getRightCorner(end);
         final Line2D cornerLine = new Line2D.Double(lc, rc);
-        
+
         final double a = getAngle(end);
         final Line2D roadLine = line(getContainer().getGui(end.getJunction()).getPoint(), a);
-        
+
         final Point2D i = intersection(roadLine, cornerLine);
         // TODO fix depending on angle(i, lc)
         final double offset = innerMargin + (getWidth(end, true) - innerMargin - outerMargin) / 2;
         final Point2D loc = relativePoint(i, offset, angle(i, lc));
-        
+
         getConnector(end).move(loc.getX(), loc.getY());
     }
-    
+
     private void moveOutgoing(LaneGui lane, int offset) {
         final Road.End end = lane.getModel().getOutgoingRoadEnd();
-        
+
         final Point2D lc = getLeftCorner(end);
         final Point2D rc = getRightCorner(end);
         final Line2D cornerLine = new Line2D.Double(lc, rc);
-        
+
         final double a = getAngle(end);
         final Line2D roadLine = line(getContainer().getGui(end.getJunction()).getPoint(), a);
-        
+
         final Point2D i = intersection(roadLine, cornerLine);
         // TODO fix depending on angle(i, rc)
         final double d = innerMargin + (2 * offset + 1) * getContainer().getLaneWidth() / 2;
         final Point2D loc = relativePoint(i, d, angle(i, rc));
-        
+
         lane.outgoing.move(loc.getX(), loc.getY());
     }
-    
+
     public JunctionGui getJunction(Road.End end) {
         if (!getModel().equals(end.getRoad())) {
             throw new IllegalArgumentException();
         }
-        
+
         return end.isFromEnd() ? getA() : getB();
     }
-    
+
     public double getAngle(Road.End end) {
         if (!getModel().equals(end.getRoad())) {
             throw new IllegalArgumentException();
         }
-        
+
         if (end.isToEnd()) {
             return segments.get(segments.size() - 1).angle;
@@ -849,30 +850,30 @@
         }
     }
-    
+
     public double getWidth(Road.End end) {
         return getWidth(end, true) + getWidth(end, false);
     }
-    
+
     public double getLength() {
         return length;
     }
-    
+
     public double getOffset(double x, double y) {
         return segments.get(0).getOffset(x, y);
     }
-    
+
     public GuiContainer getContainer() {
         return container;
     }
-    
+
     public List<LaneGui> getLanes() {
         final List<LaneGui> result = new ArrayList<>();
-        
+
         result.addAll(incomingB.getLanes());
         result.addAll(incomingA.getLanes());
-        
+
         return Collections.unmodifiableList(result);
     }
-    
+
     public List<LaneGui> getLanes(Road.End end) {
         return getConnector(end.getOppositeEnd()).getLanes();
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/State.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/State.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/State.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -14,13 +15,13 @@
     static class AllTurns extends State {
         private final State wrapped;
-        
-        public AllTurns(State wrapped) {
+
+        AllTurns(State wrapped) {
             this.wrapped = wrapped;
         }
-        
+
         public State unwrap() {
             return wrapped;
         }
-        
+
         @Override
         State carryOver(GuiContainer newContainer) {
@@ -28,31 +29,31 @@
         }
     }
-    
+
     static class Connecting extends State {
         private final Lane lane;
         private final List<RoadGui.ViaConnector> vias;
-        
-        public Connecting(Lane lane) {
-            this(lane, Collections.<RoadGui.ViaConnector> emptyList());
-        }
-        
-        public Connecting(Lane lane, List<ViaConnector> vias) {
+
+        Connecting(Lane lane) {
+            this(lane, Collections.<RoadGui.ViaConnector>emptyList());
+        }
+
+        Connecting(Lane lane, List<ViaConnector> vias) {
             this.lane = lane;
             this.vias = vias;
         }
-        
+
         public Connecting next(RoadGui.ViaConnector via) {
             if (vias.isEmpty()) {
                 return new Connecting(lane, Collections.unmodifiableList(Arrays.asList(via)));
             }
-            
+
             final List<RoadGui.ViaConnector> tmp = new ArrayList<>(vias.size() + 1);
             final boolean even = (vias.size() & 1) == 0;
             final RoadGui.ViaConnector last = vias.get(vias.size() - 1);
-            
+
             if (last.equals(via) || !even && last.getRoadEnd().getJunction().equals(via.getRoadEnd().getJunction())) {
                 return pop().next(via);
             }
-            
+
             if (vias.size() >= 2) {
                 if (lane.getOutgoingJunction().equals(via.getRoadEnd().getJunction())) {
@@ -62,61 +63,61 @@
                 }
             }
-            
+
             for (RoadGui.ViaConnector v : vias) {
                 tmp.add(v);
-                
+
                 if (!(even && v.equals(last)) && v.getRoadEnd().getJunction().equals(via.getRoadEnd().getJunction())) {
                     return new Connecting(lane, Collections.unmodifiableList(tmp));
                 }
             }
-            
+
             tmp.add(via);
             return new Connecting(lane, Collections.unmodifiableList(tmp));
         }
-        
+
         public Junction getJunction() {
             return vias.isEmpty() ? lane.getOutgoingJunction() : vias.get(vias.size() - 1).getRoadEnd().getJunction();
         }
-        
+
         public RoadGui.ViaConnector getBacktrackViaConnector() {
             return vias.size() < 2 ? null : vias.get(vias.size() - 2);
         }
-        
+
         public List<RoadGui.ViaConnector> getViaConnectors() {
             return vias;
         }
-        
+
         public Lane getLane() {
             return lane;
         }
-        
+
         public Connecting pop() {
             return new Connecting(lane, vias.subList(0, vias.size() - 1));
         }
     }
-    
+
     static class Invalid extends State {
         private final State wrapped;
-        
-        public Invalid(State wrapped) {
+
+        Invalid(State wrapped) {
             this.wrapped = wrapped;
         }
-        
+
         public State unwrap() {
             return wrapped;
         }
     }
-    
+
     static class Dirty extends State {
         private final State wrapped;
-        
-        public Dirty(State wrapped) {
+
+        Dirty(State wrapped) {
             this.wrapped = wrapped;
         }
-        
+
         public State unwrap() {
             return wrapped;
         }
-        
+
         @Override
         State carryOver(GuiContainer newContainer) {
@@ -124,20 +125,20 @@
         }
     }
-    
+
     static class Default extends State {
-        public Default() {}
-    }
-    
+        Default() {}
+    }
+
     static class IncomingActive extends State {
         private final Road.End roadEnd;
-        
-        public IncomingActive(Road.End roadEnd) {
+
+        IncomingActive(Road.End roadEnd) {
             this.roadEnd = roadEnd;
         }
-        
+
         public Road.End getRoadEnd() {
             return roadEnd;
         }
-        
+
         @Override
         State carryOver(GuiContainer newContainer) {
@@ -145,7 +146,7 @@
                 return this;
             }
-            
+
             final Junction newJunction = newContainer.getModel().getJunction(roadEnd.getJunction().getNode());
-            
+
             for (Road.End e : newJunction.getRoadEnds()) {
                 if (e.isToEnd() && e.getWay().equals(roadEnd.getWay())) {
@@ -153,20 +154,20 @@
                 }
             }
-            
+
             return new Default();
         }
     }
-    
+
     static class OutgoingActive extends State {
         private final LaneGui lane;
-        
-        public OutgoingActive(LaneGui lane) {
+
+        OutgoingActive(LaneGui lane) {
             this.lane = lane;
         }
-        
+
         public LaneGui getLane() {
             return lane;
         }
-        
+
         @Override
         State delete() {
@@ -174,10 +175,10 @@
                 return this;
             }
-            
+
             lane.getModel().remove();
-            
+
             return new Invalid(this);
         }
-        
+
         @Override
         State carryOver(GuiContainer newContainer) {
@@ -185,8 +186,8 @@
                 return this;
             }
-            
+
             final Lane model = lane.getModel();
             final Junction newJunction = newContainer.getModel().getJunction(model.getOutgoingJunction().getNode());
-            
+
             for (Road.End e : newJunction.getRoadEnds()) {
                 if (e.isToEnd() && e.getWay().equals(model.getOutgoingRoadEnd().getWay())) {
@@ -196,17 +197,17 @@
                         }
                     }
-                    
+
                     break;
                 }
             }
-            
+
             return new Default();
         }
     }
-    
+
     State delete() {
         return this;
     }
-    
+
     State carryOver(GuiContainer newContainer) {
         return this;
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -42,10 +43,10 @@
     private class EditAction extends JosmAction {
         private static final long serialVersionUID = 4114119073563457706L;
-        
-        public EditAction() {
+
+        EditAction() {
             super(tr("Edit"), "dialogs/edit", tr("Edit turn relations and lane lengths for selected node."), null,
                     false);
         }
-        
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -57,13 +58,13 @@
         }
     }
-    
+
     private class ValidateAction extends JosmAction {
         private static final long serialVersionUID = 7510740945725851427L;
-        
-        public ValidateAction() {
+
+        ValidateAction() {
             super(tr("Validate"), "dialogs/validator", tr("Validate turn- and lane-length-relations for consistency."),
                     null, false);
         }
-        
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -74,5 +75,5 @@
         }
     }
-    
+
     private final DataSetListener dataSetListener = new DataSetListener() {
         @Override
@@ -80,41 +81,41 @@
             refresh();
         }
-        
+
         @Override
         public void tagsChanged(TagsChangedEvent event) {
             refresh();
-            
-        }
-        
+
+        }
+
         @Override
         public void relationMembersChanged(RelationMembersChangedEvent event) {
             refresh();
         }
-        
+
         @Override
         public void primitivesRemoved(PrimitivesRemovedEvent event) {
             refresh();
         }
-        
+
         @Override
         public void primitivesAdded(PrimitivesAddedEvent event) {
             refresh();
         }
-        
+
         @Override
         public void otherDatasetChange(AbstractDatasetChangedEvent event) {
             refresh();
         }
-        
+
         @Override
         public void nodeMoved(NodeMovedEvent event) {
             refresh();
         }
-        
+
         @Override
         public void dataChanged(DataChangedEvent event) {
             refresh();
         }
-        
+
         private void refresh() {
             if (editing) {
@@ -123,30 +124,30 @@
         }
     };
-    
+
     private final JosmAction editAction = new EditAction();
     private final JosmAction validateAction = new ValidateAction();
-    
+
     private static final long serialVersionUID = -1998375221636611358L;
-    
+
     private static final String CARD_EDIT = "EDIT";
     private static final String CARD_VALIDATE = "VALIDATE";
-    
+
     private final JPanel body = new JPanel();
     private final JunctionPane junctionPane = new JunctionPane(GuiContainer.empty());
-    
+
     private final JToggleButton editButton = new JToggleButton(editAction);
     private final JToggleButton validateButton = new JToggleButton(validateAction);
-    
+
     private final Set<OsmPrimitive> selected = new HashSet<>();
-    
+
     private boolean editing = true;
     private boolean wasShowing = false;
-    
+
     public TurnLanesDialog() {
         super(tr("Turn Lanes"), "turnlanes.png", tr("Edit turn lanes"), null, 200);
-        
+
         Main.getLayerManager().addActiveLayerChangeListener(this);
         DataSet.addSelectionListener(this);
-        
+
         final JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 4, 4));
         final ButtonGroup group = new ButtonGroup();
@@ -155,16 +156,16 @@
         buttonPanel.add(editButton);
         buttonPanel.add(validateButton);
-        
+
         body.setLayout(new CardLayout(4, 4));
-        
+
         add(buttonPanel, BorderLayout.SOUTH);
         add(body, BorderLayout.CENTER);
-        
+
         body.add(junctionPane, CARD_EDIT);
         body.add(new ValidationPanel(), CARD_VALIDATE);
-        
+
         editButton.doClick();
     }
-    
+
     @Override
     protected void stateChanged() {
@@ -174,5 +175,5 @@
         wasShowing = isShowing;
     }
-    
+
     void refresh() {
         if (isShowing && editing) {
@@ -180,8 +181,8 @@
             final List<Node> nodes = OsmPrimitive.getFilteredList(s, Node.class);
             final List<Way> ways = OsmPrimitive.getFilteredList(s, Way.class);
-            
+
             final ModelContainer mc = nodes.isEmpty() ? ModelContainer.empty() : ModelContainer
                     .createEmpty(nodes, ways);
-            
+
             junctionPane.setJunction(new GuiContainer(mc));
         }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ValidationPanel.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ValidationPanel.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ValidationPanel.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.gui;
 
@@ -26,13 +27,13 @@
 class ValidationPanel extends JPanel {
     private static final long serialVersionUID = -1585778734201458665L;
-    
+
     private static final String[] COLUMN_NAMES = {
         tr("Description"), tr("Type"), tr("Quick-Fix")
     };
-    
+
     private final Action refreshAction = new JosmAction(tr("Refresh"), "dialogs/refresh",
         tr("Revalidate all turnlanes-relations."), null, false) {
         private static final long serialVersionUID = -8110599654128234810L;
-        
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -40,9 +41,9 @@
         }
     };
-    
+
     private final Action fixAction = new JosmAction(tr("Fix"), "dialogs/fix", tr("Automatically fixes the issue."), null,
         false) {
         private static final long serialVersionUID = -8110599654128234810L;
-        
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -54,9 +55,9 @@
         }
     };
-    
+
     private final Action selectAction = new JosmAction(tr("Select"), "dialogs/select",
         tr("Selects the offending relation."), null, false) {
         private static final long serialVersionUID = -8110599654128234810L;
-        
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -68,33 +69,34 @@
         }
     };
-    
+
     private final SideButton refreshButton = new SideButton(refreshAction);
     private final SideButton fixButton = new SideButton(fixAction);
     private final SideButton selectButton = new SideButton(selectAction);
-    
+
     private final DefaultTableModel issueModel = new DefaultTableModel(COLUMN_NAMES, 0);
     private final List<Issue> issues = new ArrayList<>();
     private final JTable issueTable = new JTable(issueModel) {
         private static final long serialVersionUID = 6323348290180585298L;
-        
+
+        @Override
         public boolean isCellEditable(int row, int column) {
             return false;
-        };
+        }
     };
-    
+
     private Issue selected;
-    
-    public ValidationPanel() {
+
+    ValidationPanel() {
         super(new BorderLayout(4, 4));
-        
+
         final JPanel buttonPanel = new JPanel(new GridLayout(1, 3, 4, 4));
-        
+
         buttonPanel.add(refreshButton);
         buttonPanel.add(fixButton);
         buttonPanel.add(selectButton);
-        
+
         add(buttonPanel, BorderLayout.NORTH);
         add(new JScrollPane(issueTable), BorderLayout.CENTER);
-        
+
         issueTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         issueTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@@ -103,16 +105,16 @@
                 final int i = issueTable.getSelectedRow();
                 final Issue issue = i >= 0 ? issues.get(i) : null;
-                
+
                 setSelected(issue);
             }
         });
-        
+
         setSelected(null);
     }
-    
+
     private void setIssues(List<Issue> issues) {
         issueModel.setRowCount(0);
         this.issues.clear();
-        
+
         for (Issue i : issues) {
             final String[] row = {
@@ -125,8 +127,8 @@
         }
     }
-    
+
     private void setSelected(Issue selected) {
         this.selected = selected;
-        
+
         if (selected == null) {
             fixButton.setEnabled(false);
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Constants.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Constants.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Constants.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -7,20 +8,20 @@
     String SPLIT_REGEX = "\\p{Zs}*[,:;]\\p{Zs}*";
     Pattern SPLIT_PATTERN = Pattern.compile(SPLIT_REGEX);
-    
+
     String TYPE_LENGTHS = "turnlanes:lengths";
-    
+
     String LENGTHS_KEY_LENGTHS_LEFT = "lengths:left";
     String LENGTHS_KEY_LENGTHS_RIGHT = "lengths:right";
-    
+
     String TYPE_TURNS = "turnlanes:turns";
-    
+
     String TURN_ROLE_VIA = "via";
     String TURN_ROLE_FROM = "from";
     String TURN_ROLE_TO = "to";
-    
+
     String TURN_KEY_LANES = "lanes";
     String TURN_KEY_EXTRA_LANES = "lanes:extra";
     String LENGTHS_ROLE_END = "end";
     String LENGTHS_ROLE_WAYS = "ways";
-    
+
 }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/GenericCommand.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/GenericCommand.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/GenericCommand.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -17,35 +18,35 @@
         final PrimitiveData before;
         final AbstractPrimitive after;
-        
-        public BeforeAfter(PrimitiveData before, AbstractPrimitive after) {
+
+        BeforeAfter(PrimitiveData before, AbstractPrimitive after) {
             this.before = before;
             this.after = after;
         }
-        
+
         public OsmPrimitive afterPrimitive() {
             return (OsmPrimitive) after;
         }
-        
+
         public PrimitiveData afterData() {
             return (PrimitiveData) after;
         }
     }
-    
+
     private final DataSet dataSet;
     private final String description;
     private final Map<OsmPrimitive, BeforeAfter> beforeAfters = new HashMap<>();
-    
+
     public GenericCommand(DataSet dataSet, String description) {
         this.dataSet = dataSet;
         this.description = description;
     }
-    
+
     void add(OsmPrimitive p) {
         beforeAfters.put(p, new BeforeAfter(null, p));
     }
-    
+
     AbstractPrimitive backup(OsmPrimitive p) {
         final BeforeAfter ba = beforeAfters.get(p);
-        
+
         if (ba == null) {
             final BeforeAfter newBa = new BeforeAfter(p.save(), p.save());
@@ -56,14 +57,14 @@
         }
     }
-    
+
     @Override
     public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted,
             Collection<OsmPrimitive> added) {}
-    
+
     @Override
     public String getDescriptionText() {
         return description;
     }
-    
+
     @Override
     public boolean executeCommand() {
@@ -77,5 +78,5 @@
         return true;
     }
-    
+
     @Override
     public void undoCommand() {
@@ -88,10 +89,10 @@
         }
     }
-    
+
     @Override
     public PrimitiveData getOrig(OsmPrimitive osm) {
         return beforeAfters.get(osm).before;
     }
-    
+
     @Override
     public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Issue.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Issue.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Issue.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -11,5 +12,5 @@
 import org.openstreetmap.josm.data.osm.Relation;
 
-public class Issue {
+public final class Issue {
     public enum Severity {
         INFO,
@@ -17,8 +18,8 @@
         ERROR;
     }
-    
-    public static abstract class QuickFix {
+
+    public abstract static class QuickFix {
         public static final QuickFix NONE = new QuickFix(tr("None")) {
-            
+
             @Override
             public boolean perform() {
@@ -26,18 +27,18 @@
             }
         };
-        
+
         private final String description;
-        
+
         public QuickFix(String description) {
             this.description = description;
         }
-        
+
         public String getDescription() {
             return description;
         }
-        
+
         public abstract boolean perform();
     }
-    
+
     private final Severity severity;
     private final Relation relation;
@@ -45,5 +46,5 @@
     private final String description;
     private final QuickFix quickFix;
-    
+
     private Issue(Severity severity, Relation relation, List<? extends OsmPrimitive> primitives, String description,
         QuickFix quickFix) {
@@ -54,42 +55,42 @@
         this.quickFix = quickFix;
     }
-    
+
     public static Issue newError(Relation relation, List<? extends OsmPrimitive> primitives, String description,
         QuickFix quickFix) {
         return new Issue(Severity.ERROR, relation, primitives, description, quickFix);
     }
-    
+
     public static Issue newError(Relation relation, List<? extends OsmPrimitive> primitives, String description) {
         return newError(relation, primitives, description, QuickFix.NONE);
     }
-    
+
     public static Issue newError(Relation relation, OsmPrimitive primitive, String description) {
         return newError(relation, Arrays.asList(primitive), description, QuickFix.NONE);
     }
-    
+
     public static Issue newError(Relation relation, String description) {
-        return newError(relation, Collections.<OsmPrimitive> emptyList(), description, QuickFix.NONE);
+        return newError(relation, Collections.<OsmPrimitive>emptyList(), description, QuickFix.NONE);
     }
-    
+
     public static Issue newWarning(List<OsmPrimitive> primitives, String description) {
         return new Issue(Severity.WARN, null, primitives, description, QuickFix.NONE);
     }
-    
+
     public Severity getSeverity() {
         return severity;
     }
-    
+
     public String getDescription() {
         return description;
     }
-    
+
     public Relation getRelation() {
         return relation;
     }
-    
+
     public List<OsmPrimitive> getPrimitives() {
         return primitives;
     }
-    
+
     public QuickFix getQuickFix() {
         return quickFix;
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Junction.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Junction.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Junction.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -11,52 +12,52 @@
 public class Junction {
     private final ModelContainer container;
-    
+
     private final Node node;
     private final Set<Way> roads = new HashSet<>();
-    
+
     Junction(ModelContainer container, Node n) {
         this.container = container;
         this.node = n;
     }
-    
+
     public boolean isPrimary() {
         return getContainer().isPrimary(this);
     }
-    
+
     public Node getNode() {
         return node;
     }
-    
+
     public List<Road> getRoads() {
         final List<Road> result = new ArrayList<>(roads.size());
-        
+
         for (Way w : roads) {
             result.add(container.getRoad(w));
         }
-        
+
         return result;
     }
-    
+
     public List<Road.End> getRoadEnds() {
         final List<Road.End> result = new ArrayList<>(roads.size());
-        
+
         for (Way w : roads) {
             result.add(getRoadEnd(w));
         }
-        
+
         return result;
     }
-    
+
     void addRoad(Way w) {
         roads.add(w);
     }
-    
+
     Road.End getRoadEnd(Way w) {
         final Road r = getContainer().getRoad(w);
-        
+
         if (r.getRoute().getSegments().size() == 1) {
             final boolean starts = r.getRoute().getStart().equals(node);
             final boolean ends = r.getRoute().getEnd().equals(node);
-            
+
             if (starts && ends) {
                 throw new IllegalArgumentException("Ambiguous: The way starts and ends at the junction node.");
@@ -71,9 +72,9 @@
             return r.getToEnd();
         }
-        
+
         throw new IllegalArgumentException("While there exists a road for the given way, the way neither "
                 + "starts nor ends at the junction node.");
     }
-    
+
     public ModelContainer getContainer() {
         return container;
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Lane.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Lane.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Lane.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -20,14 +21,14 @@
         EXTRA_RIGHT,
         REGULAR;
-        
+
         public boolean isExtra() {
             return this == EXTRA_LEFT || this == EXTRA_RIGHT;
         }
     }
-    
+
     static List<Lane> load(Road.End roadEnd) {
         final List<Lane> result = new ArrayList<>();
         int i;
-        
+
         i = 0;
         for (double l : roadEnd.getLengths(Kind.EXTRA_LEFT)) {
@@ -35,21 +36,21 @@
         }
         Collections.reverse(result);
-        
+
         final int regulars = getRegularCount(roadEnd.getWay(), roadEnd.getJunction().getNode());
         for (i = 1; i <= regulars; ++i) {
             result.add(new Lane(roadEnd, i));
         }
-        
+
         i = 0;
         for (double l : roadEnd.getLengths(Kind.EXTRA_RIGHT)) {
             result.add(new Lane(roadEnd, ++i, Kind.EXTRA_RIGHT, l));
         }
-        
+
         return result;
     }
-    
+
     static List<Double> loadLengths(Relation r, String key, double lengthBound) {
         final List<Double> result = new ArrayList<>();
-        
+
         if (r != null && r.get(key) != null) {
             for (String s : Constants.SPLIT_PATTERN.split(r.get(key))) {
@@ -57,5 +58,5 @@
                 // a unit (m))
                 final Double length = Double.parseDouble(s.trim());
-                
+
                 if (length >= lengthBound) {
                     result.add(length);
@@ -63,12 +64,12 @@
             }
         }
-        
+
         return result;
     }
-    
+
     static int getRegularCount(Way w, Node end) {
         final int count = Utils.parseIntTag(w, "lanes");
         final boolean forward = w.lastNode().equals(end);
-        
+
         if (w.hasDirectionKeys()) {
             return getRegularCountOneWay(w, forward, count);
@@ -77,5 +78,5 @@
         }
     }
-    
+
     private static int getRegularCountOneWay(Way w, boolean forward, final int count) {
         if (forward ^ "-1".equals(w.get("oneway"))) {
@@ -85,5 +86,5 @@
         }
     }
-    
+
     private static int getRegularCountTwoWay(Way w, boolean forward, final int count) {
         if (w.get("lanes:backward") != null) {
@@ -91,21 +92,21 @@
             return forward ? count - backwardCount : backwardCount;
         }
-        
+
         if (w.get("lanes:forward") != null) {
             final int forwardCount = Utils.parseIntTag(w, "lanes:forward");
             return forward ? forwardCount : count - forwardCount;
         }
-        
+
         // default: round up in forward direction...
         return forward ? (count + 1) / 2 : count / 2;
     }
-    
+
     private final Road.End roadEnd;
     private final int index;
     private final Kind kind;
-    
+
     private Set<Turn> turns;
     private double length = -1;
-    
+
     public Lane(Road.End roadEnd, int index) {
         this.roadEnd = roadEnd;
@@ -113,30 +114,30 @@
         this.kind = Kind.REGULAR;
     }
-    
+
     public Lane(Road.End roadEnd, int index, Kind kind, double length) {
         assert kind == Kind.EXTRA_LEFT || kind == Kind.EXTRA_RIGHT;
-        
+
         this.roadEnd = roadEnd;
         this.index = index;
         this.kind = kind;
         this.length = length;
-        
+
         if (length <= 0) {
             throw new IllegalArgumentException("Length must be positive");
         }
     }
-    
+
     public Road getRoad() {
         return roadEnd.getRoad();
     }
-    
+
     public Kind getKind() {
         return kind;
     }
-    
+
     public double getLength() {
         return isExtra() ? length : getRoad().getLength();
     }
-    
+
     public void setLength(double length) {
         if (!isExtra()) {
@@ -145,42 +146,42 @@
             throw new IllegalArgumentException("Length must positive.");
         }
-        
+
         this.length = length;
-        
+
         // TODO if needed, increase length of other lanes
         getOutgoingRoadEnd().updateLengths();
     }
-    
+
     public boolean isExtra() {
         return getKind() != Kind.REGULAR;
     }
-    
+
     public int getIndex() {
         return index;
     }
-    
+
     public Junction getOutgoingJunction() {
         return getOutgoingRoadEnd().getJunction();
     }
-    
+
     public Junction getIncomingJunction() {
         return getIncomingRoadEnd().getJunction();
     }
-    
+
     public Road.End getOutgoingRoadEnd() {
         return roadEnd;
     }
-    
+
     public Road.End getIncomingRoadEnd() {
         return roadEnd.getOppositeEnd();
     }
-    
+
     public ModelContainer getContainer() {
         return getRoad().getContainer();
     }
-    
+
     public void addTurn(List<Road> via, Road.End to) {
         final GenericCommand cmd = new GenericCommand(getOutgoingJunction().getNode().getDataSet(), tr("Add turn"));
-        
+
         Relation existing = null;
         for (Turn t : to.getTurns()) {
@@ -190,14 +191,14 @@
                     return;
                 }
-                
+
                 existing = t.getRelation();
             }
         }
-        
+
         final Relation r;
         if (existing == null) {
             r = new Relation();
             r.put("type", Constants.TYPE_TURNS);
-            
+
             r.addMember(new RelationMember(Constants.TURN_ROLE_FROM, getOutgoingRoadEnd().getWay()));
             if (via.isEmpty()) {
@@ -209,50 +210,50 @@
             }
             r.addMember(new RelationMember(Constants.TURN_ROLE_TO, to.getWay()));
-            
+
             cmd.add(r);
         } else {
             r = existing;
         }
-        
+
         final String key = isExtra() ? Constants.TURN_KEY_EXTRA_LANES : Constants.TURN_KEY_LANES;
         final List<Integer> lanes = Turn.indices(r, key);
         lanes.add(getIndex());
         cmd.backup(r).put(key, Turn.join(lanes));
-        
+
         Main.main.undoRedo.add(cmd);
     }
-    
+
     public Set<Turn> getTurns() {
         return turns;
     }
-    
+
     public void remove() {
         if (!isExtra()) {
             throw new UnsupportedOperationException();
         }
-        
+
         final GenericCommand cmd = new GenericCommand(getOutgoingJunction().getNode().getDataSet(), tr("Delete lane."));
-        
+
         for (Turn t : getTurns()) {
             t.remove(cmd);
         }
-        
+
         getOutgoingRoadEnd().removeLane(cmd, this);
-        
+
         Main.main.undoRedo.add(cmd);
     }
-    
+
     void initialize() {
         final Set<Turn> turns = Turn.load(getContainer(), Constants.TURN_ROLE_FROM, getOutgoingRoadEnd().getWay());
-        
+
         final Iterator<Turn> it = turns.iterator();
         while (it.hasNext()) {
             final Turn t = it.next();
-            
+
             if (!t.getFrom().equals(this)) {
                 it.remove();
             }
         }
-        
+
         this.turns = Collections.unmodifiableSet(turns);
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -19,28 +20,28 @@
 import org.openstreetmap.josm.tools.Pair;
 
-public class ModelContainer {
-    private static final ModelContainer EMPTY = new ModelContainer(Collections.<Node> emptySet(),
-            Collections.<Way> emptySet(), false);
-    
+public final class ModelContainer {
+    private static final ModelContainer EMPTY = new ModelContainer(Collections.<Node>emptySet(),
+            Collections.<Way>emptySet(), false);
+
     public static ModelContainer create(Iterable<Node> primaryNodes, Iterable<Way> primaryWays) {
         return new ModelContainer(new HashSet<>(CollectionUtils.toList(primaryNodes)), new HashSet<>(
                 CollectionUtils.toList(primaryWays)), false);
     }
-    
+
     public static ModelContainer createEmpty(Iterable<Node> primaryNodes, Iterable<Way> primaryWays) {
         return new ModelContainer(new HashSet<>(CollectionUtils.toList(primaryNodes)), new HashSet<>(
                 CollectionUtils.toList(primaryWays)), true);
     }
-    
+
     public static ModelContainer empty() {
         return EMPTY;
     }
-    
+
     private static void close(Set<Node> closedNodes, Set<Way> closedWays) {
         boolean closed = false;
-        
+
         while (!closed) {
             closed = true;
-            
+
             for (Node n : new ArrayList<>(closedNodes)) {
                 for (Way w : Utils.filterRoads(n.getReferrers())) {
@@ -49,5 +50,5 @@
                     }
                 }
-                
+
                 for (Way w : new ArrayList<>(closedWays)) {
                     closed &= close(closedNodes, closedWays, w);
@@ -56,13 +57,13 @@
         }
     }
-    
+
     private static boolean close(Set<Node> closedNodes, Set<Way> closedWays, Way w) {
         boolean closed = true;
-        
+
         for (Relation r : OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class)) {
             if (!r.get("type").equals(Constants.TYPE_TURNS)) {
                 continue;
             }
-            
+
             for (RelationMember m : r.getMembers()) {
                 if (m.getRole().equals(Constants.TURN_ROLE_VIA) && m.getMember().equals(w)) {
@@ -71,11 +72,11 @@
             }
         }
-        
+
         return closed;
     }
-    
+
     private static boolean close(Set<Node> closedNodes, Set<Way> closedWays, Relation r) {
         boolean closed = true;
-        
+
         final List<Way> via = new ArrayList<>();
         for (RelationMember m : Utils.getMembers(r, Constants.TURN_ROLE_VIA)) {
@@ -87,38 +88,38 @@
             }
         }
-        
+
         if (!via.isEmpty()) {
             final Way from = Utils.getMemberWay(r, Constants.TURN_ROLE_FROM);
             final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
-            
+
             closed &= !closedNodes.add(Utils.lineUp(from, via.get(0)));
             closed &= !closedNodes.add(Utils.lineUp(via.get(via.size() - 1), to));
         }
-        
+
         return closed;
     }
-    
+
     private static <E extends OsmPrimitive, C extends Collection<E>> C filterUsables(C collection) {
         final Iterator<E> it = collection.iterator();
-        
+
         while (it.hasNext()) {
             final E e = it.next();
-            
+
             if (e.getDataSet() == null || !e.isUsable()) {
                 it.remove();
             }
         }
-        
+
         return collection;
     }
-    
+
     private final Map<Node, Junction> junctions = new HashMap<>();
     private final Map<Way, Road> roads = new HashMap<>();
-    
+
     private final Set<Node> primaryNodes;
     private final Set<Way> primaryWays;
-    
+
     private final boolean empty;
-    
+
     private ModelContainer(Set<Node> primaryNodes, Set<Way> primaryWays, boolean empty) {
         if (empty) {
@@ -129,10 +130,10 @@
             final Set<Node> closedNodes = filterUsables(new HashSet<>(primaryNodes));
             final Set<Way> closedWays = filterUsables(new HashSet<>(primaryWays));
-            
+
             close(closedNodes, closedWays);
-            
+
             this.primaryNodes = Collections.unmodifiableSet(closedNodes);
             this.primaryWays = Collections.unmodifiableSet(closedWays);
-            
+
             for (Pair<Way, Junction> w : createPrimaryJunctions()) {
                 if (!this.primaryWays.contains(w.a)) {
@@ -140,20 +141,20 @@
                 }
             }
-            
+
             for (Route r : Utils.orderWays(this.primaryWays, this.primaryNodes)) {
                 addRoad(new Road(this, r));
             }
-            
+
             for (Road r : roads.values()) {
                 r.initialize();
             }
-            
+
             this.empty = junctions.isEmpty();
         }
     }
-    
+
     private Set<Pair<Way, Junction>> createPrimaryJunctions() {
         final Set<Pair<Way, Junction>> roads = new HashSet<>();
-        
+
         for (Node n : primaryNodes) {
             final List<Way> ws = new ArrayList<>();
@@ -163,5 +164,5 @@
                 }
             }
-            
+
             if (ws.size() > 1) {
                 final Junction j = register(new Junction(this, n));
@@ -171,44 +172,44 @@
             }
         }
-        
+
         return roads;
     }
-    
+
     Junction getOrCreateJunction(Node n) {
         final Junction existing = junctions.get(n);
-        
+
         if (existing != null) {
             return existing;
         }
-        
+
         return register(new Junction(this, n));
     }
-    
+
     public Junction getJunction(Node n) {
         Junction j = junctions.get(n);
-        
+
         if (j == null) {
             throw new IllegalArgumentException();
         }
-        
+
         return j;
     }
-    
+
     Road getRoad(Way w) {
         final Road r = roads.get(w);
-        
+
         if (r == null) {
             throw new IllegalArgumentException("There is no road containing the given way.");
         }
-        
+
         return r;
     }
-    
+
     private void addRoad(Road newRoad, Road mergedA, Road mergedB) {
         assert (mergedA == null) == (mergedB == null);
-        
+
         for (Route.Segment s : newRoad.getRoute().getSegments()) {
             final Road oldRoad = roads.put(s.getWay(), newRoad);
-            
+
             if (oldRoad != null) {
                 if (mergedA == null) {
@@ -220,15 +221,15 @@
         }
     }
-    
+
     private void addRoad(Road newRoad) {
         addRoad(newRoad, null, null);
     }
-    
+
     private Road mergeRoads(Road a, Road b) {
         final String ERR_ILLEGAL_ARGS = "The given roads can not be merged into one.";
-        
+
         final List<Way> ws = new ArrayList<>(CollectionUtils.toList(CollectionUtils.reverse(a.getRoute().getWays())));
         final List<Way> bws = b.getRoute().getWays();
-        
+
         int i = -1;
         for (Way w : ws) {
@@ -239,27 +240,27 @@
             }
         }
-        
+
         if (i < 0) {
             throw new IllegalArgumentException(ERR_ILLEGAL_ARGS);
         }
         ws.addAll(bws.subList(i + 1, bws.size()));
-        
+
         final Route mergedRoute = Route.create(ws, a.getRoute().getLastSegment().getEnd());
         return new Road(this, mergedRoute);
     }
-    
+
     private Junction register(Junction j) {
         if (junctions.put(j.getNode(), j) != null) {
             throw new IllegalStateException();
         }
-        
+
         return j;
     }
-    
+
     public Set<Junction> getPrimaryJunctions() {
         if (empty) {
             return Collections.emptySet();
         }
-        
+
         final Set<Junction> pjs = new HashSet<>();
         for (Node n : primaryNodes) {
@@ -268,10 +269,10 @@
         return pjs;
     }
-    
+
     public Set<Road> getPrimaryRoads() {
         if (empty) {
             return Collections.emptySet();
         }
-        
+
         final Set<Road> prs = new HashSet<>();
         for (Way w : primaryWays) {
@@ -280,25 +281,25 @@
         return prs;
     }
-    
+
     public ModelContainer recalculate() {
         return new ModelContainer(primaryNodes, primaryWays, false);
     }
-    
+
     public boolean isPrimary(Junction j) {
         return primaryNodes.contains(j.getNode());
     }
-    
+
     public boolean isPrimary(Road r) {
         return primaryWays.contains(r.getRoute().getFirstSegment().getWay());
     }
-    
+
     public boolean isEmpty() {
         return empty;
     }
-    
+
     public boolean hasRoad(Way w) {
         return roads.containsKey(w);
     }
-    
+
     public boolean hasJunction(Node n) {
         return junctions.containsKey(n);
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Road.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Road.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Road.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -23,17 +24,17 @@
 
 public class Road {
-    public class End {
+    public final class End {
         private final boolean from;
         private final Junction junction;
-        
+
         private final Relation lengthsLeft;
         private final Relation lengthsRight;
-        
+
         private final double extraLengthLeft;
         private final double extraLengthRight;
-        
+
         private final List<Lane> lanes;
         private Set<Turn> turns;
-        
+
         private End(boolean from, Junction junction, Relation lengthsLeft, Relation lengthsRight) {
             this.from = from;
@@ -44,8 +45,8 @@
             this.extraLengthRight = lengthsRight == null ? 0 : Route.load(lengthsRight).getLengthFrom(getWay());
             this.lanes = Lane.load(this);
-            
+
             junction.addRoad(getWay());
         }
-        
+
         private End(boolean from, Junction junction) {
             this.from = from;
@@ -56,32 +57,32 @@
             this.extraLengthRight = 0;
             this.lanes = Lane.load(this);
-            
+
             junction.addRoad(getWay());
         }
-        
+
         public Road getRoad() {
             return Road.this;
         }
-        
+
         public Way getWay() {
             return isFromEnd() ? getRoute().getFirstSegment().getWay() : getRoute().getLastSegment().getWay();
         }
-        
+
         public Junction getJunction() {
             return junction;
         }
-        
+
         public boolean isFromEnd() {
             return from;
         }
-        
+
         public boolean isToEnd() {
             return !isFromEnd();
         }
-        
+
         public End getOppositeEnd() {
             return isFromEnd() ? toEnd : fromEnd;
         }
-        
+
         /**
          * @return the turns <em>onto</em> this road at this end
@@ -90,10 +91,10 @@
             return turns;
         }
-        
+
         public void addLane(Lane.Kind kind) {
             if (kind == Lane.Kind.REGULAR) {
                 throw new IllegalArgumentException("Only extra lanes can be added.");
             }
-            
+
             double length = Double.POSITIVE_INFINITY;
             for (Lane l : lanes) {
@@ -102,22 +103,22 @@
                 }
             }
-            
+
             if (Double.isInfinite(length)) {
                 length = Math.min(20, 3 * getLength() / 4);
             }
-            
+
             addLane(kind, length);
         }
-        
+
         private void addLane(Lane.Kind kind, double length) {
             assert kind == Lane.Kind.EXTRA_LEFT || kind == Lane.Kind.EXTRA_RIGHT;
-            
+
             final GenericCommand cmd = new GenericCommand(getJunction().getNode().getDataSet(), "Add lane");
-            
+
             final boolean left = kind == Lane.Kind.EXTRA_LEFT;
             final Relation rel = left ? lengthsLeft : lengthsRight;
             final Relation other = left ? lengthsRight : lengthsLeft;
             final Node n = getJunction().getNode();
-            
+
             final String lengthStr = toLengthString(length);
             final Relation target;
@@ -131,5 +132,5 @@
                 target = rel;
             }
-            
+
             final String key = left ? Constants.LENGTHS_KEY_LENGTHS_LEFT : Constants.LENGTHS_KEY_LENGTHS_RIGHT;
             final String old = target.get(key);
@@ -139,36 +140,36 @@
                 cmd.backup(target).put(key, old + Constants.SEPARATOR + lengthStr);
             }
-            
+
             Main.main.undoRedo.add(cmd);
         }
-        
+
         private Relation createLengthsRelation() {
             final Node n = getJunction().getNode();
-            
+
             final Relation r = new Relation();
             r.put("type", Constants.TYPE_LENGTHS);
-            
+
             r.addMember(new RelationMember(Constants.LENGTHS_ROLE_END, n));
             for (Route.Segment s : isFromEnd() ? route.getSegments() : CollectionUtils.reverse(route.getSegments())) {
                 r.addMember(new RelationMember(Constants.LENGTHS_ROLE_WAYS, s.getWay()));
             }
-            
+
             n.getDataSet().addPrimitive(r);
-            
+
             return r;
         }
-        
+
         void updateLengths() {
             final GenericCommand cmd = new GenericCommand(getJunction().getNode().getDataSet(), "Change lane length");
-            
+
             for (final boolean left : Arrays.asList(true, false)) {
                 final Lane.Kind kind = left ? Lane.Kind.EXTRA_LEFT : Lane.Kind.EXTRA_RIGHT;
                 final Relation r = left ? lengthsLeft : lengthsRight;
                 final double extra = left ? extraLengthLeft : extraLengthRight;
-                
+
                 if (r == null) {
                     continue;
                 }
-                
+
                 final StringBuilder lengths = new StringBuilder(32);
                 for (Lane l : left ? CollectionUtils.reverse(lanes) : lanes) {
@@ -177,17 +178,17 @@
                     }
                 }
-                
+
                 lengths.setLength(lengths.length() - Constants.SEPARATOR.length());
                 cmd.backup(r).put(left ? Constants.LENGTHS_KEY_LENGTHS_LEFT : Constants.LENGTHS_KEY_LENGTHS_RIGHT,
                         lengths.toString());
             }
-            
+
             Main.main.undoRedo.add(cmd);
         }
-        
+
         public List<Lane> getLanes() {
             return lanes;
         }
-        
+
         public Lane getLane(Lane.Kind kind, int index) {
             for (Lane l : lanes) {
@@ -196,22 +197,22 @@
                 }
             }
-            
+
             throw new IllegalArgumentException("No such lane.");
         }
-        
+
         public Lane getExtraLane(int index) {
             return index < 0 ? getLane(Lane.Kind.EXTRA_LEFT, index) : getLane(Lane.Kind.EXTRA_RIGHT, index);
         }
-        
+
         public boolean isExtendable() {
             final End o = getOppositeEnd();
             return (lengthsLeft == null && lengthsRight == null) && (o.lengthsLeft != null || o.lengthsRight != null);
         }
-        
+
         public void extend(Way way) {
             if (!isExtendable()) {
                 throw new IllegalStateException();
             }
-            
+
             final End o = getOppositeEnd();
             if (o.lengthsLeft != null) {
@@ -222,5 +223,5 @@
             }
         }
-        
+
         public List<Double> getLengths(Lane.Kind kind) {
             switch (kind) {
@@ -233,15 +234,15 @@
             }
         }
-        
+
         void removeLane(GenericCommand cmd, Lane lane) {
             assert lane.getKind() == Lane.Kind.EXTRA_LEFT || lane.getKind() == Lane.Kind.EXTRA_RIGHT;
-            
+
             final boolean left = lane.getKind() == Lane.Kind.EXTRA_LEFT;
             final Relation rel = left ? lengthsLeft : lengthsRight;
-            
+
             for (Turn t : Turn.load(getContainer(), Constants.TURN_ROLE_FROM, getWay())) {
                 t.fixReferences(cmd, left, lane.getIndex());
             }
-            
+
             final double extraLength = left ? extraLengthLeft : extraLengthRight;
             final List<Double> newLengths = new ArrayList<>();
@@ -255,8 +256,8 @@
                 }
             }
-            
+
             final AbstractPrimitive bRel = cmd.backup(rel);
             bRel.put(key, join(newLengths));
-            
+
             if (bRel.get(Constants.LENGTHS_KEY_LENGTHS_LEFT) == null
                     && bRel.get(Constants.LENGTHS_KEY_LENGTHS_RIGHT) == null) {
@@ -264,8 +265,8 @@
             }
         }
-        
+
         void initialize() {
             this.turns = Collections.unmodifiableSet(Turn.load(getContainer(), Constants.TURN_ROLE_TO, getWay()));
-            
+
             for (Lane l : lanes) {
                 l.initialize();
@@ -273,22 +274,22 @@
         }
     }
-    
+
     private static Pair<Relation, Relation> getLengthRelations(Way w, Node n) {
         final List<Relation> left = new ArrayList<>();
         final List<Relation> right = new ArrayList<>();
-        
+
         for (OsmPrimitive p : w.getReferrers()) {
             if (p.getType() != OsmPrimitiveType.RELATION) {
                 continue;
             }
-            
+
             Relation r = (Relation) p;
-            
+
             if (Constants.TYPE_LENGTHS.equals(r.get("type")) && isRightDirection(r, w, n)) {
-                
+
                 if (r.get(Constants.LENGTHS_KEY_LENGTHS_LEFT) != null) {
                     left.add(r);
                 }
-                
+
                 if (r.get(Constants.LENGTHS_KEY_LENGTHS_RIGHT) != null) {
                     right.add(r);
@@ -296,21 +297,21 @@
             }
         }
-        
+
         if (left.size() > 1) {
             throw new IllegalArgumentException("Way is in " + left.size()
                     + " lengths relations for given direction, both specifying left lane lengths.");
         }
-        
+
         if (right.size() > 1) {
             throw new IllegalArgumentException("Way is in " + right.size()
                     + " lengths relations for given direction, both specifying right lane lengths.");
         }
-        
-        return new Pair<>( //
-                left.isEmpty() ? null : left.get(0), //
-                right.isEmpty() ? null : right.get(0) //
+
+        return new Pair<>(
+                left.isEmpty() ? null : left.get(0),
+                right.isEmpty() ? null : right.get(0)
         );
     }
-    
+
     /**
      * @param r
@@ -328,13 +329,13 @@
             }
         }
-        
+
         return false;
     }
-    
+
     private final ModelContainer container;
     private final Route route;
     private final End fromEnd;
     private final End toEnd;
-    
+
     Road(ModelContainer container, Way w, Junction j) {
         final Node n = j.getNode();
@@ -343,5 +344,5 @@
         }
         final Pair<Relation, Relation> lengthsRelations = getLengthRelations(w, n);
-        
+
         this.container = container;
         this.route = lengthsRelations.a == null && lengthsRelations.b == null ? Route.create(Arrays.asList(w), n)
@@ -350,5 +351,5 @@
         this.toEnd = new End(false, j, lengthsRelations.a, lengthsRelations.b);
     }
-    
+
     Road(ModelContainer container, Route route) {
         this.container = container;
@@ -357,36 +358,36 @@
         this.toEnd = new End(false, container.getJunction(route.getEnd()));
     }
-    
+
     public End getFromEnd() {
         return fromEnd;
     }
-    
+
     public End getToEnd() {
         return toEnd;
     }
-    
+
     public Route getRoute() {
         return route;
     }
-    
+
     public double getLength() {
         return route.getLength();
     }
-    
+
     private static String join(List<Double> list) {
         if (list.isEmpty()) {
             return null;
         }
-        
+
         final StringBuilder builder = new StringBuilder(list.size() * (4 + Constants.SEPARATOR.length()));
-        
+
         for (double e : list) {
             builder.append(toLengthString(e)).append(Constants.SEPARATOR);
         }
-        
+
         builder.setLength(builder.length() - Constants.SEPARATOR.length());
         return builder.toString();
     }
-    
+
     private static String toLengthString(double length) {
         final DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance();
@@ -396,13 +397,13 @@
         return nf.format(length);
     }
-    
+
     public ModelContainer getContainer() {
         return container;
     }
-    
+
     public boolean isPrimary() {
         return getContainer().isPrimary(this);
     }
-    
+
     void initialize() {
         fromEnd.initialize();
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Route.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Route.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Route.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -9,44 +10,44 @@
 import org.openstreetmap.josm.data.osm.Way;
 
-public class Route {
+public final class Route {
     public static final class Segment {
         private final Node start;
         private final Way way;
         private final Node end;
-        
+
         private final List<Node> nodes;
-        
+
         Segment(Node start, Way way, Node end) {
             this.start = start;
             this.way = way;
             this.end = end;
-            
+
             final List<Node> ns = way.getNodes();
             if (way.lastNode().equals(start)) {
                 Collections.reverse(ns);
             }
-            
+
             this.nodes = Collections.unmodifiableList(ns);
         }
-        
+
         public Node getStart() {
             return start;
         }
-        
+
         public Way getWay() {
             return way;
         }
-        
+
         public Node getEnd() {
             return end;
         }
-        
+
         public List<Node> getNodes() {
             return nodes;
         }
-        
+
         public double getLength() {
             double length = 0;
-            
+
             Node last = nodes.get(0);
             for (Node n : nodes.subList(1, nodes.size())) {
@@ -54,8 +55,8 @@
                 last = n;
             }
-            
+
             return length;
         }
-        
+
         @Override
         public int hashCode() {
@@ -67,5 +68,5 @@
             return result;
         }
-        
+
         @Override
         public boolean equals(Object obj) {
@@ -95,135 +96,135 @@
         }
     }
-    
+
     public static Route load(Relation r) {
         final Node end = Utils.getMemberNode(r, Constants.LENGTHS_ROLE_END);
         final List<Way> ws = Utils.getMemberWays(r, Constants.LENGTHS_ROLE_WAYS);
-        
+
         return create(ws, end);
     }
-    
+
     public static Route load(Relation left, Relation right, Way w) {
         left = left == null ? right : left;
         right = right == null ? left : right;
-        
+
         if (left == null) {
             throw new IllegalArgumentException("At least one relation must not be null.");
         }
-        
+
         final Route leftRoute = load(left);
         final Route rightRoute = load(right);
-        
+
         int iLeft = 0;
         while (!w.equals(leftRoute.getSegments().get(iLeft++).getWay()))
             ;
-        
+
         int iRight = 0;
         while (!w.equals(rightRoute.getSegments().get(iRight++).getWay()))
             ;
-        
+
         final int min = Math.min(iLeft, iRight);
-        
+
         final List<Segment> leftSegments = leftRoute.getSegments().subList(iLeft - min, iLeft);
         final List<Segment> rightSegments = rightRoute.getSegments().subList(iRight - min, iRight);
-        
+
         if (!leftSegments.equals(rightSegments)) {
             throw new IllegalArgumentException("Routes are split across different ways.");
         }
-        
+
         return new Route(iLeft == min ? rightSegments : leftSegments);
     }
-    
+
     public static Route create(List<Way> ws, Node end) {
         final List<Segment> segments = new ArrayList<>(ws.size());
-        
+
         for (Way w : ws) {
             if (!w.isFirstLastNode(end)) {
                 throw new IllegalArgumentException("Ways must be ordered.");
             }
-            
+
             final Node start = Utils.getOppositeEnd(w, end);
             segments.add(0, new Segment(start, w, end));
             end = start;
         }
-        
+
         return new Route(segments);
     }
-    
+
     private final List<Segment> segments;
-    
+
     private Route(List<Segment> segments) {
         this.segments = Collections.unmodifiableList(new ArrayList<>(segments));
     }
-    
+
     public List<Segment> getSegments() {
         return segments;
     }
-    
+
     public List<Node> getNodes() {
         final List<Node> ns = new ArrayList<>();
-        
+
         ns.add(segments.get(0).getStart());
         for (Segment s : segments) {
             ns.addAll(s.getNodes().subList(1, s.getNodes().size()));
         }
-        
+
         return Collections.unmodifiableList(ns);
     }
-    
+
     public double getLengthFrom(Way w) {
         double length = Double.NEGATIVE_INFINITY;
-        
+
         for (Segment s : getSegments()) {
             length += s.getLength();
-            
+
             if (w.equals(s.getWay())) {
                 length = 0;
             }
         }
-        
+
         if (length < 0) {
             throw new IllegalArgumentException("Way must be part of the route.");
         }
-        
+
         return length;
     }
-    
+
     public double getLength() {
         double length = 0;
-        
+
         for (Segment s : getSegments()) {
             length += s.getLength();
         }
-        
+
         return length;
     }
-    
+
     public Node getStart() {
         return getFirstSegment().getStart();
     }
-    
+
     public Node getEnd() {
         return getLastSegment().getEnd();
     }
-    
+
     public Segment getFirstSegment() {
         return getSegments().get(0);
     }
-    
+
     public Segment getLastSegment() {
         return getSegments().get(getSegments().size() - 1);
     }
-    
+
     public Route subRoute(int fromIndex, int toIndex) {
         return new Route(segments.subList(fromIndex, toIndex));
     }
-    
+
     public List<Way> getWays() {
         final List<Way> ws = new ArrayList<>();
-        
+
         for (Segment s : segments) {
             ws.add(s.getWay());
         }
-        
+
         return Collections.unmodifiableList(ws);
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -22,10 +23,10 @@
     static Set<Turn> load(ModelContainer c, String role, OsmPrimitive primitive) {
         final Set<Turn> result = new HashSet<>();
-        
+
         for (Relation r : OsmPrimitive.getFilteredList(primitive.getReferrers(), Relation.class)) {
             if (!r.isUsable() || !r.get("type").equals(Constants.TYPE_TURNS)) {
                 continue;
             }
-            
+
             for (RelationMember m : r.getMembers()) {
                 if (m.getRole().equals(role) && m.getMember().equals(primitive)) {
@@ -34,8 +35,8 @@
             }
         }
-        
-        return result;
-    }
-    
+
+        return result;
+    }
+
     static Set<Turn> load(ModelContainer c, Relation r) {
         for (RelationMember m : r.getMembers()) {
@@ -48,21 +49,21 @@
             }
         }
-        
+
         throw new IllegalArgumentException("No via node or way(s).");
     }
-    
+
     private static Set<Turn> loadWithViaWays(ModelContainer c, Relation r) {
         final Way from = Utils.getMemberWay(r, Constants.TURN_ROLE_FROM);
         final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
-        
+
         if (!c.hasRoad(from) || !c.hasRoad(to)) {
             return Collections.emptySet();
         }
-        
+
         final List<Way> tmp = Utils.getMemberWays(r, Constants.TURN_ROLE_VIA);
         final LinkedList<Road> via = new LinkedList<>();
-        
+
         final Road.End fromRoadEnd = c.getJunction(Utils.lineUp(from, tmp.get(0))).getRoadEnd(from);
-        
+
         Node n = fromRoadEnd.getJunction().getNode();
         final Iterator<Way> it = tmp.iterator();
@@ -72,21 +73,21 @@
                 return Collections.emptySet();
             }
-            
+
             final Road v = c.getRoad(w);
             via.add(v);
             n = Utils.getOppositeEnd(w, n);
-            
+
             if (!v.isPrimary()) {
                 throw new IllegalStateException("The road is not part of the junction.");
             }
-            
+
             final Iterator<Route.Segment> it2 = (v.getRoute().getFirstSegment().getWay().equals(w) ? v.getRoute()
                     .getSegments() : CollectionUtils.reverse(v.getRoute().getSegments())).iterator();
             it2.next(); // first is done
-            
+
             while (it2.hasNext()) {
                 final Way w2 = it2.next().getWay();
                 n = Utils.getOppositeEnd(w2, n);
-                
+
                 if (!it.hasNext() || !w2.equals(it.next())) {
                     throw new IllegalStateException("The via ways of the relation do not form a road.");
@@ -96,5 +97,5 @@
         final Road.End toRoadEnd = c.getJunction(n).getRoadEnd(to);
         n = Utils.getOppositeEnd(to, n);
-        
+
         final Set<Turn> result = new HashSet<>();
         for (int i : indices(r, Constants.TURN_KEY_LANES)) {
@@ -106,65 +107,65 @@
         return result;
     }
-    
+
     static List<Integer> indices(Relation r, String key) {
         final String joined = r.get(key);
-        
+
         if (joined == null) {
             return new ArrayList<>(1);
         }
-        
+
         final List<Integer> result = new ArrayList<>();
         for (String lane : Constants.SPLIT_PATTERN.split(joined)) {
             result.add(Integer.parseInt(lane));
         }
-        
-        return result;
-    }
-    
+
+        return result;
+    }
+
     private static Set<Turn> loadWithViaNode(ModelContainer c, Relation r) {
         final Way from = Utils.getMemberWay(r, Constants.TURN_ROLE_FROM);
         final Node via = Utils.getMemberNode(r, Constants.TURN_ROLE_VIA);
         final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
-        
+
         if (!c.hasRoad(from) || !c.hasJunction(via) || !c.hasRoad(to)) {
             return Collections.emptySet();
         }
-        
+
         final Junction j = c.getJunction(via);
-        
+
         final Road.End fromRoadEnd = j.getRoadEnd(from);
         final Road.End toRoadEnd = j.getRoadEnd(to);
-        
+
         final Set<Turn> result = new HashSet<>();
         for (int i : indices(r, Constants.TURN_KEY_LANES)) {
-            result.add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), Collections.<Road> emptyList(), toRoadEnd));
+            result.add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), Collections.<Road>emptyList(), toRoadEnd));
         }
         for (int i : indices(r, Constants.TURN_KEY_EXTRA_LANES)) {
-            result.add(new Turn(r, fromRoadEnd.getExtraLane(i), Collections.<Road> emptyList(), toRoadEnd));
-        }
-        return result;
-    }
-    
+            result.add(new Turn(r, fromRoadEnd.getExtraLane(i), Collections.<Road>emptyList(), toRoadEnd));
+        }
+        return result;
+    }
+
     static String join(List<Integer> list) {
         if (list.isEmpty()) {
             return null;
         }
-        
+
         final StringBuilder builder = new StringBuilder(list.size() * (2 + Constants.SEPARATOR.length()));
-        
+
         for (int e : list) {
             builder.append(e).append(Constants.SEPARATOR);
         }
-        
+
         builder.setLength(builder.length() - Constants.SEPARATOR.length());
         return builder.toString();
     }
-    
+
     private final Relation relation;
-    
+
     private final Lane from;
     private final List<Road> via;
     private final Road.End to;
-    
+
     public Turn(Relation relation, Lane from, List<Road> via, Road.End to) {
         this.relation = relation;
@@ -173,33 +174,33 @@
         this.to = to;
     }
-    
+
     public Lane getFrom() {
         return from;
     }
-    
+
     public List<Road> getVia() {
         return via;
     }
-    
+
     public Road.End getTo() {
         return to;
     }
-    
+
     Relation getRelation() {
         return relation;
     }
-    
+
     public void remove() {
         final GenericCommand cmd = new GenericCommand(relation.getDataSet(), tr("Delete turn."));
-        
+
         remove(cmd);
-        
+
         Main.main.undoRedo.add(cmd);
     }
-    
+
     void remove(GenericCommand cmd) {
         final List<Integer> lanes = indices(relation, Constants.TURN_KEY_LANES);
         final List<Integer> extraLanes = indices(relation, Constants.TURN_KEY_EXTRA_LANES);
-        
+
         // TODO understand & document
         if (lanes.size() + extraLanes.size() == 1 && (from.isExtra() ^ !lanes.isEmpty())) {
@@ -211,9 +212,9 @@
             lanes.remove(Integer.valueOf(from.getIndex()));
         }
-        
+
         cmd.backup(relation).put(Constants.TURN_KEY_LANES, lanes.isEmpty() ? null : join(lanes));
         cmd.backup(relation).put(Constants.TURN_KEY_EXTRA_LANES, extraLanes.isEmpty() ? null : join(extraLanes));
     }
-    
+
     void fixReferences(GenericCommand cmd, boolean left, int index) {
         final List<Integer> fixed = new ArrayList<>();
@@ -225,5 +226,5 @@
             }
         }
-        
+
         cmd.backup(relation).put(Constants.TURN_KEY_EXTRA_LANES, join(fixed));
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/UnexpectedDataException.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/UnexpectedDataException.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/UnexpectedDataException.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -7,5 +8,5 @@
 public final class UnexpectedDataException extends RuntimeException {
     private static final long serialVersionUID = 7430280313889494242L;
-    
+
     public enum Kind {
         NO_MEMBER("No member with role \"{0}\".", 1),
@@ -14,34 +15,34 @@
         INVALID_TAG_FORMAT("The tag \"{0}\" has an invalid format: {1}", 2),
         MISSING_TAG("The tag \"{0}\" is missing.", 1);
-        
+
         private final String message;
         private final int params;
-        
-        private Kind(String message, int params) {
+
+        Kind(String message, int params) {
             this.message = message;
             this.params = params;
         }
-        
+
         public UnexpectedDataException chuck(Object... args) {
             throw new UnexpectedDataException(this, format(args));
         }
-        
+
         public String format(Object... args) {
             if (args.length != params) {
                 throw new IllegalArgumentException("Wrong argument count for " + this + ": " + Arrays.toString(args));
             }
-            
+
             return tr(message, args);
         }
     }
-    
+
     private final Kind kind;
-    
+
     public UnexpectedDataException(Kind kind, String message) {
         super(message);
-        
+
         this.kind = kind;
     }
-    
+
     public Kind getKind() {
         return kind;
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Utils.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Utils.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Utils.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -19,17 +20,21 @@
 import org.openstreetmap.josm.plugins.turnlanes.CollectionUtils;
 
-public class Utils {
+public final class Utils {
     private static final Set<String> ROAD_HIGHWAY_VALUES = Collections.unmodifiableSet(new HashSet<>(Arrays
             .asList("motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary",
                     "secondary_link", "tertiary", "tertiary_link", "residential", "unclassified", "road", "living_street", "service",
                     "track", "pedestrian", "raceway", "services")));
-    
+
+    private Utils() {
+        // Hide default constructor for utilities classes
+    }
+
     public static boolean isRoad(Way w) {
         return ROAD_HIGHWAY_VALUES.contains(w.get("highway"));
     }
-    
-    public static final List<Way> filterRoads(List<OsmPrimitive> of) {
+
+    public static List<Way> filterRoads(List<OsmPrimitive> of) {
         final List<Way> result = new ArrayList<>();
-        
+
         for (OsmPrimitive p : of) {
             if (p.getType() == OsmPrimitiveType.WAY && Utils.isRoad((Way) p)) {
@@ -37,16 +42,16 @@
             }
         }
-        
-        return result;
-    }
-    
+
+        return result;
+    }
+
     public static Node getMemberNode(Relation r, String role) {
         return getMember(r, role, OsmPrimitiveType.NODE).getNode();
     }
-    
+
     public static Way getMemberWay(Relation r, String role) {
         return getMember(r, role, OsmPrimitiveType.WAY).getWay();
     }
-    
+
     public static RelationMember getMember(Relation r, String role, OsmPrimitiveType type) {
         final List<RelationMember> candidates = getMembers(r, role, type);
@@ -58,5 +63,5 @@
         return candidates.get(0);
     }
-    
+
     public static List<RelationMember> getMembers(Relation r, String role, OsmPrimitiveType type) {
         final List<RelationMember> result = getMembers(r, role);
@@ -68,5 +73,5 @@
         return result;
     }
-    
+
     public static List<RelationMember> getMembers(Relation r, String role) {
         final List<RelationMember> result = new ArrayList<>();
@@ -78,13 +83,13 @@
         return result;
     }
-    
+
     public static List<Node> getMemberNodes(Relation r, String role) {
         return mapMembers(getMembers(r, role, OsmPrimitiveType.NODE), Node.class);
     }
-    
+
     public static List<Way> getMemberWays(Relation r, String role) {
         return mapMembers(getMembers(r, role, OsmPrimitiveType.WAY), Way.class);
     }
-    
+
     private static <T> List<T> mapMembers(List<RelationMember> ms, Class<T> t) {
         final List<T> result = new ArrayList<>(ms.size());
@@ -94,9 +99,9 @@
         return result;
     }
-    
+
     /**
-     * 
-     * @param a
-     * @param b
+     *
+     * @param a first way
+     * @param b second way
      * @return the node at which {@code a} and {@code b} are connected
      */
@@ -108,5 +113,5 @@
             throw new IllegalArgumentException("Ways are not connected (at their first and last nodes).");
         }
-        
+
         if (a.firstNode() == b.firstNode() || a.lastNode() == b.firstNode()) {
             return b.firstNode();
@@ -117,9 +122,9 @@
         }
     }
-    
+
     public static Node getOppositeEnd(Way w, Node n) {
         final boolean first = n.equals(w.firstNode());
         final boolean last = n.equals(w.lastNode());
-        
+
         if (first && last) {
             throw new IllegalArgumentException("Way starts as well as ends at the given node.");
@@ -132,9 +137,9 @@
         }
     }
-    
+
     /**
      * Orders the {@code ways} such that the combined ways out of each returned list form a path (in
      * order) from one node out of {@code nodes} to another out of {@code nodes}.
-     * 
+     *
      * <ul>
      * <li>Each way is used exactly once.</li>
@@ -142,10 +147,10 @@
      * <li>Paths contain no loops w.r.t. the ways' first and last nodes</li>
      * </ul>
-     * 
+     *
      * @param ways
      *            ways to be ordered
      * @param nodes
      *            start/end nodes
-     * @return
+     * @return ordered list
      * @throws IllegalArgumentException
      *             if the ways can't be ordered
@@ -154,19 +159,19 @@
         final List<Way> ws = new LinkedList<>(CollectionUtils.toList(ways));
         final Set<Node> ns = new HashSet<>(CollectionUtils.toList(nodes));
-        
+
         final List<Route> result = new ArrayList<>();
-        
+
         while (!ws.isEmpty()) {
             result.add(findPath(ws, ns));
         }
-        
-        return result;
-    }
-    
+
+        return result;
+    }
+
     private static Route findPath(List<Way> ws, Set<Node> ns) {
         final Way w = findPathSegment(ws, ns);
         final boolean first = ns.contains(w.firstNode());
         final boolean last = ns.contains(w.lastNode());
-        
+
         if (first && last) {
             return Route.create(Arrays.asList(w), w.firstNode());
@@ -174,5 +179,5 @@
             throw new AssertionError();
         }
-        
+
         final List<Way> result = new ArrayList<>();
         result.add(w);
@@ -182,5 +187,5 @@
             result.add(next);
             n = getOppositeEnd(next, n);
-            
+
             if (ns.contains(n)) {
                 return Route.create(result, first ? w.firstNode() : w.lastNode());
@@ -188,11 +193,11 @@
         }
     }
-    
+
     private static Way findPathSegment(List<Way> ws, Collection<Node> ns) {
         final Iterator<Way> it = ws.iterator();
-        
+
         while (it.hasNext()) {
             final Way w = it.next();
-            
+
             if (ns.contains(w.firstNode()) || ns.contains(w.lastNode())) {
                 it.remove();
@@ -200,16 +205,16 @@
             }
         }
-        
+
         throw new IllegalArgumentException("Ways can't be ordered.");
     }
-    
+
     public static Iterable<Way> flattenVia(Node start, List<Road> via, Node end) {
         final List<Way> result = new ArrayList<>();
-        
+
         Node n = start;
         for (Road r : via) {
             final Iterable<Route.Segment> segments = r.getRoute().getFirstSegment().getWay().isFirstLastNode(n) ? r
                     .getRoute().getSegments() : CollectionUtils.reverse(r.getRoute().getSegments());
-            
+
             for (Route.Segment s : segments) {
                 result.add(s.getWay());
@@ -220,11 +225,11 @@
             throw new IllegalArgumentException("The given via ways don't end at the given node.");
         }
-        
-        return result;
-    }
-    
+
+        return result;
+    }
+
     public static int parseIntTag(OsmPrimitive primitive, String tag) {
         final String value = primitive.get(tag);
-        
+
         if (value != null) {
             try {
@@ -234,5 +239,5 @@
             }
         }
-        
+
         throw UnexpectedDataException.Kind.MISSING_TAG.chuck(tag);
     }
Index: applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java
===================================================================
--- applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java	(revision 33084)
+++ applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java	(revision 33085)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.turnlanes.model;
 
@@ -27,10 +28,10 @@
             final Node junction;
             final Way from;
-            
-            public Key(Node junction, Way from) {
+
+            Key(Node junction, Way from) {
                 this.junction = junction;
                 this.from = from;
             }
-            
+
             @Override
             public int hashCode() {
@@ -41,5 +42,5 @@
                 return result;
             }
-            
+
             @Override
             public boolean equals(Object obj) {
@@ -64,5 +65,5 @@
             }
         }
-        
+
         final Key key;
         private final int extraLeft;
@@ -70,6 +71,6 @@
         private final int extraRight;
         private final BitSet bitset;
-        
-        public IncomingLanes(Key key, int extraLeft, int regular, int extraRight) {
+
+        IncomingLanes(Key key, int extraLeft, int regular, int extraRight) {
             this.key = key;
             this.extraLeft = extraLeft;
@@ -78,5 +79,5 @@
             this.bitset = new BitSet(extraLeft + regular + extraRight);
         }
-        
+
         public boolean existsRegular(int l) {
             if (l > 0 && l <= regular) {
@@ -84,8 +85,8 @@
                 return true;
             }
-            
+
             return false;
         }
-        
+
         public boolean existsExtra(int l) {
             if (l < 0 && Math.abs(l) <= extraLeft) {
@@ -98,19 +99,19 @@
             return false;
         }
-        
+
         public int unreferenced() {
             return extraLeft + regular + extraRight - bitset.cardinality();
         }
     }
-    
+
     public List<Issue> validate(DataSet dataSet) {
         final List<Relation> lenghts = new ArrayList<>();
         final List<Relation> turns = new ArrayList<>();
-        
+
         for (Relation r : OsmPrimitive.getFilteredList(dataSet.allPrimitives(), Relation.class)) {
             if (!r.isUsable()) {
                 continue;
             }
-            
+
             final String type = r.get("type");
             if (Constants.TYPE_LENGTHS.equals(type)) {
@@ -120,11 +121,11 @@
             }
         }
-        
-        final List<Issue> issues = new ArrayList<>();
-        
+
+        final List<Issue> issues = new ArrayList<>();
+
         final Map<IncomingLanes.Key, IncomingLanes> incomingLanes = new HashMap<>();
         issues.addAll(validateLengths(lenghts, incomingLanes));
         issues.addAll(validateTurns(turns, incomingLanes));
-        
+
         for (IncomingLanes lanes : incomingLanes.values()) {
             if (lanes.unreferenced() > 0) {
@@ -133,32 +134,32 @@
             }
         }
-        
+
         return issues;
     }
-    
+
     private List<Issue> validateLengths(List<Relation> lenghts, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final List<Issue> issues = new ArrayList<>();
-        
+
         for (Relation r : lenghts) {
             issues.addAll(validateLengths(r, incomingLanes));
         }
-        
+
         return issues;
     }
-    
+
     private List<Issue> validateLengths(Relation r, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final List<Issue> issues = new ArrayList<>();
-        
+
         try {
             final Node end = Utils.getMemberNode(r, Constants.LENGTHS_ROLE_END);
             final Route route = validateLengthsWays(r, end, issues);
-            
+
             if (route == null) {
                 return issues;
             }
-            
+
             final List<Double> left = Lane.loadLengths(r, Constants.LENGTHS_KEY_LENGTHS_LEFT, 0);
             final List<Double> right = Lane.loadLengths(r, Constants.LENGTHS_KEY_LENGTHS_RIGHT, 0);
-            
+
             int tooLong = 0;
             for (Double l : left) {
@@ -172,14 +173,14 @@
                 }
             }
-            
+
             if (tooLong > 0) {
                 issues.add(Issue.newError(r, end, "The lengths-relation specifies " + tooLong
                         + " extra-lanes which are longer than its ways."));
             }
-            
+
             putIncomingLanes(route, left, right, incomingLanes);
-            
+
             return issues;
-            
+
         } catch (UnexpectedDataException e) {
             issues.add(Issue.newError(r, e.getMessage()));
@@ -187,14 +188,14 @@
         }
     }
-    
+
     private void putIncomingLanes(Route route, List<Double> left, List<Double> right,
             Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final Node end = route.getLastSegment().getEnd();
         final Way way = route.getLastSegment().getWay();
-        
+
         final IncomingLanes.Key key = new IncomingLanes.Key(end, way);
         final IncomingLanes lanes = new IncomingLanes(key, left.size(), Lane.getRegularCount(way, end), right.size());
         final IncomingLanes old = incomingLanes.put(key, lanes);
-        
+
         if (old != null) {
             incomingLanes.put(
@@ -204,8 +205,8 @@
         }
     }
-    
+
     private Route validateLengthsWays(Relation r, Node end, List<Issue> issues) {
         final List<Way> ways = Utils.getMemberWays(r, Constants.LENGTHS_ROLE_WAYS);
-        
+
         if (ways.isEmpty()) {
             issues.add(Issue.newError(r, "A lengths-relation requires at least one member-way with role \""
@@ -213,5 +214,5 @@
             return null;
         }
-        
+
         Node current = end;
         for (Way w : ways) {
@@ -219,16 +220,16 @@
                 return orderWays(r, ways, current, issues, "ways", "lengths");
             }
-            
+
             current = Utils.getOppositeEnd(w, current);
         }
-        
+
         return Route.create(ways, end);
     }
-    
+
     private Route orderWays(final Relation r, List<Way> ways, Node end, List<Issue> issues, String role, String type) {
         final List<Way> unordered = new ArrayList<>(ways);
         final List<Way> ordered = new ArrayList<>(ways.size());
         final Set<Node> ends = new HashSet<>(); // to find cycles
-        
+
         Node current = end;
         findNext: while (!unordered.isEmpty()) {
@@ -238,9 +239,9 @@
                 return null;
             }
-            
+
             Iterator<Way> it = unordered.iterator();
             while (it.hasNext()) {
                 final Way w = it.next();
-                
+
                 if (w.isFirstLastNode(current)) {
                     it.remove();
@@ -250,9 +251,9 @@
                 }
             }
-            
+
             issues.add(Issue.newError(r, ways, "The " + role + " of the " + type + "-relation are disconnected."));
             return null;
         }
-        
+
         final QuickFix quickFix = new QuickFix(tr("Put the ways in order.")) {
             @Override
@@ -260,40 +261,40 @@
                 for (int i = r.getMembersCount() - 1; i >= 0; --i) {
                     final RelationMember m = r.getMember(i);
-                    
+
                     if (m.isWay() && Constants.LENGTHS_ROLE_WAYS.equals(m.getRole())) {
                         r.removeMember(i);
                     }
                 }
-                
+
                 for (Way w : ordered) {
                     r.addMember(new RelationMember(Constants.LENGTHS_ROLE_WAYS, w));
                 }
-                
+
                 return true;
             }
         };
-        
+
         issues.add(Issue.newError(r, ways, "The ways of the lengths-relation are unordered.", quickFix));
-        
+
         return Route.create(ordered, end);
     }
-    
+
     private List<Issue> validateTurns(List<Relation> turns, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final List<Issue> issues = new ArrayList<>();
-        
+
         for (Relation r : turns) {
             issues.addAll(validateTurns(r, incomingLanes));
         }
-        
+
         return issues;
     }
-    
+
     private List<Issue> validateTurns(Relation r, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
         final List<Issue> issues = new ArrayList<>();
-        
+
         try {
             final Way from = Utils.getMemberWay(r, Constants.TURN_ROLE_FROM);
             final Way to = Utils.getMemberWay(r, Constants.TURN_ROLE_TO);
-            
+
             if (from.firstNode().equals(from.lastNode())) {
                 issues.add(Issue.newError(r, from, "The from-way both starts as well as ends at the via-node."));
@@ -305,5 +306,5 @@
                 return issues;
             }
-            
+
             final Node fromJunctionNode;
             final List<RelationMember> viaMembers = Utils.getMembers(r, Constants.TURN_ROLE_VIA);
@@ -312,5 +313,5 @@
             } else if (viaMembers.get(0).isWay()) {
                 final List<Way> vias = Utils.getMemberWays(r, Constants.TURN_ROLE_VIA);
-                
+
                 fromJunctionNode = Utils.lineUp(from, vias.get(0));
                 Node current = fromJunctionNode;
@@ -320,10 +321,10 @@
                         break;
                     }
-                    
+
                     current = Utils.getOppositeEnd(via, current);
                 }
             } else {
                 final Node via = Utils.getMemberNode(r, Constants.TURN_ROLE_VIA);
-                
+
                 if (!from.isFirstLastNode(via)) {
                     issues.add(Issue.newError(r, from, "The from-way does not start or end at the via-node."));
@@ -332,13 +333,13 @@
                     issues.add(Issue.newError(r, to, "The to-way does not start or end at the via-node."));
                 }
-                
+
                 fromJunctionNode = via;
             }
-            
+
             if (!issues.isEmpty()) {
                 return issues;
             }
             final IncomingLanes lanes = get(incomingLanes, fromJunctionNode, from);
-            
+
             for (int l : splitInts(r, Constants.TURN_KEY_LANES, issues)) {
                 if (!lanes.existsRegular(l)) {
@@ -346,5 +347,5 @@
                 }
             }
-            
+
             for (int l : splitInts(r, Constants.TURN_KEY_EXTRA_LANES, issues)) {
                 if (!lanes.existsExtra(l)) {
@@ -352,5 +353,5 @@
                 }
             }
-            
+
             return issues;
         } catch (UnexpectedDataException e) {
@@ -359,14 +360,14 @@
         }
     }
-    
+
     private List<Integer> splitInts(Relation r, String key, List<Issue> issues) {
         final String ints = r.get(key);
-        
+
         if (ints == null) {
             return Collections.emptyList();
         }
-        
+
         final List<Integer> result = new ArrayList<>();
-        
+
         for (String s : Constants.SPLIT_PATTERN.split(ints)) {
             try {
@@ -377,12 +378,12 @@
             }
         }
-        
+
         return result;
     }
-    
+
     private IncomingLanes get(Map<IncomingLanes.Key, IncomingLanes> incomingLanes, Node via, Way from) {
         final IncomingLanes.Key key = new IncomingLanes.Key(via, from);
         final IncomingLanes lanes = incomingLanes.get(key);
-        
+
         if (lanes == null) {
             final IncomingLanes newLanes = new IncomingLanes(key, 0, Lane.getRegularCount(from, via), 0);
