Index: /applications/editors/josm/plugins/lakewalker/.checkstyle
===================================================================
--- /applications/editors/josm/plugins/lakewalker/.checkstyle	(revision 32676)
+++ /applications/editors/josm/plugins/lakewalker/.checkstyle	(revision 32676)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: /applications/editors/josm/plugins/lakewalker/.project
===================================================================
--- /applications/editors/josm/plugins/lakewalker/.project	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/.project	(revision 32676)
@@ -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/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/BooleanConfigurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/BooleanConfigurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/BooleanConfigurer.java	(revision 32676)
@@ -1,21 +1,8 @@
-/*
- * $Id: BooleanConfigurer.java 705 2005-09-15 13:24:50 +0000 (Thu, 15 Sep 2005) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
+
+import java.awt.Component;
+
+import javax.swing.JCheckBox;
 
 /**
@@ -23,5 +10,5 @@
  */
 public class BooleanConfigurer extends Configurer {
-    private javax.swing.JCheckBox box;
+    private JCheckBox box;
 
     public BooleanConfigurer() {
@@ -73,5 +60,5 @@
 
     @Override
-    public java.awt.Component getControls() {
+    public Component getControls() {
         if (box == null) {
             box = new javax.swing.JCheckBox(getName());
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Configurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Configurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Configurer.java	(revision 32676)
@@ -1,20 +1,3 @@
-/*
- * $Id: Configurer.java 2175 2007-06-04 04:19:59 +0000 (Mon, 04 Jun 2007) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/DoubleConfigurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/DoubleConfigurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/DoubleConfigurer.java	(revision 32676)
@@ -1,20 +1,3 @@
-/*
- * $Id: DoubleConfigurer.java 5 2003-10-02 15:11:38 +0000 (Thu, 02 Oct 2003) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -41,6 +24,5 @@
         try {
             d = Double.valueOf(s);
-        }
-        catch (NumberFormatException e) {
+        } catch (NumberFormatException e) {
             d = null;
         }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/IntConfigurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/IntConfigurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/IntConfigurer.java	(revision 32676)
@@ -1,20 +1,3 @@
-/*
- * $Id: IntConfigurer.java 874 2006-03-15 14:20:56 +0000 (Wed, 15 Mar 2006) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -44,6 +27,5 @@
         try {
             i = Integer.valueOf(s);
-        }
-        catch (NumberFormatException e) {
+        } catch (NumberFormatException e) {
             i = null;
         }
@@ -55,7 +37,6 @@
     public int getIntValue(int defaultValue) {
         if (getValue() instanceof Integer) {
-            return ((Integer)getValue()).intValue();
-        }
-        else {
+            return ((Integer) getValue()).intValue();
+        } else {
             return defaultValue;
         }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -18,11 +19,11 @@
     private String wmslayer;
 
-    private int[] dirslat = new int[] {0,1,1,1,0,-1,-1,-1};
-    private int[] dirslon = new int[] {1,1,0,-1,-1,-1,0,1};
+    private int[] dirslat = new int[] {0, 1, 1, 1, 0, -1, -1, -1};
+    private int[] dirslon = new int[] {1, 1, 0, -1, -1, -1, 0, 1};
 
     double start_radius_big = 0.001;
     double start_radius_small = 0.0002;
 
-    public Lakewalker(int waylen, int maxnode, int threshold, double epsilon, int resolution, int tilesize, String startdir, String wmslayer){
+    public Lakewalker(int waylen, int maxnode, int threshold, double epsilon, int resolution, int tilesize, String startdir, String wmslayer) {
         this.maxnode = maxnode;
         this.threshold = threshold;
@@ -43,24 +44,24 @@
      *  southeast = 7
      */
-    private int getDirectionIndex(String direction) throws ArrayIndexOutOfBoundsException{
-        int i=0;
-        if(direction.equals("East") || direction.equals("east")){
+    private int getDirectionIndex(String direction) throws ArrayIndexOutOfBoundsException {
+        int i = 0;
+        if (direction.equals("East") || direction.equals("east")) {
             i = 0;
-        } else if(direction.equals("Northeast") || direction.equals("northeast")){
-            i =  1;
-        } else if(direction.equals("North") || direction.equals("north")){
-            i =  2;
-        } else if(direction.equals("Northwest") || direction.equals("northwest")){
-            i =  3;
-        } else if(direction.equals("West") || direction.equals("west")){
-            i =  4;
-        } else if(direction.equals("Southwest") || direction.equals("southwest")){
-            i =  5;
-        } else if(direction.equals("South") || direction.equals("south")){
-            i =  6;
-        } else if(direction.equals("Southeast") || direction.equals("southeast")){
-            i =  7;
+        } else if (direction.equals("Northeast") || direction.equals("northeast")) {
+            i = 1;
+        } else if (direction.equals("North") || direction.equals("north")) {
+            i = 2;
+        } else if (direction.equals("Northwest") || direction.equals("northwest")) {
+            i = 3;
+        } else if (direction.equals("West") || direction.equals("west")) {
+            i = 4;
+        } else if (direction.equals("Southwest") || direction.equals("southwest")) {
+            i = 5;
+        } else if (direction.equals("South") || direction.equals("south")) {
+            i = 6;
+        } else if (direction.equals("Southeast") || direction.equals("southeast")) {
+            i = 7;
         } else {
-            throw new ArrayIndexOutOfBoundsException(tr("Direction index ''{0}'' not found",direction));
+            throw new ArrayIndexOutOfBoundsException(tr("Direction index ''{0}'' not found", direction));
         }
         return i;
@@ -69,13 +70,7 @@
     /**
      * Do a trace
-     *
-     * @param lat
-     * @param lon
-     * @param tl_lon
-     * @param br_lon
-     * @param tl_lat
-     * @param br_lat
-     */
-    public ArrayList<double[]> trace(double lat, double lon, double tl_lon, double br_lon, double tl_lat, double br_lat, ProgressMonitor progressMonitor) throws LakewalkerException {
+     */
+    public ArrayList<double[]> trace(double lat, double lon, double tl_lon, double br_lon, double tl_lat, double br_lat,
+            ProgressMonitor progressMonitor) throws LakewalkerException {
 
         progressMonitor.beginTask(null);
@@ -84,5 +79,5 @@
 
             LakewalkerWMS wms = new LakewalkerWMS(this.resolution, this.tilesize, this.wmslayer);
-            LakewalkerBBox bbox = new LakewalkerBBox(tl_lat,tl_lon,br_lat,br_lon);
+            LakewalkerBBox bbox = new LakewalkerBBox(tl_lat, tl_lon, br_lat, br_lon);
 
             Boolean detect_loop = false;
@@ -90,7 +85,7 @@
             ArrayList<double[]> nodelist = new ArrayList<>();
 
-            int[] xy = geo_to_xy(lat,lon,this.resolution);
-
-            if(!bbox.contains(lat, lon)){
+            int[] xy = geo_to_xy(lat, lon, this.resolution);
+
+            if (!bbox.contains(lat, lon)) {
                 throw new LakewalkerException(tr("The starting location was not within the bbox"));
             }
@@ -100,12 +95,12 @@
             progressMonitor.indeterminateSubTask(tr("Looking for shoreline..."));
 
-            while(true){
-                double[] geo = xy_to_geo(xy[0],xy[1],this.resolution);
-                if(bbox.contains(geo[0],geo[1])==false){
+            while (true) {
+                double[] geo = xy_to_geo(xy[0], xy[1], this.resolution);
+                if (bbox.contains(geo[0], geo[1]) == false) {
                     break;
                 }
 
                 v = wms.getPixel(xy[0], xy[1], progressMonitor.createSubTaskMonitor(0, false));
-                if(v > this.threshold){
+                if (v > this.threshold) {
                     break;
                 }
@@ -116,9 +111,8 @@
                 xy[0] = xy[0]+delta_lon;
                 xy[1] = xy[1]+delta_lat;
-
             }
 
             int[] startxy = new int[] {xy[0], xy[1]};
-            double[] startgeo = xy_to_geo(xy[0],xy[1],this.resolution);
+            double[] startgeo = xy_to_geo(xy[0], xy[1], this.resolution);
 
             //System.out.printf("Found shore at lat %.4f lon %.4f\n",lat,lon);
@@ -126,9 +120,9 @@
             int last_dir = this.getDirectionIndex(this.startdir);
 
-            for(int i = 0; i < this.maxnode; i++){
+            for (int i = 0; i < this.maxnode; i++) {
 
                 // Print a counter
-                if(i % 250 == 0){
-                    progressMonitor.indeterminateSubTask(tr("{0} nodes so far...",i));
+                if (i % 250 == 0) {
+                    progressMonitor.indeterminateSubTask(tr("{0} nodes so far...", i));
                     //System.out.println(i+" nodes so far...");
                 }
@@ -136,10 +130,10 @@
                 // Some variables we need
                 int d;
-                int test_x=0;
-                int test_y=0;
+                int test_x = 0;
+                int test_y = 0;
                 int new_dir = 0;
 
                 // Loop through all the directions we can go
-                for(d = 1; d <= this.dirslat.length; d++){
+                for (d = 1; d <= this.dirslat.length; d++) {
 
                     // Decide which direction we want to look at from this pixel
@@ -149,7 +143,7 @@
                     test_y = xy[1] + this.dirslat[new_dir];
 
-                    double[] geo = xy_to_geo(test_x,test_y,this.resolution);
-
-                    if(!bbox.contains(geo[0], geo[1])){
+                    double[] geo = xy_to_geo(test_x, test_y, this.resolution);
+
+                    if (!bbox.contains(geo[0], geo[1])) {
                         System.out.println("Outside bbox");
                         break;
@@ -157,9 +151,9 @@
 
                     v = wms.getPixel(test_x, test_y, progressMonitor.createSubTaskMonitor(0, false));
-                    if(v > this.threshold){
+                    if (v > this.threshold) {
                         break;
                     }
 
-                    if(d == this.dirslat.length-1){
+                    if (d == this.dirslat.length-1) {
                         System.out.println("Got stuck");
                         break;
@@ -175,23 +169,23 @@
 
                 // Break the loop if we managed to get back to our starting point
-                if(xy[0] == startxy[0] && xy[1] == startxy[1]){
+                if (xy[0] == startxy[0] && xy[1] == startxy[1]) {
                     break;
                 }
 
                 // Store this node
-                double[] geo = xy_to_geo(xy[0],xy[1],this.resolution);
+                double[] geo = xy_to_geo(xy[0], xy[1], this.resolution);
                 nodelist.add(geo);
                 //System.out.println("Adding node at "+xy[0]+","+xy[1]+" ("+geo[1]+","+geo[0]+")");
 
                 // Check if we got stuck in a loop
-                double start_proximity = Math.pow((geo[0] - startgeo[0]),2) + Math.pow((geo[1] - startgeo[1]),2);
-
-                if(detect_loop){
-                    if(start_proximity < Math.pow(start_radius_small,2)){
+                double start_proximity = Math.pow((geo[0] - startgeo[0]), 2) + Math.pow((geo[1] - startgeo[1]), 2);
+
+                if (detect_loop) {
+                    if (start_proximity < Math.pow(start_radius_small, 2)) {
                         System.out.println("Detected loop");
                         break;
                     }
-                }else{
-                    if(start_proximity > Math.pow(start_radius_big,2)){
+                } else {
+                    if (start_proximity > Math.pow(start_radius_big, 2)) {
                         detect_loop = true;
                     }
@@ -207,20 +201,17 @@
     /**
      * Remove duplicate nodes from the list
-     *
-     * @param nodes
-     * @return
-     */
-    public ArrayList<double[]> duplicateNodeRemove(ArrayList<double[]> nodes){
-
-        if(nodes.size() <= 1){
+     */
+    public ArrayList<double[]> duplicateNodeRemove(ArrayList<double[]> nodes) {
+
+        if (nodes.size() <= 1) {
             return nodes;
         }
 
-        double lastnode[] = new double[] {nodes.get(0)[0], nodes.get(0)[1]};
-
-        for(int i = 1; i < nodes.size(); i++){
+        double[] lastnode = new double[] {nodes.get(0)[0], nodes.get(0)[1]};
+
+        for (int i = 1; i < nodes.size(); i++) {
             double[] thisnode = new double[] {nodes.get(i)[0], nodes.get(i)[1]};
 
-            if(thisnode[0] == lastnode[0] && thisnode[1] == lastnode[1]){
+            if (thisnode[0] == lastnode[0] && thisnode[1] == lastnode[1]) {
                 // Remove the node
                 nodes.remove(i);
@@ -237,13 +228,9 @@
     /**
      * Reduce the number of vertices based on their proximity to each other
-     *
-     * @param nodes
-     * @param proximity
-     * @return
-     */
-    public ArrayList<double[]> vertexReduce(ArrayList<double[]> nodes, double proximity){
+     */
+    public ArrayList<double[]> vertexReduce(ArrayList<double[]> nodes, double proximity) {
 
         // Check if node list is empty
-        if(nodes.size()<=1){
+        if (nodes.size() <= 1) {
             return nodes;
         }
@@ -254,6 +241,6 @@
         double prox_sq = Math.pow(proximity, 2);
 
-        for(int v = 0; v < nodes.size(); v++){
-            if(Math.pow(nodes.get(v)[0] - test_v[0],2) + Math.pow(nodes.get(v)[1] - test_v[1],2) > prox_sq){
+        for (int v = 0; v < nodes.size(); v++) {
+            if (Math.pow(nodes.get(v)[0] - test_v[0], 2) + Math.pow(nodes.get(v)[1] - test_v[1], 2) > prox_sq) {
                 reducednodes.add(nodes.get(v));
                 test_v = nodes.get(v);
@@ -264,5 +251,5 @@
     }
 
-    public double pointLineDistance(double[] p1, double[] p2, double[] p3){
+    public double pointLineDistance(double[] p1, double[] p2, double[] p3) {
 
         double x0 = p1[0];
@@ -273,23 +260,23 @@
         double y2 = p3[1];
 
-        if(x2 == x1 && y2 == y1){
-            return Math.sqrt(Math.pow(x1-x0,2) + Math.pow(y1-y0,2));
+        if (x2 == x1 && y2 == y1) {
+            return Math.sqrt(Math.pow(x1-x0, 2) + Math.pow(y1-y0, 2));
         } else {
-            return Math.abs((x2-x1)*(y1-y0) - (x1-x0)*(y2-y1)) / Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));
+            return Math.abs((x2-x1)*(y1-y0) - (x1-x0)*(y2-y1)) / Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2));
         }
     }
 
         /*
-    public ArrayList<double[]> douglasPeuckerNR(ArrayList<double[]> nodes, double epsilon){
+    public ArrayList<double[]> douglasPeuckerNR(ArrayList<double[]> nodes, double epsilon) {
         command_stack = [(0, len(nodes) - 1)]
 
         Vector result_stack = new Vector();
 
-        while(command_stack.size() > 0){
+        while (command_stack.size() > 0) {
             cmd = command_stack.pop();
-            if(type(cmd) == tuple){
+            if (type(cmd) == tuple) {
                 (start, end) = cmd
                 (node, dist) = dp_findpoint(nodes, start, end)
-                if(dist > epsilon){
+                if (dist > epsilon) {
                     command_stack.append("+")
                     command_stack.append((start, node))
@@ -298,8 +285,8 @@
                     result_stack.append((start, end))
                 }
-            } elseif(cmd == "+"){
+            } elseif (cmd == "+") {
                 first = result_stack.pop()
                 second = result_stack.pop()
-                if(first[-1] == second[0]){
+                if (first[-1] == second[0]) {
                     result_stack.append(first + second[1:])
                     //print "Added %s and %s; result is %s" % (first, second, result_stack[-1])
@@ -314,5 +301,5 @@
                 return
 
-        if(len(result_stack) == 1){
+        if (len(result_stack) == 1) {
             return [nodes[x] for x in result_stack[0]];
         } else {
@@ -326,12 +313,12 @@
         last = nodes[-1]
 
-        for(i in xrange(1, len(nodes) - 1){
+        for (i in xrange(1, len(nodes) - 1) {
             d = point_line_distance(nodes[i], first, last)
-            if(d > farthest_dist){
+            if (d > farthest_dist) {
                 farthest_dist = d
                 farthest_node = i
             }
         }
-        if(farthest_dist > epsilon){
+        if (farthest_dist > epsilon) {
             seg_a = douglas_peucker(nodes[0:farthest_node+1], epsilon)
             seg_b = douglas_peucker(nodes[farthest_node:-1], epsilon)
@@ -345,8 +332,8 @@
         */
 
-    public ArrayList<double[]> douglasPeucker(ArrayList<double[]> nodes, double epsilon, int depth){
+    public ArrayList<double[]> douglasPeucker(ArrayList<double[]> nodes, double epsilon, int depth) {
 
         // Check if node list is empty
-        if(nodes.size()<=1 || depth > 500){
+        if (nodes.size() <= 1 || depth > 500) {
             return nodes;
         }
@@ -361,7 +348,7 @@
         double d = 0;
 
-        for(int i = 1; i < nodes.size(); i++){
-            d = pointLineDistance(nodes.get(i),first,last);
-            if(d>farthest_dist){
+        for (int i = 1; i < nodes.size(); i++) {
+            d = pointLineDistance(nodes.get(i), first, last);
+            if (d > farthest_dist) {
                 farthest_dist = d;
                 farthest_node = i;
@@ -372,7 +359,7 @@
         List<double[]> seg_b;
 
-        if(farthest_dist > epsilon){
-            seg_a = douglasPeucker(sublist(nodes,0,farthest_node+1),epsilon, depth+1);
-            seg_b = douglasPeucker(sublist(nodes,farthest_node,nodes.size()-1),epsilon,depth+1);
+        if (farthest_dist > epsilon) {
+            seg_a = douglasPeucker(sublist(nodes, 0, farthest_node+1), epsilon, depth+1);
+            seg_b = douglasPeucker(sublist(nodes, farthest_node, nodes.size()-1), epsilon, depth+1);
 
             new_nodes.addAll(seg_a);
@@ -388,9 +375,9 @@
         ArrayList<double[]> sub = new ArrayList<>();
 
-        if(f<i || i < 0 || f < 0 || f > l.size()){
+        if (f < i || i < 0 || f < 0 || f > l.size()) {
             throw new ArrayIndexOutOfBoundsException();
         }
 
-        for(int j = i; j < f; j++){
+        for (int j = i; j < f; j++) {
             sub.add(l.get(j));
         }
@@ -398,5 +385,5 @@
     }
 
-    public double[] xy_to_geo(int x, int y, double resolution){
+    public double[] xy_to_geo(int x, int y, double resolution) {
         double[] geo = new double[2];
         geo[0] = y / resolution;
@@ -405,9 +392,9 @@
     }
 
-    public int[] geo_to_xy(double lat, double lon, double resolution){
+    public int[] geo_to_xy(double lat, double lon, double resolution) {
         int[] xy = new int[2];
 
-        xy[0] = (int)Math.floor(lon * resolution + 0.5);
-        xy[1] = (int)Math.floor(lat * resolution + 0.5);
+        xy[0] = (int) Math.floor(lon * resolution + 0.5);
+        xy[1] = (int) Math.floor(lat * resolution + 0.5);
 
         return xy;
@@ -433,5 +420,5 @@
         private double right = 180;
 
-        protected LakewalkerBBox(double top, double left, double bottom, double right){
+        protected LakewalkerBBox(double top, double left, double bottom, double right) {
           this.left = left;
           this.right = right;
@@ -440,12 +427,12 @@
         }
 
-        protected Boolean contains(double lat, double lon){
-          if(lat >= this.top || lat <= this.bottom){
+        protected Boolean contains(double lat, double lon) {
+          if (lat >= this.top || lat <= this.bottom) {
             return false;
           }
-          if(lon >= this.right || lon <= this.left){
+          if (lon >= this.right || lon <= this.left) {
               return false;
           }
-          if((this.right - this.left) % 360 == 0){
+          if ((this.right - this.left) % 360 == 0) {
             return true;
           }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -49,5 +50,5 @@
     protected Collection<Way> ways = new ArrayList<>();
 
-    public LakewalkerAction(String name) {
+    LakewalkerAction(String name) {
         super(name, "lakewalker-sml", tr("Lake Walker."),
         Shortcut.registerShortcut("tools:lakewalker", tr("Tool: {0}", tr("Lake Walker")),
@@ -58,5 +59,5 @@
 
     public void actionPerformed(ActionEvent e) {
-        if(Main.map == null || Main.map.mapView == null || active)
+        if (Main.map == null || Main.map.mapView == null || active)
             return;
 
@@ -79,10 +80,10 @@
 
             if (wmsCacheDir.exists() && wmsCacheDir.isDirectory()) {
-                File wmsCache[] = wmsCacheDir.listFiles();
+                File[] wmsCache = wmsCacheDir.listFiles();
 
                 // sort files by date (most recent first)
                 Arrays.sort(wmsCache, new Comparator<File>() {
                     public int compare(File f1, File f2) {
-                        return (int)(f2.lastModified()-f1.lastModified());
+                        return (int) (f2.lastModified()-f1.lastModified());
                     }
                 });
@@ -110,5 +111,5 @@
                 if (!wmsCacheDir.mkdirs()) {
                     JOptionPane.showMessageDialog(Main.parent,
-                    		tr("Error creating cache directory: {0}", wmsCacheDir.getPath()));
+                            tr("Error creating cache directory: {0}", wmsCacheDir.getPath()));
                 }
             }
@@ -116,5 +117,5 @@
     }
 
-    protected void lakewalk(Point clickPoint){
+    protected void lakewalk(Point clickPoint) {
         // Positional data
         final LatLon pos = Main.map.mapView.getLatLon(clickPoint.x, clickPoint.y);
@@ -136,12 +137,13 @@
 
         try {
-            PleaseWaitRunnable lakewalkerTask = new PleaseWaitRunnable(tr("Tracing")){
+            PleaseWaitRunnable lakewalkerTask = new PleaseWaitRunnable(tr("Tracing")) {
                 @Override protected void realRun() throws SAXException {
                     progressMonitor.subTask(tr("checking cache..."));
                     cleanupCache();
                     processnodelist(pos, topLeft, botRight, waylen, maxnode, threshold,
-                            epsilon,resolution,tilesize,startdir,wmslayer,
+                            epsilon, resolution, tilesize, startdir, wmslayer,
                             progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
                 }
+
                 @Override protected void finish() {
                 }
@@ -153,6 +155,5 @@
             Thread executeThread = new Thread(lakewalkerTask);
             executeThread.start();
-        }
-        catch (Exception ex) {
+        } catch (Exception ex) {
           System.out.println("Exception caught: " + ex.getMessage());
         }
@@ -160,14 +161,14 @@
 
     private void processnodelist(LatLon pos, LatLon topLeft, LatLon botRight, int waylen, int maxnode, int threshold,
-    		double epsilon, int resolution, int tilesize, String startdir, String wmslayer, ProgressMonitor progressMonitor){
+            double epsilon, int resolution, int tilesize, String startdir, String wmslayer, ProgressMonitor progressMonitor) {
         progressMonitor.beginTask(null, 3);
         try {
             ArrayList<double[]> nodelist = new ArrayList<>();
 
-            Lakewalker lw = new Lakewalker(waylen,maxnode,threshold,epsilon,resolution,tilesize,startdir,wmslayer);
+            Lakewalker lw = new Lakewalker(waylen, maxnode, threshold, epsilon, resolution, tilesize, startdir, wmslayer);
             try {
-                nodelist = lw.trace(pos.lat(),pos.lon(),topLeft.lon(),botRight.lon(),topLeft.lat(),botRight.lat(),
+                nodelist = lw.trace(pos.lat(), pos.lon(), topLeft.lon(), botRight.lon(), topLeft.lat(), botRight.lat(),
                         progressMonitor.createSubTaskMonitor(1, false));
-            } catch(LakewalkerException e){
+            } catch (LakewalkerException e) {
                 System.out.println(e.getMessage());
             }
@@ -226,5 +227,5 @@
             int nodesinway = 0;
 
-            for(int i = 0; i< nodelist.size(); i++){
+            for (int i = 0; i < nodelist.size(); i++) {
                 if (cancel) {
                     return;
@@ -234,5 +235,5 @@
                     LatLon ll = new LatLon(nodelist.get(i)[0]+northOffset, nodelist.get(i)[1]+eastOffset);
                     n = new Node(ll);
-                    if(fn==null){
+                    if (fn == null) {
                         fn = n;
                     }
@@ -245,9 +246,9 @@
                 way.addNode(n);
 
-                if(nodesinway > Main.pref.getInteger(LakewalkerPreferences.PREF_MAX_SEG, 500)){
+                if (nodesinway > Main.pref.getInteger(LakewalkerPreferences.PREF_MAX_SEG, 500)) {
                     String waytype = Main.pref.get(LakewalkerPreferences.PREF_WAYTYPE, "water");
 
-                    if(!waytype.equals("none")){
-                        way.put("natural",waytype);
+                    if (!waytype.equals("none")) {
+                        way.put("natural", waytype);
                     }
 
@@ -267,6 +268,6 @@
             String waytype = Main.pref.get(LakewalkerPreferences.PREF_WAYTYPE, "water");
 
-            if(!waytype.equals("none")){
-                way.put("natural",waytype);
+            if (!waytype.equals("none")) {
+                way.put("natural", waytype);
             }
 
@@ -296,6 +297,5 @@
 
     public void mouseClicked(MouseEvent e) {
-        if(active)
-        {
+        if (active) {
             active = false;
             Main.map.mapView.removeMouseListener(this);
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerException.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerException.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerException.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -4,9 +5,9 @@
 
 class LakewalkerException extends Exception {
-    public LakewalkerException(){
+    LakewalkerException() {
         super(tr("An unknown error has occurred"));
     }
 
-    public LakewalkerException(String err){
+    LakewalkerException(String err) {
         super(err);
     }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -28,5 +29,5 @@
 
     public static File getLakewalkerCacheDir() {
-    	return new File(Main.pref.getCacheDirectory(), "lakewalkerwms");
+        return new File(Main.pref.getCacheDirectory(), "lakewalkerwms");
     }
 }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -109,6 +110,6 @@
 
     public void buildPreferences(JPanel prefPanel) {
-        GBC labelConstraints = GBC.std().insets(10,5,5,0);
-        GBC dataConstraints = GBC.eol().insets(0,5,0,0).fill(GridBagConstraints.HORIZONTAL);
+        GBC labelConstraints = GBC.std().insets(10, 5, 5, 0);
+        GBC dataConstraints = GBC.eol().insets(0, 5, 0, 0).fill(GridBagConstraints.HORIZONTAL);
 
         prefPanel.add(maxSegsLabel, labelConstraints);
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 32676)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -31,5 +32,5 @@
     private List<BufferedImage> images = new Vector<>();
     // Hashmap to hold the mapping of cached images
-    private Map<String,Integer> imageindex = new HashMap<>();
+    private Map<String, Integer> imageindex = new HashMap<>();
 
     private int resolution;
@@ -38,5 +39,5 @@
     private String wmslayer;
 
-    public LakewalkerWMS(int resolution, int tilesize, String wmslayer){
+    public LakewalkerWMS(int resolution, int tilesize, String wmslayer) {
         this.resolution = resolution;
         this.tilesize = tilesize;
@@ -50,6 +51,6 @@
 
             int[] bottom_left_xy = new int[2];
-            bottom_left_xy[0] = floor(x,this.tilesize);
-            bottom_left_xy[1] = floor(y,this.tilesize);
+            bottom_left_xy[0] = floor(x, this.tilesize);
+            bottom_left_xy[1] = floor(y, this.tilesize);
 
             int[] top_right_xy = new int[2];
@@ -57,6 +58,6 @@
             top_right_xy[1] = bottom_left_xy[1] + this.tilesize;
 
-            double[] topright_geo = xy_to_geo(top_right_xy[0],top_right_xy[1],this.resolution);
-            double[] bottomleft_geo = xy_to_geo(bottom_left_xy[0],bottom_left_xy[1],this.resolution);
+            double[] topright_geo = xy_to_geo(top_right_xy[0], top_right_xy[1], this.resolution);
+            double[] bottomleft_geo = xy_to_geo(bottom_left_xy[0], bottom_left_xy[1], this.resolution);
 
             String filename = this.wmslayer+"/landsat_"+this.resolution+"_"+this.tilesize+
@@ -66,5 +67,5 @@
             // to convert to a locale that uses that to build the proper URL
             NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH);
-            DecimalFormat df = (DecimalFormat)nf;
+            DecimalFormat df = (DecimalFormat) nf;
             df.applyLocalizedPattern("0.000000");
 
@@ -81,9 +82,9 @@
 
             // See if this image is already loaded
-            if(this.image != null){
-                if(this.imagex != bottom_left_xy[0] || this.imagey != bottom_left_xy[1]){
+            if (this.image != null) {
+                if (this.imagex != bottom_left_xy[0] || this.imagey != bottom_left_xy[1]) {
 
                     // Check if this image exists in the hashmap
-                    if(this.imageindex.containsKey(hashkey)){
+                    if (this.imageindex.containsKey(hashkey)) {
                         // Store which image we have
                         this.imagex = bottom_left_xy[0];
@@ -108,15 +109,15 @@
 
                 this.images.add(this.image);
-                this.imageindex.put(hashkey,this.images.size()-1);
-
-            } catch(FileNotFoundException e){
+                this.imageindex.put(hashkey, this.images.size()-1);
+
+            } catch (FileNotFoundException e) {
                 System.out.println("Could not find cached image, downloading.");
-            } catch(IOException e){
+            } catch (IOException e) {
                 System.out.println(e.getMessage());
-            } catch(Exception e){
+            } catch (Exception e) {
                 System.out.println(e.getMessage());
             }
 
-            if(this.image == null){
+            if (this.image == null) {
                 /**
                  * Try downloading the image
@@ -128,9 +129,9 @@
                     URL url = new URL(urlloc);
                     this.image = ImageIO.read(url); // this can return null!
-                } catch(MalformedURLException e){
+                } catch (MalformedURLException e) {
                     System.out.println(e.getMessage());
-                } catch(IOException e){
+                } catch (IOException e) {
                     System.out.println(e.getMessage());
-                } catch(Exception e){
+                } catch (Exception e) {
                     System.out.println(e.getMessage());
                 }
@@ -138,7 +139,7 @@
                 if (this.image != null) {
                     this.images.add(this.image);
-                    this.imageindex.put(hashkey,this.images.size()-1);
-
-                    this.saveimage(file,this.image);
+                    this.imageindex.put(hashkey, this.images.size()-1);
+
+                    this.saveimage(file, this.image);
                 }
             }
@@ -147,5 +148,5 @@
             this.imagey = bottom_left_xy[1];
 
-            if(this.image == null){
+            if (this.image == null) {
                 throw new LakewalkerException(tr("Could not acquire image"));
             }
@@ -157,5 +158,5 @@
     }
 
-    public void saveimage(File file, BufferedImage image){
+    public void saveimage(File file, BufferedImage image) {
         /**
          * Save the image to the cache
@@ -164,10 +165,10 @@
             ImageIO.write(image, "png", file);
             System.out.println("Saved image to cache");
-        } catch(Exception e){
+        } catch (Exception e) {
             System.out.println(e.getMessage());
         }
     }
 
-    public int getPixel(int x, int y, ProgressMonitor progressMonitor) throws LakewalkerException{
+    public int getPixel(int x, int y, ProgressMonitor progressMonitor) throws LakewalkerException {
         // Get the previously shown text
 
@@ -176,12 +177,12 @@
 
         try {
-            image = this.getTile(x,y, progressMonitor);
-        } catch(LakewalkerException e){
+            image = this.getTile(x, y, progressMonitor);
+        } catch (LakewalkerException e) {
             System.out.println(e.getMessage());
             throw e;
         }
 
-        int tx = floor(x,this.tilesize);
-        int ty = floor(y,this.tilesize);
+        int tx = floor(x, this.tilesize);
+        int ty = floor(y, this.tilesize);
 
         int pixel_x = (x-tx);
@@ -190,20 +191,20 @@
         //System.out.println("("+x+","+y+") maps to ("+pixel_x+","+pixel_y+") by ("+tx+", "+ty+")");
 
-        int rgb = image.getRGB(pixel_x,pixel_y);
+        int rgb = image.getRGB(pixel_x, pixel_y);
 
         int pixel;
 
         int r = (rgb >> 16) & 0xff;
-        int g = (rgb >>  8) & 0xff;
-        int b = (rgb >>  0) & 0xff;
-
-        pixel = (int)((0.30 * r) + (0.59 * b) + (0.11 * g));
+        int g = (rgb >> 8) & 0xff;
+        int b = (rgb >> 0) & 0xff;
+
+        pixel = (int) ((0.30 * r) + (0.59 * b) + (0.11 * g));
 
         return pixel;
     }
 
-    public int floor(int num, int precision){
-        double dnum = num/(double)precision;
-        BigDecimal val = new BigDecimal(dnum) ;
+    public int floor(int num, int precision) {
+        double dnum = num/(double) precision;
+        BigDecimal val = new BigDecimal(dnum);
         val = val.setScale(0, BigDecimal.ROUND_FLOOR);
         return val.intValue()*precision;
@@ -211,10 +212,10 @@
 
     public double floor(double num) {
-        BigDecimal val = new BigDecimal(num) ;
+        BigDecimal val = new BigDecimal(num);
         val = val.setScale(0, BigDecimal.ROUND_FLOOR);
-        return val.doubleValue() ;
-    }
-
-    public double[] xy_to_geo(int x, int y, double resolution){
+        return val.doubleValue();
+    }
+
+    public double[] xy_to_geo(int x, int y, double resolution) {
         double[] geo = new double[2];
         geo[0] = y / resolution;
@@ -223,9 +224,9 @@
     }
 
-    public int[] geo_to_xy(double lat, double lon, double resolution){
+    public int[] geo_to_xy(double lat, double lon, double resolution) {
         int[] xy = new int[2];
 
-        xy[0] = (int)Math.floor(lon * resolution + 0.5);
-        xy[1] = (int)Math.floor(lat * resolution + 0.5);
+        xy[0] = (int) Math.floor(lon * resolution + 0.5);
+        xy[1] = (int) Math.floor(lat * resolution + 0.5);
 
         return xy;
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringConfigurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringConfigurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringConfigurer.java	(revision 32676)
@@ -1,20 +1,3 @@
-/*
- * $Id: StringConfigurer.java 2073 2007-05-10 14:34:31 +0000 (Thu, 10 May 2007) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -66,6 +49,5 @@
       p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
       p.add(new JLabel(getName()));
-      nameField.setMaximumSize
-        (new java.awt.Dimension(nameField.getMaximumSize().width,
+      nameField.setMaximumSize(new java.awt.Dimension(nameField.getMaximumSize().width,
                                 nameField.getPreferredSize().height));
       nameField.setText(getValueString());
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringEnumConfigurer.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringEnumConfigurer.java	(revision 32675)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringEnumConfigurer.java	(revision 32676)
@@ -1,28 +1,3 @@
-/*
- * $Id: StringEnumConfigurer.java 2472 2007-10-01 04:10:19 +0000 (Mon, 01 Oct 2007) rodneykinney $
- *
- * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License (LGPL) as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, copies are available
- * at http://www.opensource.org.
- */
-/*
- * Created by IntelliJ IDEA.
- * User: rkinney
- * Date: Jul 20, 2002
- * Time: 3:52:36 AM
- * To change template for new class use
- * Code Style | Class Templates options (Tools | IDE Options).
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.lakewalker;
 
@@ -52,6 +27,7 @@
         this.validValues = validValues;
         transValues = new String[validValues.length];
-        for(int i = 0; i < validValues.length; ++i)
+        for (int i = 0; i < validValues.length; ++i) {
             transValues[i] = tr(validValues[i]);
+        }
     }
 
@@ -63,4 +39,5 @@
         tooltipText = s;
     }
+
     @Override
     public Component getControls() {
@@ -70,5 +47,5 @@
             box = new JComboBox<>(transValues);
             box.setToolTipText(tooltipText);
-            box.setMaximumSize(new Dimension(box.getMaximumSize().width,box.getPreferredSize().height));
+            box.setMaximumSize(new Dimension(box.getMaximumSize().width, box.getPreferredSize().height));
             setValue(value);
             box.addActionListener(new ActionListener() {
@@ -86,9 +63,9 @@
     @Override
     public void setValue(Object o) {
-        if(o == null)
+        if (o == null)
             o = 0;
         super.setValue(o);
-        if(!noUpdate && box != null)
-            box.setSelectedIndex((Integer)o);
+        if (!noUpdate && box != null)
+            box.setSelectedIndex((Integer) o);
     }
 
@@ -96,7 +73,6 @@
     public void setValue(String s) {
         Integer n = 0;
-        for (int i = 0; i < transValues.length; ++i)
-        {
-            if (transValues[i].equals(s) || validValues[i].equals(s)){
+        for (int i = 0; i < transValues.length; ++i) {
+            if (transValues[i].equals(s) || validValues[i].equals(s)) {
                 n = i;
                 break;
@@ -108,5 +84,5 @@
     @Override
     public String getValueString() {
-        return validValues[(Integer)value];
+        return validValues[(Integer) value];
     }
 }
