Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 3671)
@@ -136,7 +136,8 @@
         // FIXME: this should become an asynchronous task
         //
-        for(UploadHook hook : uploadHooks)
-            if(!hook.checkUpload(apiData))
+        for (UploadHook hook : uploadHooks) {
+            if (!hook.checkUpload(apiData))
                 return false;
+        }
 
         return true;
Index: trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ValidateAction.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/actions/ValidateAction.java	(revision 3671)
@@ -34,4 +34,5 @@
  */
 public class ValidateAction extends JosmAction {
+    
     /** Serializable ID */
     private static final long serialVersionUID = -2304521273582574603L;
@@ -84,8 +85,9 @@
             }
         } else {
-            if (lastSelection == null)
+            if (lastSelection == null) {
                 selection = Main.main.getCurrentDataSet().allNonDeletedPrimitives();
-            else
+            } else {
                 selection = lastSelection;
+            }
         }
 
@@ -104,5 +106,4 @@
      *
      */
-
     class ValidationTask extends PleaseWaitRunnable {
         private Collection<Test> tests;
@@ -137,4 +138,5 @@
             //
             Runnable r = new Runnable()  {
+                @Override
                 public void run() {
                     Main.map.validatorDialog.tree.setErrors(errors);
@@ -153,10 +155,12 @@
         protected void realRun() throws SAXException, IOException,
                 OsmTransferException {
-            if (tests == null || tests.isEmpty()) return;
+            if (tests == null || tests.isEmpty())
+                return;
             errors = new ArrayList<TestError>(200);
             getProgressMonitor().setTicksCount(tests.size() * validatedPrimitmives.size());
             int testCounter = 0;
             for (Test test : tests) {
-                if (canceled) return;
+                if (canceled)
+                    return;
                 testCounter++;
                 getProgressMonitor().setCustomText(tr("Test {0}/{1}: Starting {2}", testCounter, tests.size(),test.getName()));
Index: trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 3671)
@@ -41,6 +41,6 @@
      * Validate the modified data before uploading
      */
-    public boolean checkUpload(APIDataSet apiDataSet)
-    {
+    public boolean checkUpload(APIDataSet apiDataSet) {
+
         Collection<Test> tests = OsmValidator.getEnabledTests(true);
         if (tests.isEmpty())
@@ -52,6 +52,5 @@
 
         List<TestError> errors = new ArrayList<TestError>(30);
-        for(Test test : tests)
-        {
+        for (Test test : tests) {
             test.setBeforeUpload(true);
             test.setPartialSelection(true);
@@ -59,39 +58,36 @@
             test.visit(selection);
             test.endTest();
-            if(Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false))
+            if (Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false)) {
                 errors.addAll( test.getErrors() );
-            else
-            {
-                for(TestError e : test.getErrors())
-                {
-                    if(e.getSeverity() != Severity.OTHER)
+            }
+            else {
+                for (TestError e : test.getErrors()) {
+                    if (e.getSeverity() != Severity.OTHER) {
                         errors.add(e);
+                    }
                 }
             }
         }
         tests = null;
-        if(errors == null || errors.isEmpty())
+        if (errors == null || errors.isEmpty())
             return true;
 
-        if(Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true))
-        {
+        if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) {
             int nume = 0;
-            for(TestError error : errors)
-            {
+            for (TestError error : errors) {
                 List<String> s = new ArrayList<String>();
                 s.add(error.getIgnoreState());
                 s.add(error.getIgnoreGroup());
                 s.add(error.getIgnoreSubGroup());
-                for(String state : s)
-                {
-                    if(state != null && OsmValidator.hasIgnoredError(state))
-                    {
+                for (String state : s) {
+                    if (state != null && OsmValidator.hasIgnoredError(state)) {
                         error.setIgnored(true);
                     }
                 }
-                if(!error.getIgnored())
+                if (!error.getIgnored()) {
                     ++nume;
+                }
             }
-            if(nume == 0)
+            if (nume == 0)
                 return true;
         }
@@ -106,6 +102,5 @@
      *          if the user requested cancel.
      */
-    private boolean displayErrorScreen(List<TestError> errors)
-    {
+    private boolean displayErrorScreen(List<TestError> errors) {
         JPanel p = new JPanel(new GridBagLayout());
         ValidatorTreePanel errorPanel = new ValidatorTreePanel(errors);
@@ -113,8 +108,9 @@
         p.add(new JScrollPane(errorPanel), GBC.eol());
 
-        int res  = JOptionPane.showConfirmDialog(Main.parent, p,
-        tr("Data with errors. Upload anyway?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
-        if(res == JOptionPane.NO_OPTION)
-        {
+        int res = JOptionPane.showConfirmDialog(Main.parent, p,
+            tr("Data with errors. Upload anyway?"),
+            JOptionPane.YES_NO_OPTION,
+            JOptionPane.QUESTION_MESSAGE);
+        if (res == JOptionPane.NO_OPTION) {
             OsmValidator.initializeErrorLayer();
             Main.map.validatorDialog.unfurlDialog();
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 3671)
@@ -47,5 +47,4 @@
 import org.openstreetmap.josm.data.validation.tests.WronglyOrderedWays;
 import org.openstreetmap.josm.data.validation.util.ValUtil;
-import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog;
@@ -115,7 +114,8 @@
     private void checkPluginDir() {
         try {
-        File pathDir = new File(ValUtil.getPluginDir());
-        if (!pathDir.exists())
-            pathDir.mkdirs();
+            File pathDir = new File(ValUtil.getPluginDir());
+            if (!pathDir.exists()) {
+                pathDir.mkdirs();
+            }
         } catch (Exception e){
             e.printStackTrace();
@@ -150,6 +150,7 @@
         try {
             final PrintWriter out = new PrintWriter(new FileWriter(ValUtil.getPluginDir() + "ignorederrors"), false);
-            for (String e : ignoredErrors)
+            for (String e : ignoredErrors) {
                 out.println(e);
+            }
             out.close();
         } catch (final IOException e) {
@@ -221,6 +222,7 @@
         Collection<Test> enabledTests = getTests();
         for (Test t : new ArrayList<Test>(enabledTests)) {
-            if (beforeUpload ? t.testBeforeUpload : t.enabled)
+            if (beforeUpload ? t.testBeforeUpload : t.enabled) {
                 continue;
+            }
             enabledTests.remove(t);
         }
@@ -243,10 +245,11 @@
      */
     public void initializeGridDetail() {
-        if (Main.proj.toString().equals(new Epsg4326().toString()))
+        if (Main.proj.toString().equals(new Epsg4326().toString())) {
             OsmValidator.griddetail = 10000;
-        else if (Main.proj.toString().equals(new Mercator().toString()))
+        } else if (Main.proj.toString().equals(new Mercator().toString())) {
             OsmValidator.griddetail = 100000;
-        else if (Main.proj.toString().equals(new Lambert().toString()))
+        } else if (Main.proj.toString().equals(new Lambert().toString())) {
             OsmValidator.griddetail = 0.1;
+        }
     }
 
@@ -275,8 +278,13 @@
     /* interface LayerChangeListener                                              */
     /* -------------------------------------------------------------------------- */
-    public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
-
-    public void layerAdded(Layer newLayer) {}
-
+    @Override
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+    }
+
+    @Override
+    public void layerAdded(Layer newLayer) {
+    }
+
+    @Override
     public void layerRemoved(Layer oldLayer) {
         if (oldLayer instanceof OsmDataLayer && Main.map.mapView.getActiveLayer() == oldLayer) {
Index: trunk/src/org/openstreetmap/josm/data/validation/Severity.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/Severity.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/Severity.java	(revision 3671)
@@ -34,6 +34,5 @@
      * @param color The color of this severity
      */
-    Severity(String message, String icon, Color color)
-    {
+    Severity(String message, String icon, Color color) {
         this.message = message;
         this.icon = icon;
@@ -42,6 +41,5 @@
 
     @Override
-    public String toString()
-    {
+    public String toString() {
         return message;
     }
@@ -51,6 +49,5 @@
      * @return the associated icon
      */
-    public String getIcon()
-    {
+    public String getIcon() {
         return icon;
     }
@@ -60,6 +57,5 @@
      * @return The associated color
      */
-    public Color getColor()
-    {
+    public Color getColor() {
         return color;
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/Test.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 3671)
@@ -67,6 +67,5 @@
      * @param description Description of the test
      */
-    public Test(String name, String description)
-    {
+    public Test(String name, String description) {
         this.name = name;
         this.description = description;
@@ -77,6 +76,5 @@
      * @param name Name of the test
      */
-    public Test(String name)
-    {
+    public Test(String name) {
         this(name, null);
     }
@@ -86,5 +84,6 @@
      * @throws Exception When cannot initialize the test
      */
-    public void initialize() throws Exception {}
+    public void initialize() throws Exception {
+    }
 
     /**
@@ -95,7 +94,7 @@
     public void startTest(ProgressMonitor progressMonitor) {
         if (progressMonitor == null) {
-                this.progressMonitor = NullProgressMonitor.INSTANCE;
+            this.progressMonitor = NullProgressMonitor.INSTANCE;
         } else {
-                this.progressMonitor = progressMonitor;
+            this.progressMonitor = progressMonitor;
         }
         this.progressMonitor.beginTask(tr("Running test {0}", name));
@@ -107,6 +106,5 @@
      * @param partialSelection Whether the test is on a partial selection data
      */
-    public void setPartialSelection(boolean partialSelection)
-    {
+    public void setPartialSelection(boolean partialSelection) {
         this.partialSelection = partialSelection;
     }
@@ -116,6 +114,5 @@
      * @return The list of errors
      */
-    public List<TestError> getErrors()
-    {
+    public List<TestError> getErrors() {
         return errors;
     }
@@ -136,18 +133,21 @@
      * @param selection The primitives to be tested
      */
-    public void visit(Collection<OsmPrimitive> selection)
-    {
+    public void visit(Collection<OsmPrimitive> selection) {
         progressMonitor.setTicksCount(selection.size());
         for (OsmPrimitive p : selection) {
-            if( p.isUsable() )
+            if (p.isUsable()) {
                 p.visit(this);
+            }
             progressMonitor.worked(1);
         }
     }
 
+    @Override
     public void visit(Node n) {}
 
+    @Override
     public void visit(Way w) {}
 
+    @Override
     public void visit(Relation r) {}
 
@@ -156,6 +156,5 @@
      * @param testPanel The panel to add any preferences component
      */
-    public void addGui(JPanel testPanel)
-    {
+    public void addGui(JPanel testPanel) {
         checkEnabled = new JCheckBox(name, enabled);
         checkEnabled.setToolTipText(description);
@@ -172,6 +171,5 @@
      * Called when the used submits the preferences
      */
-    public boolean ok()
-    {
+    public boolean ok() {
         enabled = checkEnabled.isSelected();
         testBeforeUpload = checkBeforeUpload.isSelected();
@@ -180,11 +178,10 @@
 
     /**
-     * Fixes the error with the appropiate command
+     * Fixes the error with the appropriate command
      *
      * @param testError
      * @return The command to fix the error
      */
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
         return null;
     }
@@ -196,6 +193,5 @@
      * @return true if the error can be fixed
      */
-    public boolean isFixable(TestError testError)
-    {
+    public boolean isFixable(TestError testError) {
         return false;
     }
@@ -205,6 +201,5 @@
      * @return true if this plugin must check the uploaded data before uploading
      */
-    public boolean testBeforeUpload()
-    {
+    public boolean testBeforeUpload() {
         return testBeforeUpload;
     }
@@ -214,6 +209,5 @@
      * @param isUpload if true, the test is before upload
      */
-    public void setBeforeUpload(boolean isUpload)
-    {
+    public void setBeforeUpload(boolean isUpload) {
         this.isBeforeUpload = isUpload;
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/TestError.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/TestError.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/TestError.java	(revision 3671)
@@ -157,10 +157,11 @@
                 return null;
             String type = "u";
-            if (o instanceof Way)
+            if (o instanceof Way) {
                 type = "w";
-            else if (o instanceof Relation)
+            } else if (o instanceof Relation) {
                 type = "r";
-            else if (o instanceof Node)
+            } else if (o instanceof Node) {
                 type = "n";
+            }
             strings.add(type + "_" + o.getId());
         }
@@ -173,6 +174,7 @@
     public String getIgnoreSubGroup() {
         String ignorestring = getIgnoreGroup();
-        if (description_en != null)
+        if (description_en != null) {
             ignorestring += "_" + description_en;
+        }
         return ignorestring;
     }
@@ -216,5 +218,5 @@
 
     /**
-     * Fixes the error with the appropiate command
+     * Fixes the error with the appropriate command
      *
      * @return The command to fix the error
@@ -243,9 +245,9 @@
     public void visitHighlighted(ValidatorVisitor v) {
         for (Object o : highlighted) {
-            if (o instanceof OsmPrimitive)
+            if (o instanceof OsmPrimitive) {
                 v.visit((OsmPrimitive) o);
-            else if (o instanceof WaySegment)
+            } else if (o instanceof WaySegment) {
                 v.visit((WaySegment) o);
-            else if (o instanceof List<?>) {
+            } else if (o instanceof List<?>) {
                 v.visit((List<Node>)o);
             }
@@ -273,4 +275,5 @@
         }
 
+        @Override
         public void visit(OsmPrimitive p) {
             if (p.isUsable()) {
@@ -289,6 +292,7 @@
             if (selected) {
                 g.fillOval(p.x - 5, p.y - 5, 10, 10);
-            } else
+            } else {
                 g.drawOval(p.x - 5, p.y - 5, 10, 10);
+            }
         }
 
@@ -301,16 +305,16 @@
             int deg = (int) Math.toDegrees(t);
             if (selected) {
-                int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT), (int) (p2.x - 5 * cosT),
-                        (int) (p1.x - 5 * cosT) };
-                int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT), (int) (p2.y + 5 * sinT),
-                        (int) (p1.y + 5 * sinT) };
+                int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT),
+                                      (int) (p2.x - 5 * cosT), (int) (p1.x - 5 * cosT) };
+                int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT),
+                                      (int) (p2.y + 5 * sinT), (int) (p1.y + 5 * sinT) };
                 g.fillPolygon(x, y, 4);
                 g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180);
                 g.fillArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180);
             } else {
-                g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT), (int) (p2.x + 5 * cosT),
-                        (int) (p2.y - 5 * sinT));
-                g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT), (int) (p2.x - 5 * cosT),
-                        (int) (p2.y + 5 * sinT));
+                g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT),
+                           (int) (p2.x + 5 * cosT), (int) (p2.y - 5 * sinT));
+                g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT),
+                           (int) (p2.x - 5 * cosT), (int) (p2.y + 5 * sinT));
                 g.drawArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180);
                 g.drawArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180);
@@ -334,13 +338,17 @@
          * @param n The node to draw.
          */
+        @Override
         public void visit(Node n) {
-            if (isNodeVisible(n))
+            if (isNodeVisible(n)) {
                 drawNode(n, severity.getColor());
-        }
-
+            }
+        }
+
+        @Override
         public void visit(Way w) {
             visit(w.getNodes());
         }
 
+        @Override
         public void visit(WaySegment ws) {
             if (ws.lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount())
@@ -352,4 +360,5 @@
         }
 
+        @Override
         public void visit(Relation r) {
             /* No idea how to draw a relation. */
@@ -387,4 +396,5 @@
         }
 
+        @Override
         public void visit(List<Node> nodes) {
             Node lastN = null;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/ChangePropertyKeyCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/ChangePropertyKeyCommand.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/ChangePropertyKeyCommand.java	(revision 3671)
@@ -50,9 +50,10 @@
     }
 
-    @Override public boolean executeCommand() {
-        if (!super.executeCommand()) return false; // save old
+    @Override
+    public boolean executeCommand() {
+        if (!super.executeCommand())
+            return false; // save old
         for (OsmPrimitive osm : objects) {
-            if(osm.hasKeys())
-            {
+            if (osm.hasKeys()) {
                 osm.setModified(true);
                 String oldValue = osm.get(key);
@@ -64,9 +65,11 @@
     }
 
-    @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
+    @Override
+    public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
         modified.addAll(objects);
     }
 
-    @Override public JLabel getDescription() {
+    @Override
+    public JLabel getDescription() {
         String text = tr( "Replace \"{0}\" by \"{1}\" for", key, newKey);
         if (objects.size() == 1) {
@@ -74,10 +77,12 @@
             objects.iterator().next().visit(v);
             text += " "+tr(v.className)+" "+v.name;
-        } else
+        } else {
             text += " "+objects.size()+" "+trn("object","objects",objects.size());
+        }
         return new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL);
     }
 
-    @Override public Collection<PseudoCommand> getChildren() {
+    @Override
+    public Collection<PseudoCommand> getChildren() {
         if (objects.size() == 1)
             return null;
@@ -88,8 +93,10 @@
             osm.visit(v);
             children.add(new PseudoCommand() {
-                @Override public JLabel getDescription() {
+                @Override
+                public JLabel getDescription() {
                     return v.toLabel();
                 }
-                @Override public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
+                @Override
+                public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
                     return Collections.singleton(osm);
                 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(revision 3671)
@@ -28,6 +28,6 @@
  * @author Teemu Koskinen
  */
-public class Coastlines extends Test
-{
+public class Coastlines extends Test {
+
     protected static int UNORDERED_COASTLINE = 901;
     protected static int REVERSED_COASTLINE = 902;
@@ -41,6 +41,5 @@
      * Constructor
      */
-    public Coastlines()
-    {
+    public Coastlines() {
         super(tr("Coastlines."),
               tr("This test checks that coastlines are correct."));
@@ -48,12 +47,13 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
+
         super.startTest(monitor);
 
         OsmDataLayer layer = Main.map.mapView.getEditLayer();
 
-        if (layer != null)
+        if (layer != null) {
             downloadedArea = layer.data.getDataSourceArea();
+        }
 
         coastlines = new LinkedList<Way>();
@@ -61,12 +61,12 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         for (Way c1 : coastlines) {
             Node head = c1.firstNode();
             Node tail = c1.lastNode();
 
-            if (head.equals(tail))
+            if (head.equals(tail)) {
                 continue;
+            }
 
             int headWays = 0;
@@ -80,6 +80,7 @@
 
             for (Way c2 : coastlines) {
-                if (c1 == c2)
+                if (c1 == c2) {
                     continue;
+                }
 
                 if (c2.containsNode(head)) {
@@ -87,8 +88,9 @@
                     next = c2;
 
-                    if (head.equals(c2.firstNode()))
+                    if (head.equals(c2.firstNode())) {
                         headReversed = true;
-                    else if (!head.equals(c2.lastNode()))
+                    } else if (!head.equals(c2.lastNode())) {
                         headUnordered = true;
+                    }
                 }
 
@@ -97,11 +99,11 @@
                     prev = c2;
 
-                    if (tail.equals(c2.lastNode()))
+                    if (tail.equals(c2.lastNode())) {
                         tailReversed = true;
-                    else if (!tail.equals(c2.firstNode()))
+                    } else if (!tail.equals(c2.firstNode())) {
                         tailUnordered = true;
-                }
-            }
-
+                    }
+                }
+            }
 
             List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
@@ -121,7 +123,8 @@
                 }
 
-                if (highlight.size() > 0)
+                if (highlight.size() > 0) {
                     errors.add(new TestError(this, Severity.ERROR, tr("Unconnected coastline"),
                                              UNCONNECTED_COASTLINE, primitives, highlight));
+                }
             }
 
@@ -129,13 +132,15 @@
             boolean reversed = false;
 
-            if (headWays == 1 && headReversed && tailWays == 1 && tailReversed)
+            if (headWays == 1 && headReversed && tailWays == 1 && tailReversed) {
                 reversed = true;
-
-            if (headWays > 1 || tailWays > 1)
+            }
+
+            if (headWays > 1 || tailWays > 1) {
                 unordered = true;
-            else if (headUnordered || tailUnordered)
+            } else if (headUnordered || tailUnordered) {
                 unordered = true;
-            else if (reversed && next == prev)
+            } else if (reversed && next == prev) {
                 unordered = true;
+            }
 
             if (unordered) {
@@ -168,6 +173,5 @@
 
     @Override
-    public void visit(Way way)
-    {
+    public void visit(Way way) {
         if (!way.isUsable())
             return;
@@ -192,5 +196,4 @@
             return new ChangeCommand(way, newWay);
         }
-
         return null;
     }
@@ -198,7 +201,6 @@
     @Override
     public boolean isFixable(TestError testError) {
-        if (testError.getTester() instanceof Coastlines) {
+        if (testError.getTester() instanceof Coastlines)
             return (testError.getCode() == REVERSED_COASTLINE);
-        }
 
         return false;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 3671)
@@ -28,6 +28,5 @@
  * @author frsantos
  */
-public class CrossingWays extends Test
-{
+public class CrossingWays extends Test {
     protected static int CROSSING_WAYS = 601;
 
@@ -39,18 +38,14 @@
     Map<List<Way>, List<WaySegment>> ways_seen;
 
-
     /**
      * Constructor
      */
-    public CrossingWays()
-    {
+    public CrossingWays() {
         super(tr("Crossing ways."),
               tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node."));
     }
 
-
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         cellSegments = new HashMap<Point2D,List<ExtendedSegment>>(1000);
@@ -60,6 +55,5 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         super.endTest();
         cellSegments = null;
@@ -69,7 +63,6 @@
 
     @Override
-    public void visit(Way w)
-    {
-        if( !w.isUsable() )
+    public void visit(Way w) {
+        if(!w.isUsable())
             return;
 
@@ -81,5 +74,7 @@
         boolean isBuilding = (w.get("building") != null);
 
-        if( w.get("highway") == null && w.get("waterway") == null && (railway1 == null || isSubway1 || isTram1)  && !isCoastline1 && !isBuilding)
+        if (w.get("highway") == null && w.get("waterway") == null
+                && (railway1 == null || isSubway1 || isTram1)
+                && !isCoastline1 && !isBuilding)
             return;
 
@@ -91,8 +86,6 @@
             ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, coastline1);
             List<List<ExtendedSegment>> cellSegments = getSegments(es1.n1, es1.n2);
-            for( List<ExtendedSegment> segments : cellSegments)
-            {
-                for( ExtendedSegment es2 : segments)
-                {
+            for (List<ExtendedSegment> segments : cellSegments) {
+                for (ExtendedSegment es2 : segments) {
                     List<Way> prims;
                     List<WaySegment> highlight;
@@ -107,16 +100,16 @@
                         continue;
 
-                    if( !es1.intersects(es2) ) continue;
-                    if( isSubway1 && "subway".equals(railway2)) continue;
-                    if( isTram1 && "tram".equals(railway2)) continue;
+                    if (!es1.intersects(es2) ) continue;
+                    if (isSubway1 && "subway".equals(railway2)) continue;
+                    if (isTram1 && "tram".equals(railway2)) continue;
 
                     boolean isCoastline2 = coastline2 != null && (coastline2.equals("water") || coastline2.equals("coastline"));
-                    if( isCoastline1 != isCoastline2 ) continue;
-
-                    if((es1.railway != null && es1.railway.equals("abandoned")) || (railway2 != null && railway2.equals("abandoned"))) continue;
+                    if (isCoastline1 != isCoastline2) continue;
+
+                    if ((es1.railway != null && es1.railway.equals("abandoned"))
+                            || (railway2 != null && railway2.equals("abandoned"))) continue;
 
                     prims = Arrays.asList(es1.ws.way, es2.ws.way);
-                    if ((highlight = ways_seen.get(prims)) == null)
-                    {
+                    if ((highlight = ways_seen.get(prims)) == null) {
                         highlight = new ArrayList<WaySegment>();
                         highlight.add(es1.ws);
@@ -124,9 +117,10 @@
 
                         errors.add(new TestError(this, Severity.WARNING,
-                        isBuilding ? tr("Crossing buildings") : tr("Crossing ways"), CROSSING_WAYS, prims, highlight));
+                            isBuilding ? tr("Crossing buildings") : tr("Crossing ways"),
+                            CROSSING_WAYS,
+                            prims,
+                            highlight));
                         ways_seen.put(prims, highlight);
-                    }
-                    else
-                    {
+                    } else {
                         highlight.add(es1.ws);
                         highlight.add(es2.ws);
@@ -146,12 +140,10 @@
     * @return A list with all the cells the segment crosses
     */
-    public List<List<ExtendedSegment>> getSegments(Node n1, Node n2)
-    {
+    public List<List<ExtendedSegment>> getSegments(Node n1, Node n2) {
+
         List<List<ExtendedSegment>> cells = new ArrayList<List<ExtendedSegment>>();
-        for( Point2D cell : ValUtil.getSegmentCells(n1, n2, OsmValidator.griddetail) )
-        {
-            List<ExtendedSegment> segments = cellSegments.get( cell );
-            if( segments == null )
-            {
+        for(Point2D cell : ValUtil.getSegmentCells(n1, n2, OsmValidator.griddetail)) {
+            List<ExtendedSegment> segments = cellSegments.get(cell);
+            if (segments == null) {
                 segments = new ArrayList<ExtendedSegment>();
                 cellSegments.put(cell, segments);
@@ -159,5 +151,4 @@
             cells.add(segments);
         }
-
         return cells;
     }
@@ -167,6 +158,5 @@
      * @author frsantos
      */
-    private static class ExtendedSegment
-    {
+    public static class ExtendedSegment {
         public Node n1, n2;
 
@@ -187,8 +177,7 @@
          * @param layer The layer of the way this segment is in
          * @param railway The railway type of the way this segment is in
-         * @param coastline The coastlyne typo of the way the segment is in
+         * @param coastline The coastline typo of the way the segment is in
          */
-        public ExtendedSegment(WaySegment ws, String layer, String railway, String coastline)
-        {
+        public ExtendedSegment(WaySegment ws, String layer, String railway, String coastline) {
             this.ws = ws;
             this.n1 = ws.way.getNodes().get(ws.lowerIndex);
@@ -202,13 +191,10 @@
          * Checks whether this segment crosses other segment
          * @param s2 The other segment
-         * @return true if both segements crosses
+         * @return true if both segments crosses
          */
-        public boolean intersects(ExtendedSegment s2)
-        {
-            if( n1.equals(s2.n1) || n2.equals(s2.n2) ||
-                n1.equals(s2.n2)   || n2.equals(s2.n1) )
-            {
+        public boolean intersects(ExtendedSegment s2) {
+            if (n1.equals(s2.n1) || n2.equals(s2.n2) ||
+                    n1.equals(s2.n2) || n2.equals(s2.n1))
                 return false;
-            }
 
             return Line2D.linesIntersect(
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 3671)
@@ -58,15 +58,11 @@
         private LatLon getLatLon(Object o) {
             if (o instanceof Node) {
-                if (precision==0) {
+                if (precision==0)
                     return ((Node) o).getCoor().getRoundedToOsmPrecision();
-                } else {
-                    return RoundCoord((Node) o);
-                }
+                return RoundCoord((Node) o);
             } else if (o instanceof List<?>) {
-                if (precision==0) {
+                if (precision==0)
                     return ((List<Node>) o).get(0).getCoor().getRoundedToOsmPrecision();
-                } else {
-                    return RoundCoord(((List<Node>) o).get(0));
-                }
+                return RoundCoord(((List<Node>) o).get(0));
             } else {
                 throw new AssertionError();
@@ -74,12 +70,13 @@
         }
 
+        @Override
         public boolean equals(Object k, Object t) {
             return getLatLon(k).equals(getLatLon(t));
         }
 
+        @Override
         public int getHashCode(Object k) {
             return getLatLon(k).hashCode();
         }
-
     }
 
@@ -107,6 +104,5 @@
      * Constructor
      */
-    public DuplicateNode()
-    {
+    public DuplicateNode() {
         super(tr("Duplicated nodes")+".",
                 tr("This test checks that there are no nodes at the very same location."));
@@ -132,5 +128,5 @@
             // multiple nodes at the same position -> report errors
             //
-            List<Node> nodes = (List<Node>)v;
+            List<Node> nodes = (List<Node>) v;
             errors.addAll(buildTestErrors(this, nodes));
         }
@@ -154,5 +150,5 @@
         // the same tag set
         //
-        for (Iterator<Map<String,String>> it = bag.keySet().iterator(); it.hasNext(); ) {
+        for (Iterator<Map<String,String>> it = bag.keySet().iterator(); it.hasNext();) {
             Map<String,String> tagSet = it.next();
             if (bag.get(tagSet).size() > 1) {
@@ -177,5 +173,7 @@
                                     }
                                 }
-                                if (!typed) typeMap.put("none", true);
+                                if (!typed) {
+                                    typeMap.put("none", true);
+                                }
                             }
                         }
@@ -186,5 +184,7 @@
                 int nbType=0;
                 for (String type: typeMap.keySet()) {
-                    if (typeMap.get(type)) nbType++;
+                    if (typeMap.get(type)) {
+                        nbType++;
+                    }
                 }
 
@@ -303,5 +303,4 @@
                 it.remove();
             }
-
         }
 
@@ -359,6 +358,5 @@
      */
     @Override
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
         Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(testError.getPrimitives());
         LinkedHashSet<Node> nodes = new LinkedHashSet<Node>(OsmPrimitive.getFilteredList(sel, Node.class));
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 3671)
@@ -40,11 +40,14 @@
             keys=_keys;
         }
+
         @Override
         public int hashCode() {
             return coor.hashCode()+keys.hashCode();
         }
+
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof WayPair)) return false;
+            if (!(obj instanceof WayPair))
+                return false;
             WayPair wp = (WayPair) obj;
             return wp.coor.equals(coor) && wp.keys.equals(keys);
@@ -60,6 +63,5 @@
      * Constructor
      */
-    public DuplicateWay()
-    {
+    public DuplicateWay() {
         super(tr("Duplicated ways")+".",
               tr("This test checks that there are no ways with same tags and same node coordinates."));
@@ -68,6 +70,5 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         ways = new Bag<WayPair, OsmPrimitive>(1000);
@@ -75,13 +76,10 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         super.endTest();
-        for(List<OsmPrimitive> duplicated : ways.values() )
-        {
-            if( duplicated.size() > 1)
-            {
+        for (List<OsmPrimitive> duplicated : ways.values()) {
+            if (duplicated.size() > 1) {
                 TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated ways"), DUPLICATE_WAY, duplicated);
-                errors.add( testError );
+                errors.add(testError);
             }
         }
@@ -90,12 +88,11 @@
 
     @Override
-    public void visit(Way w)
-    {
-        if( !w.isUsable() )
+    public void visit(Way w) {
+        if (!w.isUsable())
             return;
         List<Node> wNodes=w.getNodes();
         Vector<LatLon> wLat=new Vector<LatLon>(wNodes.size());
-        for(int i=0;i<wNodes.size();i++) {
-                 wLat.add(wNodes.get(i).getCoor());
+        for (int i=0;i<wNodes.size();i++) {
+             wLat.add(wNodes.get(i).getCoor());
         }
         Map<String, String> wkeys=w.getKeys();
@@ -109,14 +106,15 @@
      */
     @Override
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
         Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
         HashSet<Way> ways = new HashSet<Way>();
 
-        for (OsmPrimitive osm : sel)
-            if (osm instanceof Way)
+        for (OsmPrimitive osm : sel) {
+            if (osm instanceof Way) {
                 ways.add((Way)osm);
+            }
+        }
 
-        if( ways.size() < 2 )
+        if (ways.size() < 2)
             return null;
 
@@ -171,6 +169,5 @@
 
     @Override
-    public boolean isFixable(TestError testError)
-    {
+    public boolean isFixable(TestError testError) {
         if (!(testError.getTester() instanceof DuplicateWay))
             return false;
@@ -180,7 +177,9 @@
         HashSet<Way> ways = new HashSet<Way>();
 
-        for (OsmPrimitive osm : sel)
-            if (osm instanceof Way)
+        for (OsmPrimitive osm : sel) {
+            if (osm instanceof Way) {
                 ways.add((Way)osm);
+            }
+        }
 
         if (ways.size() < 2)
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicatedWayNodes.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicatedWayNodes.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicatedWayNodes.java	(revision 3671)
@@ -25,5 +25,6 @@
     }
 
-    @Override public void visit(Way w) {
+    @Override
+    public void visit(Way w) {
         if (!w.isUsable()) return;
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 3671)
@@ -51,6 +51,5 @@
 
     @Override
-    public void initialize() throws Exception
-    {
+    public void initialize() throws Exception {
         styles = MapPaintStyles.getStyles().getStyleSet();
     }
@@ -59,5 +58,5 @@
         List<List<Node>> result = new ArrayList<List<Node>>();
         List<Way> waysToJoin = new ArrayList<Way>();
-        for (Way way: ways) {
+        for (Way way : ways) {
             if (way.isClosed()) {
                 result.add(way.getNodes());
@@ -67,5 +66,5 @@
         }
 
-        for (JoinedWay jw: Multipolygon.joinWays(waysToJoin)) {
+        for (JoinedWay jw : Multipolygon.joinWays(waysToJoin)) {
             if (!jw.isClosed()) {
                 nonClosedWays.add(jw.getNodes());
@@ -79,8 +78,8 @@
     private GeneralPath createPath(List<Node> nodes) {
         GeneralPath result = new GeneralPath();
-        result.moveTo((float)nodes.get(0).getCoor().lat(), (float)nodes.get(0).getCoor().lon());
+        result.moveTo((float) nodes.get(0).getCoor().lat(), (float) nodes.get(0).getCoor().lon());
         for (int i=1; i<nodes.size(); i++) {
             Node n = nodes.get(i);
-            result.lineTo((float)n.getCoor().lat(), (float)n.getCoor().lon());
+            result.lineTo((float )n.getCoor().lat(), (float) n.getCoor().lon());
         }
         return result;
@@ -89,5 +88,5 @@
     private List<GeneralPath> createPolygons(List<List<Node>> joinedWays) {
         List<GeneralPath> result = new ArrayList<GeneralPath>();
-        for (List<Node> way: joinedWays) {
+        for (List<Node> way : joinedWays) {
             result.add(createPath(way));
         }
@@ -99,5 +98,5 @@
         boolean outside = false;
 
-        for (Node n: inner) {
+        for (Node n : inner) {
             boolean contains = outer.contains(n.getCoor().lat(), n.getCoor().lon());
             inside = inside | contains;
@@ -108,14 +107,14 @@
         }
 
-        return inside?Intersection.INSIDE:Intersection.OUTSIDE;
+        return inside ? Intersection.INSIDE : Intersection.OUTSIDE;
     }
 
     @Override
     public void visit(Way w) {
-        if (styles != null && !w.isClosed())
-        {
+        if (styles != null && !w.isClosed()) {
             ElemStyle e = styles.getArea(w);
-            if(e instanceof AreaElemStyle && !((AreaElemStyle)e).closed)
+            if (e instanceof AreaElemStyle && !((AreaElemStyle)e).closed) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Area style way is not closed"), NOT_CLOSED,  w));
+            }
         }
     }
@@ -134,8 +133,7 @@
             }
 
-            for (RelationMember rm: r.getMembers()) {
-                if (!rm.getMember().isUsable()) {
+            for (RelationMember rm : r.getMembers()) {
+                if (!rm.getMember().isUsable())
                     return; // Rest of checks is only for complete multipolygons
-                }
             }
 
@@ -143,9 +141,9 @@
             List<List<Node>> outerWays = joinWays(polygon.getOuterWays());
 
-            if(styles != null) {
+            if (styles != null) {
                 ElemStyle wayStyle = styles.get(r);
 
                 // If area style was not found for relation then use style of ways
-                if(!(wayStyle instanceof AreaElemStyle)) {
+                if (!(wayStyle instanceof AreaElemStyle)) {
                     errors.add( new TestError(this, Severity.OTHER, tr("No style in multipolygon relation"),
                     NO_STYLE_POLYGON, r));
@@ -159,8 +157,7 @@
 
                 if (wayStyle instanceof AreaElemStyle) {
-                    for (Way wInner : polygon.getInnerWays())
-                    {
+                    for (Way wInner : polygon.getInnerWays()) {
                         ElemStyle innerStyle = styles.get(wInner);
-                        if(wayStyle != null && wayStyle.equals(innerStyle)) {
+                        if (wayStyle != null && wayStyle.equals(innerStyle)) {
                             List<OsmPrimitive> l = new ArrayList<OsmPrimitive>();
                             l.add(r);
@@ -170,28 +167,27 @@
                         }
                     }
-                    for (Way wOuter : polygon.getOuterWays())
-                    {
+                    for (Way wOuter : polygon.getOuterWays()) {
                         ElemStyle outerStyle = styles.get(wOuter);
-                        if(outerStyle instanceof AreaElemStyle && !wayStyle.equals(outerStyle)) {
+                        if (outerStyle instanceof AreaElemStyle && !wayStyle.equals(outerStyle)) {
                             List<OsmPrimitive> l = new ArrayList<OsmPrimitive>();
                             l.add(r);
                             l.add(wOuter);
-                            errors.add( new TestError(this, Severity.WARNING, tr("Style for outer way mismatches"),
+                            errors.add(new TestError(this, Severity.WARNING, tr("Style for outer way mismatches"),
                             OUTER_STYLE_MISMATCH, l, Collections.singletonList(wOuter)));
                         }
                     }
                 }
-                else
-                    errors.add( new TestError(this, Severity.OTHER, tr("No style for multipolygon"),
-                    NO_STYLE, r));
+                else {
+                    errors.add(new TestError(this, Severity.OTHER, tr("No style for multipolygon"), NO_STYLE, r));
+                }
             }
 
             if (!nonClosedWays.isEmpty()) {
-                errors.add( new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY,  Collections.singletonList(r), nonClosedWays));
+                errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY,  Collections.singletonList(r), nonClosedWays));
             }
 
             // For painting is used Polygon class which works with ints only. For validation we need more precision
             List<GeneralPath> outerPolygons = createPolygons(outerWays);
-            for (List<Node> pdInner: innerWays) {
+            for (List<Node> pdInner : innerWays) {
                 boolean outside = true;
                 boolean crossing = false;
@@ -221,15 +217,13 @@
 
     private void checkMembersAndRoles(Relation r) {
-        for (RelationMember rm: r.getMembers()) {
+        for (RelationMember rm : r.getMembers()) {
             if (rm.isWay()) {
                 if (!("inner".equals(rm.getRole()) || "outer".equals(rm.getRole()) || !rm.hasRole())) {
-                    errors.add( new TestError(this, Severity.WARNING, tr("No useful role for multipolygon member"), WRONG_MEMBER_ROLE, rm.getMember()));
+                    errors.add(new TestError(this, Severity.WARNING, tr("No useful role for multipolygon member"), WRONG_MEMBER_ROLE, rm.getMember()));
                 }
             } else {
-                errors.add( new TestError(this, Severity.WARNING, tr("Non-Way in multipolygon"), WRONG_MEMBER_TYPE, rm.getMember()));
-            }
-        }
-    }
-
-
+                errors.add(new TestError(this, Severity.WARNING, tr("Non-Way in multipolygon"), WRONG_MEMBER_TYPE, rm.getMember()));
+            }
+        }
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java	(revision 3671)
@@ -72,6 +72,6 @@
         if (name == null) {
             errors.add(new TestError(this, Severity.OTHER,
-                tr("A name is missing, even though name:* exists."),
-                                     NAME_MISSING, p));
+                    tr("A name is missing, even though name:* exists."),
+                    NAME_MISSING, p));
         return;
     }
@@ -105,6 +105,7 @@
     @Override public void visit(Collection<OsmPrimitive> selection) {
         for (OsmPrimitive p : selection)
-            if (!p.isDeleted() && !p.isIncomplete())
+            if (!p.isDeleted() && !p.isIncomplete()) {
                 check(p);
+            }
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java	(revision 3671)
@@ -9,5 +9,4 @@
 import java.util.HashSet;
 import java.util.ArrayList;
-
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -39,12 +38,12 @@
         String highway = n.get("highway");
         if (name == null
-            || (sign != null && sign.equals("city_limit"))
-            || (highway != null && highway.equals("bus_stop"))) {
+                || (sign != null && sign.equals("city_limit"))
+                || (highway != null && highway.equals("bus_stop")))
             return;
-        }
 
         List<Node> nodes = namesToNodes.get(name);
-        if (nodes == null)
+        if (nodes == null) {
             namesToNodes.put(name, nodes = new ArrayList<Node>());
+        }
 
         nodes.add(n);
@@ -61,5 +60,5 @@
                     if (ref == null || !refs.add(ref)) {
                         errors.add(new TestError(this, Severity.OTHER,
-                            tr("Nodes with same name"), SAME_NAME, nodes));
+                                tr("Nodes with same name"), SAME_NAME, nodes));
                         break;
                     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 3671)
@@ -26,6 +26,6 @@
  * @author frsantos
  */
-public class OverlappingWays extends Test
-{
+public class OverlappingWays extends Test {
+    
     /** Bag of all way segments */
     Bag<Pair<Node,Node>, WaySegment> nodePairs;
@@ -40,16 +40,12 @@
 
     /** Constructor */
-    public OverlappingWays()
-    {
+    public OverlappingWays() {
         super(tr("Overlapping ways."),
               tr("This test checks that a connection between two nodes "
                 + "is not used by more than one way."));
-
     }
 
-
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor)  {
         super.startTest(monitor);
         nodePairs = new Bag<Pair<Node,Node>, WaySegment>(1000);
@@ -57,14 +53,11 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         Map<List<Way>, List<WaySegment>> ways_seen = new HashMap<List<Way>, List<WaySegment>>(500);
 
-        for (List<WaySegment> duplicated : nodePairs.values())
-        {
+        for (List<WaySegment> duplicated : nodePairs.values()) {
             int ways = duplicated.size();
 
-            if (ways > 1)
-            {
+            if (ways > 1) {
                 List<OsmPrimitive> prims = new ArrayList<OsmPrimitive>();
                 List<Way> current_ways = new ArrayList<Way>();
@@ -74,18 +67,21 @@
                 int area = 0;
 
-                for (WaySegment ws : duplicated)
-                {
-                    if (ws.way.get("highway") != null)
+                for (WaySegment ws : duplicated) {
+                    if (ws.way.get("highway") != null) {
                         highway++;
-                    else if (ws.way.get("railway") != null)
+                    } else if (ws.way.get("railway") != null) {
                         railway++;
+                    }
                     Boolean ar = OsmUtils.getOsmBoolean(ws.way.get("area"));
-                    if (ar != null && ar)
+                    if (ar != null && ar) {
                         area++;
-                    if (ws.way.get("landuse") != null || ws.way.get("natural") != null
-                    || ws.way.get("amenity") != null || ws.way.get("leisure") != null
-                    || ws.way.get("building") != null)
-                    {
-                        area++; ways--;
+                    }
+                    if (ws.way.get("landuse") != null
+                            || ws.way.get("natural") != null
+                            || ws.way.get("amenity") != null
+                            || ws.way.get("leisure") != null
+                            || ws.way.get("building") != null) {
+                        area++;
+                        ways--;
                     }
 
@@ -97,56 +93,42 @@
                  * highways or railways mark a separate error
                  */
-                if ((highlight = ways_seen.get(current_ways)) == null)
-                {
+                if ((highlight = ways_seen.get(current_ways)) == null) {
                     String errortype;
                     int type;
 
-                    if(area > 0)
-                    {
-                        if (ways == 0 || duplicated.size() == area)
-                        {
+                    if (area > 0) {
+                        if (ways == 0 || duplicated.size() == area) {
                             errortype = tr("Overlapping areas");
                             type = OVERLAPPING_AREA;
-                        }
-                        else if (highway == ways)
-                        {
+                        } else if (highway == ways) {
                             errortype = tr("Overlapping highways (with area)");
                             type = OVERLAPPING_HIGHWAY_AREA;
-                        }
-                        else if (railway == ways)
-                        {
+                        } else if (railway == ways) {
                             errortype = tr("Overlapping railways (with area)");
                             type = OVERLAPPING_RAILWAY_AREA;
-                        }
-                        else
-                        {
+                        } else {
                             errortype = tr("Overlapping ways (with area)");
                             type = OVERLAPPING_WAY_AREA;
                         }
                     }
-                    else if (highway == ways)
-                    {
+                    else if (highway == ways) {
                         errortype = tr("Overlapping highways");
                         type = OVERLAPPING_HIGHWAY;
-                    }
-                    else if (railway == ways)
-                    {
+                    } else if (railway == ways) {
                         errortype = tr("Overlapping railways");
                         type = OVERLAPPING_RAILWAY;
-                    }
-                    else
-                    {
+                    } else {
                         errortype = tr("Overlapping ways");
                         type = OVERLAPPING_WAY;
                     }
 
-                    errors.add(new TestError(this, type < OVERLAPPING_HIGHWAY_AREA
-                    ? Severity.WARNING : Severity.OTHER, tr(errortype), type, prims, duplicated));
+                    errors.add(new TestError(this, 
+                            type < OVERLAPPING_HIGHWAY_AREA ? Severity.WARNING : Severity.OTHER,
+                            tr(errortype), type, prims, duplicated));
                     ways_seen.put(current_ways, duplicated);
-                }
-                else    /* way seen, mark highlight layer only */
-                {
-                    for (WaySegment ws : duplicated)
+                } else { /* way seen, mark highlight layer only */
+                    for (WaySegment ws : duplicated) {
                         highlight.add(ws);
+                    }
                 }
             }
@@ -157,6 +139,5 @@
 
     @Override
-    public void visit(Way w)
-    {
+    public void visit(Way w) {
         Node lastN = null;
         int i = -2;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 3671)
@@ -23,6 +23,6 @@
  *
  */
-public class RelationChecker extends Test
-{
+public class RelationChecker extends Test {
+
     protected static int ROLE_UNKNOWN      = 1701;
     protected static int ROLE_EMPTY        = 1702;
@@ -37,6 +37,5 @@
      * Constructor
      */
-    public RelationChecker()
-    {
+    public RelationChecker() {
         super(tr("Relation checker :"),
                 tr("This plugin checks for errors in relations."));
@@ -44,25 +43,20 @@
 
     @Override
-    public void initialize() throws Exception
-    {
+    public void initialize() throws Exception {
         initializePresets();
     }
 
     static Collection<TaggingPreset> relationpresets = new LinkedList<TaggingPreset>();
+
     /**
      * Reads the presets data.
      *
      */
-    public void initializePresets()
-    {
+    public void initializePresets() {
         Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets;
-        if(presets != null)
-        {
-            for(TaggingPreset p : presets)
-            {
-                for(TaggingPreset.Item i : p.data)
-                {
-                    if(i instanceof TaggingPreset.Roles)
-                    {
+        if (presets != null) {
+            for (TaggingPreset p : presets) {
+                for (TaggingPreset.Item i : p.data) {
+                    if (i instanceof TaggingPreset.Roles) {
                         relationpresets.add(p);
                         break;
@@ -73,6 +67,5 @@
     }
 
-    public class RoleInfo
-    {
+    public class RoleInfo {
         int total = 0;
         int nodes = 0;
@@ -84,90 +77,79 @@
 
     @Override
-    public void visit(Relation n)
-    {
+    public void visit(Relation n) {
         LinkedList<TaggingPreset.Role> allroles = new LinkedList<TaggingPreset.Role>();
-        for(TaggingPreset p : relationpresets)
-        {
+        for (TaggingPreset p : relationpresets) {
             boolean matches = true;
             TaggingPreset.Roles r = null;
-            for(TaggingPreset.Item i : p.data)
-            {
-                if(i instanceof TaggingPreset.Key)
-                {
-                    TaggingPreset.Key k = (TaggingPreset.Key)i;
-                    if(!k.value.equals(n.get(k.key)))
-                    {
+            for (TaggingPreset.Item i : p.data) {
+                if (i instanceof TaggingPreset.Key) {
+                    TaggingPreset.Key k = (TaggingPreset.Key) i;
+                    if (!k.value.equals(n.get(k.key))) {
                         matches = false;
                         break;
                     }
+                } else if (i instanceof TaggingPreset.Roles) {
+                    r = (TaggingPreset.Roles) i;
                 }
-                else if(i instanceof TaggingPreset.Roles)
-                    r = (TaggingPreset.Roles) i;
             }
-            if(matches && r != null)
+            if (matches && r != null) {
                 allroles.addAll(r.roles);
+            }
         }
-        if(allroles.size() == 0)
-        {
+        if (allroles.size() == 0) {
             errors.add( new TestError(this, Severity.WARNING, tr("Relation type is unknown"),
                     RELATION_UNKNOWN, n) );
-
-        }
-        else
-        {
+        } else {
             HashMap<String,RoleInfo> map = new HashMap<String, RoleInfo>();
-            for(RelationMember m : n.getMembers()) {
+            for (RelationMember m : n.getMembers()) {
                 String s = "";
-                if(m.hasRole())
+                if (m.hasRole()) {
                     s = m.getRole();
+                }
                 RoleInfo ri = map.get(s);
-                if(ri == null)
+                if (ri == null) {
                     ri = new RoleInfo();
+                }
                 ri.total++;
-                if(m.isRelation())
+                if (m.isRelation()) {
                     ri.relations++;
-                else if(m.isWay())
-                {
+                } else if(m.isWay()) {
                     ri.ways++;
-                    if(m.getWay().isClosed())
+                    if (m.getWay().isClosed()) {
                         ri.closedways++;
-                    else
+                    } else {
                         ri.openways++;
+                    }
                 }
-                else if(m.isNode())
+                else if (m.isNode()) {
                     ri.nodes++;
+                }
                 map.put(s, ri);
             }
-            if(map.size() == 0)
+            if(map.isEmpty()) {
                 errors.add( new TestError(this, Severity.ERROR, tr("Relation is empty"),
                         RELATION_EMPTY, n) );
-            else
-            {
+            } else {
                 LinkedList<String> done = new LinkedList<String>();
-                for(TaggingPreset.Role r : allroles)
-                {
+                for (TaggingPreset.Role r : allroles) {
                     done.add(r.key);
                     String keyname = r.key;
-                    if(keyname == "")
+                    if (keyname == "") { //FIXME
                         keyname = tr("<empty>");
+                    }
                     RoleInfo ri = map.get(r.key);
                     long count = (ri == null) ? 0 : ri.total;
                     long vc = r.getValidCount(count);
-                    if(count != vc)
-                    {
-                        if(count == 0)
-                        {
+                    if (count != vc) {
+                        if (count == 0) {
                             String s = marktr("Role {0} missing");
                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
                                     tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n) );
                         }
-                        else if(vc > count)
-                        {
+                        else if (vc > count) {
                             String s = marktr("Number of {0} roles too low ({1})");
                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
                                     tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n) );
-                        }
-                        else
-                        {
+                        } else {
                             String s = marktr("Number of {0} roles too high ({1})");
                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
@@ -175,5 +157,5 @@
                         }
                     }
-                    if(ri != null && ((!r.types.contains(PresetType.WAY) && (r.types.contains(PresetType.CLOSEDWAY) ? ri.openways > 0 : ri.ways > 0))
+                    if (ri != null && ((!r.types.contains(PresetType.WAY) && (r.types.contains(PresetType.CLOSEDWAY) ? ri.openways > 0 : ri.ways > 0))
                             || (!r.types.contains(PresetType.NODE) && ri.nodes > 0) || (!r.types.contains(PresetType.RELATION) && ri.relations > 0)))
                     {
@@ -183,19 +165,14 @@
                     }
                 }
-                for(String key : map.keySet())
-                {
-                    if(!done.contains(key))
-                    {
-                        if(key.length() > 0)
-                        {
+                for (String key : map.keySet()) {
+                    if (!done.contains(key)) {
+                        if (key.length() > 0) {
                             String s = marktr("Role {0} unknown");
-                            errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
-                                    tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n) );
-                        }
-                        else
-                        {
+                            errors.add(new TestError(this, Severity.WARNING, tr("Role verification problem"),
+                                    tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n));
+                        } else {
                             String s = marktr("Empty role found");
-                            errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
-                                    tr(s), s, ROLE_EMPTY, n) );
+                            errors.add(new TestError(this, Severity.WARNING, tr("Role verification problem"),
+                                    tr(s), s, ROLE_EMPTY, n));
                         }
                     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java	(revision 3671)
@@ -17,4 +17,5 @@
  */
 public class SelfIntersectingWay extends Test {
+    
     protected static int SELF_INTERSECT = 401;
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java	(revision 3671)
@@ -25,6 +25,6 @@
  * @author frsantos
  */
-public class SimilarNamedWays extends Test
-{
+public class SimilarNamedWays extends Test {
+
     protected static int SIMILAR_NAMED = 701;
 
@@ -37,6 +37,5 @@
      * Constructor
      */
-    public SimilarNamedWays()
-    {
+    public SimilarNamedWays() {
         super(tr("Similarly named ways")+".",
               tr("This test checks for ways with similar names that may have been misspelled."));
@@ -44,6 +43,5 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         cellWays = new HashMap<Point2D,List<Way>>(1000);
@@ -52,6 +50,5 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         cellWays = null;
         errorWays = null;
@@ -60,32 +57,30 @@
 
     @Override
-    public void visit(Way w)
-    {
-        if( !w.isUsable() )
+    public void visit(Way w) {
+        if (!w.isUsable())
             return;
 
         String name = w.get("name");
-        if( name == null || name.length() < 6 )
+        if (name == null || name.length() < 6)
             return;
 
         List<List<Way>> theCellWays = ValUtil.getWaysInCell(w, cellWays);
-        for( List<Way> ways : theCellWays)
-        {
-            for( Way w2 : ways)
-            {
-                if( errorWays.contains(w, w2) || errorWays.contains(w2, w) )
+        for (List<Way> ways : theCellWays) {
+            for (Way w2 : ways) {
+                if (errorWays.contains(w, w2) || errorWays.contains(w2, w)) {
                     continue;
+                }
 
                 String name2 = w2.get("name");
-                if( name2 == null || name2.length() < 6 )
+                if (name2 == null || name2.length() < 6) {
                     continue;
+                }
 
                 int levenshteinDistance = getLevenshteinDistance(name, name2);
-                if( 0 < levenshteinDistance && levenshteinDistance <= 2 )
-                {
+                if (0 < levenshteinDistance && levenshteinDistance <= 2) {
                     List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
                     primitives.add(w);
                     primitives.add(w2);
-                    errors.add( new TestError(this, Severity.WARNING, tr("Similarly named ways"), SIMILAR_NAMED, primitives) );
+                    errors.add(new TestError(this, Severity.WARNING, tr("Similarly named ways"), SIMILAR_NAMED, primitives));
                     errorWays.add(w, w2);
                 }
@@ -102,6 +97,5 @@
      * @return The distance between words
      */
-    public int getLevenshteinDistance(String s, String t)
-    {
+    public int getLevenshteinDistance(String s, String t) {
         int d[][]; // matrix
         int n; // length of s
@@ -114,37 +108,39 @@
 
         // Step 1
-
         n = s.length();
         m = t.length();
-        if (n == 0) return m;
-        if (m == 0) return n;
+        if (n == 0)
+            return m;
+        if (m == 0)
+            return n;
         d = new int[n + 1][m + 1];
 
         // Step 2
-        for (i = 0; i <= n; i++) d[i][0] = i;
-        for (j = 0; j <= m; j++) d[0][j] = j;
+        for (i = 0; i <= n; i++) {
+            d[i][0] = i;
+        }
+        for (j = 0; j <= m; j++) {
+            d[0][j] = j;
+        }
 
         // Step 3
-        for (i = 1; i <= n; i++)
-        {
+        for (i = 1; i <= n; i++) {
+
             s_i = s.charAt(i - 1);
 
             // Step 4
-            for (j = 1; j <= m; j++)
-            {
+            for (j = 1; j <= m; j++) {
+
                 t_j = t.charAt(j - 1);
 
                 // Step 5
-                if (s_i == t_j)
-                {
+                if (s_i == t_j) {
                     cost = 0;
-                }
-                else
-                {
+                } else {
                     cost = 1;
                 }
 
                 // Step 6
-                d[i][j] = Minimum(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
+                d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
             }
         }
@@ -154,20 +150,16 @@
     }
 
-    /**
+    /** // FIXME: move to utils
      * Get minimum of three values
      * @param a First value
      * @param b Second value
      * @param c Third value
-     * @return The minimum of the tre values
+     * @return The minimum of the three values
      */
-    private static int Minimum(int a, int b, int c)
-    {
+    private static int min(int a, int b, int c) {
         int mi = a;
-        if (b < mi)
-        {
+        if (b < mi) {
             mi = b;
-        }
-        if (c < mi)
-        {
+        } if (c < mi) {
             mi = c;
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 3671)
@@ -141,13 +141,12 @@
 
     /** List of sources for spellcheck data */
-    protected JList Sources;
-
+    protected JList sourcesList;
 
     protected static Entities entities = new Entities();
+
     /**
      * Constructor
      */
-    public TagChecker()
-    {
+    public TagChecker() {
         super(tr("Properties checker :"),
                 tr("This plugin checks for errors in property keys and values."));
@@ -155,6 +154,5 @@
 
     @Override
-    public void initialize() throws Exception
-    {
+    public void initialize() throws Exception {
         initializeData();
         initializePresets();
@@ -170,45 +168,39 @@
      * @throws IOException
      */
-    private static void initializeData() throws IOException
-    {
+    private static void initializeData() throws IOException {
         spellCheckKeyData = new HashMap<String, String>();
         String sources = Main.pref.get( PREF_SOURCES, "");
-        if(Main.pref.getBoolean(PREF_USE_DATA_FILE, true))
-        {
-            if( sources == null || sources.length() == 0)
+        if (Main.pref.getBoolean(PREF_USE_DATA_FILE, true)) {
+            if (sources == null || sources.length() == 0) {
                 sources = DATA_FILE;
-            else
+            } else {
                 sources = DATA_FILE + ";" + sources;
-        }
-        if(Main.pref.getBoolean(PREF_USE_IGNORE_FILE, true))
-        {
-            if( sources == null || sources.length() == 0)
+            }
+        }
+        if (Main.pref.getBoolean(PREF_USE_IGNORE_FILE, true)) {
+            if (sources == null || sources.length() == 0) {
                 sources = IGNORE_FILE;
-            else
+            } else {
                 sources = IGNORE_FILE + ";" + sources;
-        }
-        if(Main.pref.getBoolean(PREF_USE_SPELL_FILE, true))
-        {
-            if( sources == null || sources.length() == 0)
+            }
+        }
+        if (Main.pref.getBoolean(PREF_USE_SPELL_FILE, true)) {
+            if( sources == null || sources.length() == 0) {
                 sources = SPELL_FILE;
-            else
+            } else {
                 sources = SPELL_FILE + ";" + sources;
+            }
         }
 
         String errorSources = "";
-        if(sources.length() == 0)
+        if (sources.length() == 0)
             return;
-        for(String source: sources.split(";"))
-        {
-            try
-            {
+        for (String source : sources.split(";")) {
+            try {
                 MirroredInputStream s = new MirroredInputStream(source, ValUtil.getPluginDir(), -1);
                 InputStreamReader r;
-                try
-                {
+                try {
                     r = new InputStreamReader(s, "UTF-8");
-                }
-                catch (UnsupportedEncodingException e)
-                {
+                } catch (UnsupportedEncodingException e) {
                     r = new InputStreamReader(s);
                 }
@@ -219,37 +211,29 @@
                 boolean ignorefile = false;
                 String line;
-                while((line = reader.readLine()) != null && (tagcheckerfile || line.length() != 0))
-                {
-                    if(line.startsWith("#"))
-                    {
-                        if(line.startsWith("# JOSM TagChecker"))
+                while ((line = reader.readLine()) != null && (tagcheckerfile || line.length() != 0)) {
+                    if (line.startsWith("#")) {
+                        if (line.startsWith("# JOSM TagChecker")) {
                             tagcheckerfile = true;
-                        if(line.startsWith("# JOSM IgnoreTags"))
+                        }
+                        if (line.startsWith("# JOSM IgnoreTags")) {
                             ignorefile = true;
+                        }
                         continue;
-                    }
-                    else if(ignorefile)
-                    {
+                    } else if (ignorefile) {
                         line = line.trim();
-                        if(line.length() < 4)
+                        if (line.length() < 4) {
                             continue;
+                        }
 
                         String key = line.substring(0, 2);
                         line = line.substring(2);
 
-                        if(key.equals("S:"))
-                        {
+                        if (key.equals("S:")) {
                             ignoreDataStartsWith.add(line);
-                        }
-                        else if(key.equals("E:"))
-                        {
+                        } else if (key.equals("E:")) {
                             ignoreDataEquals.add(line);
-                        }
-                        else if(key.equals("F:"))
-                        {
+                        } else if (key.equals("F:")) {
                             ignoreDataEndsWith.add(line);
-                        }
-                        else if(key.equals("K:"))
-                        {
+                        } else if (key.equals("K:")) {
                             IgnoreKeyPair tmp = new IgnoreKeyPair();
                             int mid = line.indexOf("=");
@@ -257,7 +241,5 @@
                             tmp.value = line.substring(mid+1);
                             ignoreDataKeyPair.add(tmp);
-                        }
-                        else if(key.equals("T:"))
-                        {
+                        } else if (key.equals("T:")) {
                             IgnoreTwoKeyPair tmp = new IgnoreTwoKeyPair();
                             int mid = line.indexOf("=");
@@ -272,39 +254,29 @@
                         }
                         continue;
-                    }
-                    else if(tagcheckerfile)
-                    {
-                        if(line.length() > 0)
-                        {
+                    } else if (tagcheckerfile) {
+                        if (line.length() > 0) {
                             CheckerData d = new CheckerData();
                             String err = d.getData(line);
 
-                            if(err == null)
+                            if (err == null) {
                                 checkerData.add(d);
-                            else
+                            } else {
                                 System.err.println(tr("Invalid tagchecker line - {0}: {1}", err, line));
-                        }
-                    }
-                    else if(line.charAt(0) == '+')
-                    {
+                            }
+                        }
+                    } else if (line.charAt(0) == '+') {
                         okValue = line.substring(1);
-                    }
-                    else if(line.charAt(0) == '-' && okValue != null)
-                    {
+                    } else if (line.charAt(0) == '-' && okValue != null) {
                         spellCheckKeyData.put(line.substring(1), okValue);
-                    }
-                    else
-                    {
+                    } else {
                         System.err.println(tr("Invalid spellcheck line: {0}", line));
                     }
                 }
-            }
-            catch (IOException e)
-            {
+            } catch (IOException e) {
                 errorSources += source + "\n";
             }
         }
 
-        if( errorSources.length() > 0 )
+        if (errorSources.length() > 0)
             throw new IOException( tr("Could not access data file(s):\n{0}", errorSources) );
     }
@@ -315,47 +287,39 @@
      * @throws Exception
      */
-    public static void initializePresets() throws Exception
-    {
-        if( !Main.pref.getBoolean(PREF_CHECK_VALUES, true) )
+    public static void initializePresets() throws Exception {
+
+        if (!Main.pref.getBoolean(PREF_CHECK_VALUES, true))
             return;
 
         Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets;
-        if(presets != null)
-        {
+        if (presets != null) {
             presetsValueData = new Bag<String, String>();
-            for(String a : OsmPrimitive.getUninterestingKeys())
+            for (String a : OsmPrimitive.getUninterestingKeys()) {
                 presetsValueData.add(a);
+            }
             // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead)
             /*  for(String a : OsmPrimitive.getDirectionKeys())
                 presetsValueData.add(a);
              */
-            for(String a : Main.pref.getCollection(ValidatorPreference.PREFIX + ".knownkeys",
-                    Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"})))
+            for (String a : Main.pref.getCollection(ValidatorPreference.PREFIX + ".knownkeys",
+                    Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"}))) {
                 presetsValueData.add(a);
-            for(TaggingPreset p : presets)
-            {
-                for(TaggingPreset.Item i : p.data)
-                {
-                    if(i instanceof TaggingPreset.Combo)
-                    {
+            }
+            for (TaggingPreset p : presets) {
+                for(TaggingPreset.Item i : p.data) {
+                    if (i instanceof TaggingPreset.Combo) {
                         TaggingPreset.Combo combo = (TaggingPreset.Combo) i;
-                        if(combo.values != null)
-                        {
-                            for(String value : combo.values.split(","))
+                        if (combo.values != null) {
+                            for(String value : combo.values.split(",")) {
                                 presetsValueData.add(combo.key, value);
-                        }
-                    }
-                    else if(i instanceof TaggingPreset.Key)
-                    {
+                            }
+                        }
+                    } else if (i instanceof TaggingPreset.Key) {
                         TaggingPreset.Key k = (TaggingPreset.Key) i;
                         presetsValueData.add(k.key, k.value);
-                    }
-                    else if(i instanceof TaggingPreset.Text)
-                    {
+                    } else if (i instanceof TaggingPreset.Text) {
                         TaggingPreset.Text k = (TaggingPreset.Text) i;
                         presetsValueData.add(k.key);
-                    }
-                    else if(i instanceof TaggingPreset.Check)
-                    {
+                    } else if (i instanceof TaggingPreset.Check) {
                         TaggingPreset.Check k = (TaggingPreset.Check) i;
                         presetsValueData.add(k.key, "yes");
@@ -368,20 +332,15 @@
 
     @Override
-    public void visit(Node n)
-    {
+    public void visit(Node n) {
         checkPrimitive(n);
     }
 
-
     @Override
-    public void visit(Relation n)
-    {
+    public void visit(Relation n) {
         checkPrimitive(n);
     }
 
-
     @Override
-    public void visit(Way w)
-    {
+    public void visit(Way w) {
         checkPrimitive(w);
     }
@@ -392,7 +351,9 @@
      */
     private boolean containsLow(String s) {
-        if (s==null) return false;
-        for(int i=0;i<s.length();i++) {
-            if (s.charAt(i)<0x20) return true;
+        if (s == null)
+            return false;
+        for (int i = 0; i < s.length(); i++) {
+            if (s.charAt(i) < 0x20)
+                return true;
         }
         return false;
@@ -403,45 +364,38 @@
      * @param p The primitive to check
      */
-    private void checkPrimitive(OsmPrimitive p)
-    {
+    private void checkPrimitive(OsmPrimitive p) {
         // Just a collection to know if a primitive has been already marked with error
         Bag<OsmPrimitive, String> withErrors = new Bag<OsmPrimitive, String>();
 
-        if(checkComplex)
-        {
+        if (checkComplex) {
             Map<String, String> props = (p.getKeys() == null) ? Collections.<String, String>emptyMap() : p.getKeys();
-            for(Entry<String, String> prop: props.entrySet() )
-            {
+            for (Entry<String, String> prop : props.entrySet()) {
                 boolean ignore = true;
                 String key1 = prop.getKey();
                 String value1 = prop.getValue();
 
-                for(IgnoreTwoKeyPair a : ignoreDataTwoKeyPair)
-                {
-                    if(key1.equals(a.key1) && value1.equals(a.value1))
-                    {
+                for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {
+                    if (key1.equals(a.key1) && value1.equals(a.value1)) {
                         ignore = false;
-                        for(Entry<String, String> prop2: props.entrySet() )
-                        {
+                        for (Entry<String, String> prop2 : props.entrySet()) {
                             String key2 = prop2.getKey();
                             String value2 = prop2.getValue();
-                            for(IgnoreTwoKeyPair b : ignoreDataTwoKeyPair)
-                            {
-                                if(key2.equals(b.key2) && value2.equals(b.value2))
-                                {
+                            for (IgnoreTwoKeyPair b : ignoreDataTwoKeyPair) {
+                                if (key2.equals(b.key2) && value2.equals(b.value2)) {
                                     ignore = true;
                                     break;
                                 }
                             }
-                            if(ignore)
+                            if (ignore) {
                                 break;
-                        }
-                    }
-                    if(ignore)
+                            }
+                        }
+                    }
+                    if (ignore) {
                         break;
-                }
-
-                if(!ignore)
-                {
+                    }
+                }
+
+                if (!ignore) {
                     errors.add( new TestError(this, Severity.ERROR, tr("Illegal tag/value combinations"),
                             tr("Illegal tag/value combinations"), tr("Illegal tag/value combinations"), 1272, p) );
@@ -451,8 +405,6 @@
 
             Map<String, String> keys = p.getKeys();
-            for(CheckerData d : checkerData)
-            {
-                if(d.match(p, keys))
-                {
+            for (CheckerData d : checkerData) {
+                if (d.match(p, keys)) {
                     errors.add( new TestError(this, d.getSeverity(), tr("Illegal tag/value combinations"),
                             d.getDescription(), d.getDescriptionOrig(), d.getCode(), p) );
@@ -463,86 +415,73 @@
 
         Map<String, String> props = (p.getKeys() == null) ? Collections.<String, String>emptyMap() : p.getKeys();
-        for(Entry<String, String> prop: props.entrySet() )
-        {
+        for (Entry<String, String> prop : props.entrySet()) {
             String s = marktr("Key ''{0}'' invalid.");
             String key = prop.getKey();
             String value = prop.getValue();
-            if( checkValues && (containsLow(value)) && !withErrors.contains(p, "ICV"))
-            {
+            if (checkValues && (containsLow(value)) && !withErrors.contains(p, "ICV")) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Tag value contains character with code less than 0x20"),
                         tr(s, key), MessageFormat.format(s, key), LOW_CHAR_VALUE, p) );
                 withErrors.add(p, "ICV");
             }
-            if( checkKeys && (containsLow(key)) && !withErrors.contains(p, "ICK"))
-            {
+            if (checkKeys && (containsLow(key)) && !withErrors.contains(p, "ICK")) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Tag key contains character with code less than 0x20"),
                         tr(s, key), MessageFormat.format(s, key), LOW_CHAR_KEY, p) );
                 withErrors.add(p, "ICK");
             }
-            if( checkValues && (value!=null && value.length() > 255) && !withErrors.contains(p, "LV"))
-            {
+            if (checkValues && (value!=null && value.length() > 255) && !withErrors.contains(p, "LV")) {
                 errors.add( new TestError(this, Severity.ERROR, tr("Tag value longer than allowed"),
                         tr(s, key), MessageFormat.format(s, key), LONG_VALUE, p) );
                 withErrors.add(p, "LV");
             }
-            if( checkKeys && (key!=null && key.length() > 255) && !withErrors.contains(p, "LK"))
-            {
+            if (checkKeys && (key!=null && key.length() > 255) && !withErrors.contains(p, "LK")) {
                 errors.add( new TestError(this, Severity.ERROR, tr("Tag key longer than allowed"),
                         tr(s, key), MessageFormat.format(s, key), LONG_KEY, p) );
                 withErrors.add(p, "LK");
             }
-            if( checkValues && (value==null || value.trim().length() == 0) && !withErrors.contains(p, "EV"))
-            {
+            if (checkValues && (value==null || value.trim().length() == 0) && !withErrors.contains(p, "EV")) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Tags with empty values"),
                         tr(s, key), MessageFormat.format(s, key), EMPTY_VALUES, p) );
                 withErrors.add(p, "EV");
             }
-            if( checkKeys && spellCheckKeyData.containsKey(key) && !withErrors.contains(p, "IPK"))
-            {
+            if (checkKeys && spellCheckKeyData.containsKey(key) && !withErrors.contains(p, "IPK")) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Invalid property key"),
                         tr(s, key), MessageFormat.format(s, key), INVALID_KEY, p) );
                 withErrors.add(p, "IPK");
             }
-            if( checkKeys && key.indexOf(" ") >= 0 && !withErrors.contains(p, "IPK"))
-            {
+            if (checkKeys && key.indexOf(" ") >= 0 && !withErrors.contains(p, "IPK")) {
                 errors.add( new TestError(this, Severity.WARNING, tr("Invalid white space in property key"),
                         tr(s, key), MessageFormat.format(s, key), INVALID_KEY_SPACE, p) );
                 withErrors.add(p, "IPK");
             }
-            if( checkValues && value != null && (value.startsWith(" ") || value.endsWith(" ")) && !withErrors.contains(p, "SPACE"))
-            {
+            if (checkValues && value != null && (value.startsWith(" ") || value.endsWith(" ")) && !withErrors.contains(p, "SPACE")) {
                 errors.add( new TestError(this, Severity.OTHER, tr("Property values start or end with white space"),
                         tr(s, key), MessageFormat.format(s, key), INVALID_SPACE, p) );
                 withErrors.add(p, "SPACE");
             }
-            if( checkValues && value != null && !value.equals(entities.unescape(value)) && !withErrors.contains(p, "HTML"))
-            {
+            if (checkValues && value != null && !value.equals(entities.unescape(value)) && !withErrors.contains(p, "HTML")) {
                 errors.add( new TestError(this, Severity.OTHER, tr("Property values contain HTML entity"),
                         tr(s, key), MessageFormat.format(s, key), INVALID_HTML, p) );
                 withErrors.add(p, "HTML");
             }
-            if( checkValues && value != null && value.length() > 0 && presetsValueData != null)
-            {
+            if (checkValues && value != null && value.length() > 0 && presetsValueData != null) {
                 List<String> values = presetsValueData.get(key);
-                if(values == null)
-                {
+                if (values == null) {
                     boolean ignore = false;
-                    for(String a : ignoreDataStartsWith)
-                    {
-                        if(key.startsWith(a))
+                    for (String a : ignoreDataStartsWith) {
+                        if (key.startsWith(a)) {
                             ignore = true;
-                    }
-                    for(String a : ignoreDataEquals)
-                    {
-                        if(key.equals(a))
+                        }
+                    }
+                    for (String a : ignoreDataEquals) {
+                        if(key.equals(a)) {
                             ignore = true;
-                    }
-                    for(String a : ignoreDataEndsWith)
-                    {
-                        if(key.endsWith(a))
+                        }
+                    }
+                    for (String a : ignoreDataEndsWith) {
+                        if(key.endsWith(a)) {
                             ignore = true;
-                    }
-                    if(!ignore)
-                    {
+                        }
+                    }
+                    if (!ignore) {
                         String i = marktr("Key ''{0}'' not in presets.");
                         errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"),
@@ -550,22 +489,19 @@
                         withErrors.add(p, "UPK");
                     }
-                }
-                else if(values.size() > 0 && !values.contains(prop.getValue()))
-                {
+                } else if (values.size() > 0 && !values.contains(prop.getValue())) {
                     boolean ignore = false;
-                    for(IgnoreKeyPair a : ignoreDataKeyPair)
-                    {
-                        if(key.equals(a.key) && value.equals(a.value))
+                    for (IgnoreKeyPair a : ignoreDataKeyPair) {
+                        if (key.equals(a.key) && value.equals(a.value)) {
                             ignore = true;
-                    }
-
-                    for(IgnoreTwoKeyPair a : ignoreDataTwoKeyPair)
-                    {
-                        if(key.equals(a.key2) && value.equals(a.value2))
+                        }
+                    }
+
+                    for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {
+                        if (key.equals(a.key2) && value.equals(a.value2)) {
                             ignore = true;
-                    }
-
-                    if(!ignore)
-                    {
+                        }
+                    }
+
+                    if (!ignore) {
                         String i = marktr("Value ''{0}'' for key ''{1}'' not in presets.");
                         errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property value"),
@@ -589,38 +525,40 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         checkKeys = Main.pref.getBoolean(PREF_CHECK_KEYS, true);
-        if( isBeforeUpload )
+        if (isBeforeUpload) {
             checkKeys = checkKeys && Main.pref.getBoolean(PREF_CHECK_KEYS_BEFORE_UPLOAD, true);
+        }
 
         checkValues = Main.pref.getBoolean(PREF_CHECK_VALUES, true);
-        if( isBeforeUpload )
+        if (isBeforeUpload) {
             checkValues = checkValues && Main.pref.getBoolean(PREF_CHECK_VALUES_BEFORE_UPLOAD, true);
+        }
 
         checkComplex = Main.pref.getBoolean(PREF_CHECK_COMPLEX, true);
-        if( isBeforeUpload )
+        if (isBeforeUpload) {
             checkComplex = checkValues && Main.pref.getBoolean(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, true);
+        }
 
         checkFixmes = Main.pref.getBoolean(PREF_CHECK_FIXMES, true);
-        if( isBeforeUpload )
+        if (isBeforeUpload) {
             checkFixmes = checkFixmes && Main.pref.getBoolean(PREF_CHECK_FIXMES_BEFORE_UPLOAD, true);
+        }
     }
 
     @Override
-    public void visit(Collection<OsmPrimitive> selection)
-    {
-        if( checkKeys || checkValues || checkComplex || checkFixmes)
+    public void visit(Collection<OsmPrimitive> selection) {
+        if (checkKeys || checkValues || checkComplex || checkFixmes) {
             super.visit(selection);
+        }
     }
 
     @Override
-    public void addGui(JPanel testPanel)
-    {
+    public void addGui(JPanel testPanel) {
         GBC a = GBC.eol();
         a.anchor = GridBagConstraints.EAST;
 
-        testPanel.add( new JLabel(name), GBC.eol().insets(3,0,0,0) );
+        testPanel.add(new JLabel(name), GBC.eol().insets(3,0,0,0));
 
         prefCheckKeys = new JCheckBox(tr("Check property keys."), Main.pref.getBoolean(PREF_CHECK_KEYS, true));
@@ -640,15 +578,16 @@
         testPanel.add(prefCheckComplexBeforeUpload, a);
 
-        Sources = new JList(new DefaultListModel());
+        sourcesList = new JList(new DefaultListModel());
 
         String sources = Main.pref.get( PREF_SOURCES );
-        if(sources != null && sources.length() > 0)
-        {
-            for(String source : sources.split(";"))
-                ((DefaultListModel)Sources.getModel()).addElement(source);
+        if (sources != null && sources.length() > 0) {
+            for (String source : sources.split(";")) {
+                ((DefaultListModel)sourcesList.getModel()).addElement(source);
+            }
         }
 
         addSrcButton = new JButton(tr("Add"));
-        addSrcButton.addActionListener(new ActionListener(){
+        addSrcButton.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
                 String source = JOptionPane.showInputDialog(
@@ -656,31 +595,28 @@
                         tr("TagChecker source"),
                         tr("TagChecker source"),
-                        JOptionPane.QUESTION_MESSAGE
-                );
-                if (source != null)
-                    ((DefaultListModel)Sources.getModel()).addElement(source);
-                Sources.clearSelection();
+                        JOptionPane.QUESTION_MESSAGE);
+                if (source != null) {
+                    ((DefaultListModel)sourcesList.getModel()).addElement(source);
+                }
+                sourcesList.clearSelection();
             }
         });
 
         editSrcButton = new JButton(tr("Edit"));
-        editSrcButton.addActionListener(new ActionListener(){
+        editSrcButton.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
-                int row = Sources.getSelectedIndex();
-                if(row == -1 && Sources.getModel().getSize() == 1)
-                {
-                    Sources.setSelectedIndex(0);
+                int row = sourcesList.getSelectedIndex();
+                if (row == -1 && sourcesList.getModel().getSize() == 1) {
+                    sourcesList.setSelectedIndex(0);
                     row = 0;
                 }
-                if (row == -1)
-                {
-                    if(Sources.getModel().getSize() == 0)
-                    {
+                if (row == -1) {
+                    if (sourcesList.getModel().getSize() == 0) {
                         String source = JOptionPane.showInputDialog(Main.parent, tr("TagChecker source"), tr("TagChecker source"), JOptionPane.QUESTION_MESSAGE);
-                        if (source != null)
-                            ((DefaultListModel)Sources.getModel()).addElement(source);
-                    }
-                    else
-                    {
+                        if (source != null) {
+                            ((DefaultListModel)sourcesList.getModel()).addElement(source);
+                        }
+                    } else {
                         JOptionPane.showMessageDialog(
                                 Main.parent,
@@ -690,32 +626,33 @@
                         );
                     }
-                }
-                else {
+                } else {
                     String source = (String)JOptionPane.showInputDialog(Main.parent,
                             tr("TagChecker source"),
                             tr("TagChecker source"),
                             JOptionPane.QUESTION_MESSAGE, null, null,
-                            Sources.getSelectedValue());
-                    if (source != null)
-                        ((DefaultListModel)Sources.getModel()).setElementAt(source, row);
-                }
-                Sources.clearSelection();
+                            sourcesList.getSelectedValue());
+                    if (source != null) {
+                        ((DefaultListModel)sourcesList.getModel()).setElementAt(source, row);
+                    }
+                }
+                sourcesList.clearSelection();
             }
         });
 
         deleteSrcButton = new JButton(tr("Delete"));
-        deleteSrcButton.addActionListener(new ActionListener(){
+        deleteSrcButton.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
-                if (Sources.getSelectedIndex() == -1)
+                if (sourcesList.getSelectedIndex() == -1) {
                     JOptionPane.showMessageDialog(Main.parent, tr("Please select the row to delete."), tr("Information"), JOptionPane.QUESTION_MESSAGE);
-                else {
-                    ((DefaultListModel)Sources.getModel()).remove(Sources.getSelectedIndex());
+                } else {
+                    ((DefaultListModel)sourcesList.getModel()).remove(sourcesList.getSelectedIndex());
                 }
             }
         });
-        Sources.setMinimumSize(new Dimension(300,50));
-        Sources.setVisibleRowCount(3);
-
-        Sources.setToolTipText(tr("The sources (URL or filename) of spell check (see http://wiki.openstreetmap.org/index.php/User:JLS/speller) or tag checking data files."));
+        sourcesList.setMinimumSize(new Dimension(300,50));
+        sourcesList.setVisibleRowCount(3);
+
+        sourcesList.setToolTipText(tr("The sources (URL or filename) of spell check (see http://wiki.openstreetmap.org/index.php/User:JLS/speller) or tag checking data files."));
         addSrcButton.setToolTipText(tr("Add a new source to the list."));
         editSrcButton.setToolTipText(tr("Edit the selected source."));
@@ -723,5 +660,5 @@
 
         testPanel.add(new JLabel(tr("Data sources")), GBC.eol().insets(23,0,0,0));
-        testPanel.add(new JScrollPane(Sources), GBC.eol().insets(23,0,0,0).fill(GridBagConstraints.HORIZONTAL));
+        testPanel.add(new JScrollPane(sourcesList), GBC.eol().insets(23,0,0,0).fill(GridBagConstraints.HORIZONTAL));
         final JPanel buttonPanel = new JPanel(new GridBagLayout());
         testPanel.add(buttonPanel, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
@@ -730,5 +667,6 @@
         buttonPanel.add(deleteSrcButton, GBC.std().insets(0,5,0,0));
 
-        ActionListener disableCheckActionListener = new ActionListener(){
+        ActionListener disableCheckActionListener = new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
                 handlePrefEnable();
@@ -771,9 +709,8 @@
     }
 
-    public void handlePrefEnable()
-    {
+    public void handlePrefEnable() {
         boolean selected = prefCheckKeys.isSelected() || prefCheckKeysBeforeUpload.isSelected()
-        || prefCheckComplex.isSelected() || prefCheckComplexBeforeUpload.isSelected();
-        Sources.setEnabled( selected );
+                    || prefCheckComplex.isSelected() || prefCheckComplexBeforeUpload.isSelected();
+        sourcesList.setEnabled( selected );
         addSrcButton.setEnabled(selected);
         editSrcButton.setEnabled(selected);
@@ -786,5 +723,5 @@
         enabled = prefCheckKeys.isSelected() || prefCheckValues.isSelected() || prefCheckComplex.isSelected() || prefCheckFixmes.isSelected();
         testBeforeUpload = prefCheckKeysBeforeUpload.isSelected() || prefCheckValuesBeforeUpload.isSelected()
-        || prefCheckFixmesBeforeUpload.isSelected() || prefCheckComplexBeforeUpload.isSelected();
+                || prefCheckFixmesBeforeUpload.isSelected() || prefCheckComplexBeforeUpload.isSelected();
 
         Main.pref.put(PREF_CHECK_VALUES, prefCheckValues.isSelected());
@@ -800,71 +737,67 @@
         Main.pref.put(PREF_USE_SPELL_FILE, prefUseSpellFile.isSelected());
         String sources = "";
-        if( Sources.getModel().getSize() > 0 )
-        {
+        if (sourcesList.getModel().getSize() > 0) {
             String sb = "";
-            for (int i = 0; i < Sources.getModel().getSize(); ++i)
-                sb += ";"+Sources.getModel().getElementAt(i);
+            for (int i = 0; i < sourcesList.getModel().getSize(); ++i) {
+                sb += ";"+sourcesList.getModel().getElementAt(i);
+            }
             sources = sb.substring(1);
         }
-        if(sources.length() == 0)
+        if (sources.length() == 0) {
             sources = null;
+        }
         return Main.pref.put(PREF_SOURCES, sources);
     }
 
     @Override
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
+
         List<Command> commands = new ArrayList<Command>(50);
 
         int i = -1;
         List<? extends OsmPrimitive> primitives = testError.getPrimitives();
-        for(OsmPrimitive p : primitives )
-        {
+        for (OsmPrimitive p : primitives) {
             i++;
             Map<String, String> tags = p.getKeys();
-            if( tags == null || tags.size() == 0 )
+            if (tags == null || tags.isEmpty()) {
                 continue;
-
-            for(Entry<String, String> prop: tags.entrySet() )
-            {
+            }
+
+            for (Entry<String, String> prop: tags.entrySet()) {
                 String key = prop.getKey();
                 String value = prop.getValue();
-                if( value == null || value.trim().length() == 0 )
-                    commands.add( new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, null) );
-                else if(value.startsWith(" ") || value.endsWith(" "))
-                    commands.add( new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, value.trim()) );
-                else if(key.startsWith(" ") || key.endsWith(" "))
-                    commands.add( new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)), key, key.trim()) );
-                else
-                {
+                if (value == null || value.trim().length() == 0) {
+                    commands.add(new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, null));
+                } else if (value.startsWith(" ") || value.endsWith(" ")) {
+                    commands.add(new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, value.trim()));
+                } else if (key.startsWith(" ") || key.endsWith(" ")) {
+                    commands.add(new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)), key, key.trim()));
+                } else {
                     String evalue = entities.unescape(value);
-                    if(!evalue.equals(value))
-                        commands.add( new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, evalue) );
-                    else
-                    {
+                    if (!evalue.equals(value)) {
+                        commands.add(new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, evalue));
+                    } else {
                         String replacementKey = spellCheckKeyData.get(key);
-                        if( replacementKey != null )
-                        {
-                            commands.add( new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)),
-                                    key, replacementKey) );
-                        }
-                    }
-                }
-            }
-        }
-
-        if( commands.size() == 0 )
+                        if (replacementKey != null) {
+                            commands.add(new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)),
+                                    key, replacementKey));
+                        }
+                    }
+                }
+            }
+        }
+
+        if (commands.isEmpty())
             return null;
-        else if( commands.size() == 1 )
+        if (commands.size() == 1)
             return commands.get(0);
-        else
-            return new SequenceCommand(tr("Fix properties"), commands);
+        
+        return new SequenceCommand(tr("Fix properties"), commands);
     }
 
     @Override
-    public boolean isFixable(TestError testError)
-    {
-        if( testError.getTester() instanceof TagChecker)
-        {
+    public boolean isFixable(TestError testError) {
+
+        if (testError.getTester() instanceof TagChecker) {
             int code = testError.getCode();
             return code == INVALID_KEY || code == EMPTY_VALUES || code == INVALID_SPACE || code == INVALID_KEY_SPACE || code == INVALID_HTML;
@@ -903,18 +836,20 @@
             public boolean valueAll = false;
             public boolean valueBool = false;
-            private Pattern getPattern(String str) throws IllegalStateException, PatternSyntaxException
-            {
-                if(str.endsWith("/i"))
+            private Pattern getPattern(String str) throws IllegalStateException, PatternSyntaxException {
+                if (str.endsWith("/i"))
                     return Pattern.compile(str.substring(1,str.length()-2), Pattern.CASE_INSENSITIVE);
-                else if(str.endsWith("/"))
+                if (str.endsWith("/"))
                     return Pattern.compile(str.substring(1,str.length()-1));
+
                 throw new IllegalStateException();
             }
-            public CheckerElement(String exp) throws IllegalStateException, PatternSyntaxException
-            {
+            public CheckerElement(String exp) throws IllegalStateException, PatternSyntaxException {
                 Matcher m = Pattern.compile("(.+)([!=]=)(.+)").matcher(exp);
                 m.matches();
 
                 String n = m.group(1).trim();
+
+                // FIXME FIXME: indentation and { } pairs don't match, probably coding error
+
                 if(n.equals("*"))
                     tagAll = true;
@@ -938,10 +873,11 @@
                         value = n.startsWith("/") ? getPattern(n) : n;
             }
+
             public boolean match(OsmPrimitive osm, Map<String, String> keys) {
-                for(Entry<String, String> prop: keys.entrySet()) {
+                for (Entry<String, String> prop: keys.entrySet()) {
                     String key = prop.getKey();
                     String val = valueBool ? OsmUtils.getNamedOsmBoolean(prop.getValue()) : prop.getValue();
-                    if((tagAll || (tag instanceof Pattern ? ((Pattern)tag).matcher(key).matches() : key.equals(tag)))
-                            && (valueAll || (value instanceof Pattern ? ((Pattern)value).matcher(val).matches() : val.equals(value))))
+                    if ((tagAll || (tag instanceof Pattern ? ((Pattern) tag).matcher(key).matches() : key.equals(tag)))
+                            && (valueAll || (value instanceof Pattern ? ((Pattern) value).matcher(val).matches() : val.equals(value))))
                         return !noMatch;
                 }
@@ -950,61 +886,47 @@
         };
 
-        public String getData(String str)
-        {
+        public String getData(String str) {
             Matcher m = Pattern.compile(" *# *([^#]+) *$").matcher(str);
             str = m.replaceFirst("").trim();
-            try
-            {
+            try {
                 description = m.group(1);
-                if(description != null && description.length() == 0)
+                if (description != null && description.length() == 0) {
                     description = null;
-            }
-            catch (IllegalStateException e)
-            {
+                }
+            } catch (IllegalStateException e) {
                 description = null;
             }
             String[] n = str.split(" *: *", 3);
-            if(n[0].equals("way"))
+            if (n[0].equals("way")) {
                 type = OsmPrimitiveType.WAY;
-            else if(n[0].equals("node"))
+            } else if (n[0].equals("node")) {
                 type = OsmPrimitiveType.NODE;
-            else if(n[0].equals("relation"))
+            } else if (n[0].equals("relation")) {
                 type = OsmPrimitiveType.RELATION;
-            else if(n[0].equals("*"))
+            } else if (n[0].equals("*")) {
                 type = null;
-            else
+            } else
                 return tr("Could not find element type");
             if (n.length != 3)
                 return tr("Incorrect number of parameters");
 
-            if(n[1].equals("W"))
-            {
+            if (n[1].equals("W")) {
                 severity = Severity.WARNING;
                 code = TAG_CHECK_WARN;
-            }
-            else if(n[1].equals("E"))
-            {
+            } else if (n[1].equals("E")) {
                 severity = Severity.ERROR;
                 code = TAG_CHECK_ERROR;
-            }
-            else if(n[1].equals("I"))
-            {
+            } else if(n[1].equals("I")) {
                 severity = Severity.OTHER;
                 code = TAG_CHECK_INFO;
-            }
-            else
+            } else
                 return tr("Could not find warning level");
-            for(String exp: n[2].split(" *&& *"))
-            {
-                try
-                {
+            for (String exp: n[2].split(" *&& *")) {
+                try {
                     data.add(new CheckerElement(exp));
-                }
-                catch(IllegalStateException e)
-                {
+                } catch (IllegalStateException e) {
                     return tr("Illegal expression ''{0}''", exp);
                 }
-                catch(PatternSyntaxException e)
-                {
+                catch (PatternSyntaxException e) {
                     return tr("Illegal regular expression ''{0}''", exp);
                 }
@@ -1012,34 +934,33 @@
             return null;
         }
-        public boolean match(OsmPrimitive osm, Map<String, String> keys)
-        {
+
+        public boolean match(OsmPrimitive osm, Map<String, String> keys) {
             if (type != null && OsmPrimitiveType.from(osm) != type)
                 return false;
 
-            for(CheckerElement ce : data) {
-                if(!ce.match(osm, keys))
+            for (CheckerElement ce : data) {
+                if (!ce.match(osm, keys))
                     return false;
             }
             return true;
         }
-        public String getDescription()
-        {
+
+        public String getDescription() {
             return tr(description);
         }
-        public String getDescriptionOrig()
-        {
+
+        public String getDescriptionOrig() {
             return description;
         }
-        public Severity getSeverity()
-        {
+
+        public Severity getSeverity() {
             return severity;
         }
 
         public int getCode() {
-            if (type == null) {
+            if (type == null)
                 return code;
-            } else {
-                return code + type.ordinal() + 1;
-            }
+
+            return code + type.ordinal() + 1;
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java	(revision 3671)
@@ -33,6 +33,5 @@
 
     public TurnrestrictionTest() {
-        super(tr("Turnrestriction"),
-                tr("This test checks if turnrestrictions are valid"));
+        super(tr("Turnrestriction"), tr("This test checks if turnrestrictions are valid"));
     }
 
@@ -51,69 +50,65 @@
 
         /* find the "from", "via" and "to" elements */
-        for (RelationMember m : r.getMembers())
-        {
-            if(m.getMember().isIncomplete())
+        for (RelationMember m : r.getMembers()) {
+            if (m.getMember().isIncomplete())
                 return;
-            else
-            {
-                ArrayList<OsmPrimitive> l = new ArrayList<OsmPrimitive>();
-                l.add(r);
-                l.add(m.getMember());
-                if(m.isWay())
-                {
-                    Way w = m.getWay();
-                    if(w.getNodesCount() < 2) {
-                        continue;
+
+            ArrayList<OsmPrimitive> l = new ArrayList<OsmPrimitive>();
+            l.add(r);
+            l.add(m.getMember());
+            if (m.isWay()) {
+                Way w = m.getWay();
+                if (w.getNodesCount() < 2) {
+                    continue;
+                }
+
+                if ("from".equals(m.getRole())) {
+                    if (fromWay != null) {
+                        morefrom = true;
+                    } else {
+                        fromWay = w;
                     }
-
-                    if("from".equals(m.getRole())) {
-                        if(fromWay != null) {
-                            morefrom = true;
-                        } else {
-                            fromWay = w;
-                        }
-                    } else if("to".equals(m.getRole())) {
-                        if(toWay != null) {
-                            moreto = true;
-                        } else {
-                            toWay = w;
-                        }
-                    } else if("via".equals(m.getRole())) {
-                        if(via != null) {
-                            morevia = true;
-                        } else {
-                            via = w;
-                        }
+                } else if ("to".equals(m.getRole())) {
+                    if (toWay != null) {
+                        moreto = true;
                     } else {
-                        errors.add(new TestError(this, Severity.WARNING, tr("Unknown role"), UNKNOWN_ROLE,
-                        l, Collections.singletonList(m)));
+                        toWay = w;
                     }
-                }
-                else if(m.isNode())
-                {
-                    Node n = m.getNode();
-                    if("via".equals(m.getRole()))
-                    {
-                        if(via != null) {
-                            morevia = true;
-                        } else {
-                            via = n;
-                        }
+                } else if ("via".equals(m.getRole())) {
+                    if (via != null) {
+                        morevia = true;
                     } else {
-                        errors.add(new TestError(this, Severity.WARNING, tr("Unknown role"), UNKNOWN_ROLE,
-                        l, Collections.singletonList(m)));
+                        via = w;
                     }
                 } else {
-                    errors.add(new TestError(this, Severity.WARNING, tr("Unknown member type"), UNKNOWN_TYPE,
-                    l, Collections.singletonList(m)));
+                    errors.add(new TestError(this, Severity.WARNING, tr("Unknown role"), UNKNOWN_ROLE,
+                            l, Collections.singletonList(m)));
                 }
+            } else if (m.isNode()) {
+                Node n = m.getNode();
+                if ("via".equals(m.getRole())) {
+                    if (via != null) {
+                        morevia = true;
+                    } else {
+                        via = n;
+                    }
+                } else {
+                    errors.add(new TestError(this, Severity.WARNING, tr("Unknown role"), UNKNOWN_ROLE,
+                            l, Collections.singletonList(m)));
+                }
+            } else {
+                errors.add(new TestError(this, Severity.WARNING, tr("Unknown member type"), UNKNOWN_TYPE,
+                        l, Collections.singletonList(m)));
             }
         }
-        if(morefrom)
+        if (morefrom) {
             errors.add(new TestError(this, Severity.ERROR, tr("More than one \"from\" way found"), MORE_FROM, r));
-        if(moreto)
+        }
+        if (moreto) {
             errors.add(new TestError(this, Severity.ERROR, tr("More than one \"to\" way found"), MORE_TO, r));
-        if(morevia)
+        }
+        if (morevia) {
             errors.add(new TestError(this, Severity.ERROR, tr("More than one \"via\" way found"), MORE_VIA, r));
+        }
 
         if (fromWay == null) {
@@ -131,19 +126,17 @@
 
         Node viaNode;
-        if(via instanceof Node)
-        {
+        if (via instanceof Node) {
             viaNode = (Node) via;
-            if(!fromWay.isFirstLastNode(viaNode)) {
+            if (!fromWay.isFirstLastNode(viaNode)) {
                 errors.add(new TestError(this, Severity.ERROR,
-                tr("The \"from\" way does not start or end at a \"via\" node"), FROM_VIA_NODE, r));
+                        tr("The \"from\" way does not start or end at a \"via\" node"), FROM_VIA_NODE, r));
                 return;
             }
-            if(!toWay.isFirstLastNode(viaNode)) {
+            if (!toWay.isFirstLastNode(viaNode)) {
                 errors.add(new TestError(this, Severity.ERROR,
-                tr("The \"to\" way does not start or end at a \"via\" node"), TO_VIA_NODE, r));
+                        tr("The \"to\" way does not start or end at a \"via\" node"), TO_VIA_NODE, r));
+                //FIXME: return; ?
             }
-        }
-        else
-        {
+        } else {
             Way viaWay = (Way) via;
             Node firstNode = viaWay.firstNode();
@@ -152,7 +145,6 @@
 
             String onewayviastr = viaWay.get("oneway");
-            if(onewayviastr != null)
-            {
-                if("-1".equals(onewayviastr)) {
+            if (onewayviastr != null) {
+                if ("-1".equals(onewayviastr)) {
                     onewayvia = true;
                     Node tmp = firstNode;
@@ -167,17 +159,16 @@
             }
 
-            if(fromWay.isFirstLastNode(firstNode))
+            if (fromWay.isFirstLastNode(firstNode)) {
                 viaNode = firstNode;
-            else if(!onewayvia && fromWay.isFirstLastNode(lastNode))
+            } else if (!onewayvia && fromWay.isFirstLastNode(lastNode)) {
                 viaNode = lastNode;
-            else
-            {
+            } else {
                 errors.add(new TestError(this, Severity.ERROR,
-                tr("The \"from\" way does not start or end at a \"via\" way."), FROM_VIA_WAY, r));
+                        tr("The \"from\" way does not start or end at a \"via\" way."), FROM_VIA_WAY, r));
                 return;
             }
-            if(!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode)) {
+            if (!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode)) {
                 errors.add(new TestError(this, Severity.ERROR,
-                tr("The \"to\" way does not start or end at a \"via\" way."), TO_VIA_WAY, r));
+                        tr("The \"to\" way does not start or end at a \"via\" way."), TO_VIA_WAY, r));
             }
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java	(revision 3671)
@@ -27,5 +27,5 @@
 public class UnclosedWays extends Test {
     /** The already detected errors */
-    Bag<Way, Way> _errorWays;
+    protected Bag<Way, Way> errorWays;
 
     /**
@@ -39,10 +39,10 @@
     public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
-        _errorWays = new Bag<Way, Way>();
+        errorWays = new Bag<Way, Way>();
     }
 
     @Override
     public void endTest() {
-        _errorWays = null;
+        errorWays = null;
         super.endTest();
     }
@@ -74,33 +74,43 @@
 
         test = w.get("natural");
-        if (test != null && !"coastline".equals(test) && !"cliff".equals(test))
+        if (test != null && !"coastline".equals(test) && !"cliff".equals(test)) {
             set(1101, marktr("natural type {0}"), test);
+        }
         test = w.get("landuse");
-        if (test != null)
+        if (test != null) {
             set(1102, marktr("landuse type {0}"), test);
+        }
         test = w.get("amenities");
-        if (test != null)
+        if (test != null) {
             set(1103, marktr("amenities type {0}"), test);
+        }
         test = w.get("sport");
-        if (test != null && !test.equals("water_slide"))
+        if (test != null && !test.equals("water_slide")) {
             set(1104, marktr("sport type {0}"), test);
+        }
         test = w.get("tourism");
-        if (test != null)
+        if (test != null) {
             set(1105, marktr("tourism type {0}"), test);
+        }
         test = w.get("shop");
-        if (test != null)
+        if (test != null) {
             set(1106, marktr("shop type {0}"), test);
+        }
         test = w.get("leisure");
-        if (test != null)
+        if (test != null) {
             set(1107, marktr("leisure type {0}"), test);
+        }
         test = w.get("waterway");
-        if (test != null && test.equals("riverbank"))
+        if (test != null && test.equals("riverbank")) {
             set(1108, marktr("waterway type {0}"), test);
+        }
         Boolean btest = OsmUtils.getOsmBoolean(w.get("building"));
-        if (btest != null && btest)
+        if (btest != null && btest) {
             set(1120, marktr("building"));
+        }
         btest = OsmUtils.getOsmBoolean(w.get("area"));
-        if (btest != null && btest)
+        if (btest != null && btest) {
             set(1130, marktr("area"));
+        }
 
         if (type != null && !w.isClosed()) {
@@ -123,5 +133,5 @@
             errors.add(new TestError(this, Severity.WARNING, tr("Unclosed way"),
                             type, etype, mode, primitives, highlight));
-            _errorWays.add(w, w);
+            errorWays.add(w, w);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 3671)
@@ -37,6 +37,6 @@
  * @author frsantos
  */
-public class UnconnectedWays extends Test
-{
+public class UnconnectedWays extends Test {
+
     protected static int UNCONNECTED_WAYS = 1301;
     protected static final String PREFIX = ValidatorPreference.PREFIX + "." + UnconnectedWays.class.getSimpleName();
@@ -54,9 +54,9 @@
     double mindist;
     double minmiddledist;
+
     /**
      * Constructor
      */
-    public UnconnectedWays()
-    {
+    public UnconnectedWays() {
         super(tr("Unconnected ways."),
               tr("This test checks if a way has an endpoint very near to another way."));
@@ -64,6 +64,5 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         ways = new HashSet<MyWaySegment>();
@@ -79,55 +78,50 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         //Area a = Main.ds.getDataSourceArea();
         Map<Node, Way> map = new HashMap<Node, Way>();
-        long last = -1;
+        //long last = -1;
         for (int iter = 0; iter < 1; iter++) {
-        last = System.currentTimeMillis();
-        long last_print = -1;
-        int nr = 0;
-        Collection<MyWaySegment> tmp_ways = ways;
-        for(MyWaySegment s : tmp_ways) {
-            nr++;
-            long now = System.currentTimeMillis();
-            if (now - last_print > 200) {
-                //System.err.println("processing segment nr: " + nr + " of " + ways.size());
-                last_print = now;
-            }
-            for(Node en : s.nearbyNodes(mindist)) {
-                if (en == null)
-                    continue;
-                if(!s.highway)
-                    continue;
-                if (!endnodes_highway.contains(en))
-                    continue;
-                if("turning_circle".equals(en.get("highway")) 
-                    || "bus_stop".equals(en.get("highway")) 
-                    || OsmUtils.isTrue(en.get("noexit"))
-                    || en.hasKey("barrier"))
-                    continue;
-                // There's a small false-positive here.  Imagine an intersection
-                // like a 't'.  If the top part of the 't' is short enough, it
-                // will trigger the node at the very top of the 't' to be unconnected
-                // to the way that "crosses" the 't'.  We should probably check that
-                // the ways to which 'en' belongs are not connected to 's.w'.
-                map.put(en, s.w);
-            }
-        }
-        //System.out.println("p1 elapsed: " + (System.currentTimeMillis()-last));
-        last = System.currentTimeMillis();
-        }
-        for(Map.Entry<Node, Way> error : map.entrySet())
-        {
+            //last = System.currentTimeMillis();
+            long last_print = -1;
+            int nr = 0;
+            Collection<MyWaySegment> tmp_ways = ways;
+            for (MyWaySegment s : tmp_ways) {
+                nr++;
+                long now = System.currentTimeMillis();
+                if (now - last_print > 200) {
+                    //System.err.println("processing segment nr: " + nr + " of " + ways.size());
+                    last_print = now;
+                }
+                for (Node en : s.nearbyNodes(mindist)) {
+                    if (en == null || !s.highway || !endnodes_highway.contains(en)) {
+                        continue;
+                    }
+                    if ("turning_circle".equals(en.get("highway"))
+                        || "bus_stop".equals(en.get("highway"))
+                        || OsmUtils.isTrue(en.get("noexit"))
+                        || en.hasKey("barrier")) {
+                        continue;
+                    }
+                    // There's a small false-positive here.  Imagine an intersection
+                    // like a 't'.  If the top part of the 't' is short enough, it
+                    // will trigger the node at the very top of the 't' to be unconnected
+                    // to the way that "crosses" the 't'.  We should probably check that
+                    // the ways to which 'en' belongs are not connected to 's.w'.
+                    map.put(en, s.w);
+                }
+            }
+            //System.out.println("p1 elapsed: " + (System.currentTimeMillis()-last));
+            //last = System.currentTimeMillis();
+        }
+        for (Map.Entry<Node, Way> error : map.entrySet()) {
             errors.add(new TestError(this, Severity.WARNING,
-            tr("Way end node near other highway"), UNCONNECTED_WAYS,
-            Arrays.asList(error.getKey(), error.getValue())));
+                    tr("Way end node near other highway"),
+                    UNCONNECTED_WAYS,
+                    Arrays.asList(error.getKey(), error.getValue())));
         }
         map.clear();
-        for(MyWaySegment s : ways)
-        {
-            for(Node en : s.nearbyNodes(mindist))
-            {
+        for (MyWaySegment s : ways) {
+            for (Node en : s.nearbyNodes(mindist)) {
                 if (endnodes_highway.contains(en) && !s.highway && !s.isArea()) {
                     map.put(en, s.w);
@@ -138,49 +132,46 @@
         }
         //System.out.println("p2 elapsed: " + (System.currentTimeMillis()-last));
-        last = System.currentTimeMillis();
-        for(Map.Entry<Node, Way> error : map.entrySet())
-        {
+        //last = System.currentTimeMillis();
+        for (Map.Entry<Node, Way> error : map.entrySet()) {
             errors.add(new TestError(this, Severity.WARNING,
-            tr("Way end node near other way"), UNCONNECTED_WAYS,
-            Arrays.asList(error.getKey(), error.getValue())));
+                    tr("Way end node near other way"),
+                    UNCONNECTED_WAYS,
+                    Arrays.asList(error.getKey(), error.getValue())));
         }
         /* the following two use a shorter distance */
-        if(minmiddledist > 0.0)
-        {
+        if (minmiddledist > 0.0) {
             map.clear();
-            for(MyWaySegment s : ways)
-            {
-                for(Node en : s.nearbyNodes(minmiddledist))
-                {
-                    if (!middlenodes.contains(en))
+            for (MyWaySegment s : ways) {
+                for (Node en : s.nearbyNodes(minmiddledist)) {
+                    if (!middlenodes.contains(en)) {
                         continue;
+                    }
                     map.put(en, s.w);
                 }
             }
             //System.out.println("p3 elapsed: " + (System.currentTimeMillis()-last));
-            last = System.currentTimeMillis();
-            for(Map.Entry<Node, Way> error : map.entrySet())
-            {
+            //last = System.currentTimeMillis();
+            for (Map.Entry<Node, Way> error : map.entrySet()) {
                 errors.add(new TestError(this, Severity.OTHER,
-                tr("Way node near other way"), UNCONNECTED_WAYS,
-                Arrays.asList(error.getKey(), error.getValue())));
+                        tr("Way node near other way"),
+                        UNCONNECTED_WAYS,
+                        Arrays.asList(error.getKey(), error.getValue())));
             }
             map.clear();
-            for(MyWaySegment s : ways)
-            {
-                for(Node en : s.nearbyNodes(minmiddledist))
-                {
-                    if (!othernodes.contains(en))
+            for (MyWaySegment s : ways) {
+                for (Node en : s.nearbyNodes(minmiddledist)) {
+                    if (!othernodes.contains(en)) {
                         continue;
+                    }
                     map.put(en, s.w);
                 }
             }
             //System.out.println("p4 elapsed: " + (System.currentTimeMillis()-last));
-            last = System.currentTimeMillis();
-            for(Map.Entry<Node, Way> error : map.entrySet())
-            {
+            //last = System.currentTimeMillis();
+            for (Map.Entry<Node, Way> error : map.entrySet()) {
                 errors.add(new TestError(this, Severity.OTHER,
-                tr("Connected way end node near other way"), UNCONNECTED_WAYS,
-                Arrays.asList(error.getKey(), error.getValue())));
+                        tr("Connected way end node near other way"),
+                        UNCONNECTED_WAYS,
+                        Arrays.asList(error.getKey(), error.getValue())));
             }
         }
@@ -189,9 +180,8 @@
         super.endTest();
         //System.out.println("p99 elapsed: " + (System.currentTimeMillis()-last));
-        last = System.currentTimeMillis();
-    }
-
-    private class MyWaySegment
-    {
+        //last = System.currentTimeMillis();
+    }
+
+    private class MyWaySegment {
         private final Line2D line;
         public final Way w;
@@ -205,6 +195,5 @@
         final Node n2;
 
-        public MyWaySegment(Way w, Node n1, Node n2)
-        {
+        public MyWaySegment(Way w, Node n1, Node n2) {
             this.w = w;
             String railway = w.get("railway");
@@ -220,8 +209,5 @@
         }
 
-        public boolean nearby(Node n, double dist)
-        {
-//            return !w.containsNode(n)
-//            && line.ptSegDist(n.getEastNorth().east(), n.getEastNorth().north()) < dist;
+        public boolean nearby(Node n, double dist) {
             if (w == null) {
                 Main.debug("way null");
@@ -240,6 +226,6 @@
             return line.ptSegDist(p) < dist;
         }
-        public List<LatLon> getBounds(double fudge)
-        {
+
+        public List<LatLon> getBounds(double fudge) {
             double x1 = n1.getCoor().lon();
             double x2 = n2.getCoor().lon();
@@ -264,6 +250,5 @@
         }
 
-        public Collection<Node> nearbyNodes(double dist)
-        {
+        public Collection<Node> nearbyNodes(double dist) {
             // If you're looking for nodes that are farther
             // away that we looked for last time, the cached
@@ -284,6 +269,7 @@
                     Set<Node> trimmed = new HashSet<Node>(nearbyNodeCache);
                     for (Node n : new HashSet<Node>(nearbyNodeCache)) {
-                        if (!nearby(n, dist))
+                        if (!nearby(n, dist)) {
                             trimmed.remove(n);
+                        }
                     }
                     return trimmed;
@@ -307,16 +293,19 @@
             for (Node n : found_nodes) {
                 if (!nearby(n, dist) ||
-                     (ds_area != null && !ds_area.contains(n.getCoor())))
+                     (ds_area != null && !ds_area.contains(n.getCoor()))) {
                     continue;
+                }
                 // It is actually very rare for us to find a node
                 // so defer as much of the work as possible, like
                 // allocating the hash set
-                if (nearbyNodeCache == null)
+                if (nearbyNodeCache == null) {
                     nearbyNodeCache = new HashSet<Node>();
+                }
                 nearbyNodeCache.add(n);
             }
             nearbyNodeCacheDist = dist;
-            if (nearbyNodeCache == null)
+            if (nearbyNodeCache == null) {
                 nearbyNodeCache = Collections.emptySet();
+            }
             return nearbyNodeCache;
         }
@@ -330,6 +319,5 @@
     }
 
-    List<MyWaySegment> getWaySegments(Way w)
-    {
+    List<MyWaySegment> getWaySegments(Way w) {
         List<MyWaySegment> ret = new ArrayList<MyWaySegment>();
         if (!w.isUsable()
@@ -339,13 +327,14 @@
 
         int size = w.getNodesCount();
-        if(size < 2)
+        if (size < 2)
             return ret;
-        for(int i = 1; i < size; ++i)
-        {
-            if(i < size-1)
+        for (int i = 1; i < size; ++i) {
+            if(i < size-1) {
                 addNode(w.getNode(i), middlenodes);
+            }
             MyWaySegment ws = new MyWaySegment(w, w.getNode(i-1), w.getNode(i));
-            if (ws.isBoundary || ws.isAbandoned)
+            if (ws.isBoundary || ws.isAbandoned) {
                 continue;
+            }
             ret.add(ws);
         }
@@ -354,34 +343,34 @@
 
     @Override
-    public void visit(Way w)
-    {
+    public void visit(Way w) {
         ways.addAll(getWaySegments(w));
         Set<Node> set = endnodes;
-        if(w.hasKey("highway") || w.hasKey("railway"))
+        if (w.hasKey("highway") || w.hasKey("railway")) {
             set = endnodes_highway;
+        }
         addNode(w.firstNode(), set);
         addNode(w.lastNode(), set);
     }
+
     @Override
-    public void visit(Node n)
-    {
-    }
-    private void addNode(Node n, Set<Node> s)
-    {
+    public void visit(Node n) {
+    }
+
+    private void addNode(Node n, Set<Node> s) {
         boolean m = middlenodes.contains(n);
         boolean e = endnodes.contains(n);
         boolean eh = endnodes_highway.contains(n);
         boolean o = othernodes.contains(n);
-        if(!m && !e && !o && !eh)
+        if (!m && !e && !o && !eh) {
             s.add(n);
-        else if(!o)
-        {
+        } else if (!o) {
             othernodes.add(n);
-            if(e)
+            if (e) {
                 endnodes.remove(n);
-            else if(eh)
+            } else if (eh) {
                 endnodes_highway.remove(n);
-            else
+            } else {
                 middlenodes.remove(n);
+            }
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java	(revision 3671)
@@ -23,6 +23,6 @@
  * @author frsantos
  */
-public class UntaggedNode extends Test
-{
+public class UntaggedNode extends Test {
+
     protected static final int UNTAGGED_NODE_BLANK = 201;
     protected static final int UNTAGGED_NODE_FIXME = 202;
@@ -36,6 +36,5 @@
      * Constructor
      */
-    public UntaggedNode()
-    {
+    public UntaggedNode() {
         super(tr("Untagged and unconnected nodes")+".",
                 tr("This test checks for untagged nodes that are not part of any way."));
@@ -43,12 +42,10 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
     }
 
     @Override
-    public void visit(Collection<OsmPrimitive> selection)
-    {
+    public void visit(Collection<OsmPrimitive> selection) {
         for (OsmPrimitive p : selection) {
             if (p.isUsable() && p instanceof Node) {
@@ -59,6 +56,5 @@
 
     @Override
-    public void visit(Node n)
-    {
+    public void visit(Node n) {
         if(n.isUsable() && !n.isTagged() && n.getReferrers().isEmpty()) {
             if (!n.hasKeys()) {
@@ -69,5 +65,4 @@
             for (Map.Entry<String, String> tag : n.getKeys().entrySet()) {
                 String key = tag.getKey();
-                String value = tag.getValue();
                 if (contains(tag, "fixme") || contains(tag, "FIXME")) {
                     /* translation note: don't translate quoted words */
@@ -114,6 +109,5 @@
 
     @Override
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
         return DeleteCommand.delete(Main.map.mapView.getEditLayer(), testError.getPrimitives());
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 3671)
@@ -44,6 +44,5 @@
     /** Ways that must have a name */
     public static final Set<String> NAMED_WAYS = new HashSet<String>();
-    static
-    {
+    static {
         NAMED_WAYS.add( "motorway" );
         NAMED_WAYS.add( "trunk" );
@@ -58,6 +57,5 @@
      * Constructor
      */
-    public UntaggedWay()
-    {
+    public UntaggedWay() {
         super(tr("Untagged, empty and one node ways."),
               tr("This test checks for untagged, empty and one node ways."));
@@ -65,25 +63,21 @@
 
     @Override
-    public void visit(Way w)
-    {
-        if (!w.isUsable()) return;
+    public void visit(Way w) {
+        if (!w.isUsable())
+            return;
 
         Map<String, String> tags = w.getKeys();
-        if( tags.size() != 0 )
-        {
+        if (!tags.isEmpty()) {
             String highway = tags.get("highway");
-            if(highway != null && NAMED_WAYS.contains(highway))
-            {
-                if( !tags.containsKey("name") && !tags.containsKey("ref") )
-                {
+            if (highway != null && NAMED_WAYS.contains(highway)) {
+                if (!tags.containsKey("name") && !tags.containsKey("ref")) {
                     boolean isRoundabout = false;
                     boolean hasName = false;
-                    for( String key : w.keySet())
-                    {
+                    for (String key : w.keySet()) {
                         hasName = key.startsWith("name:") || key.endsWith("_name") || key.endsWith("_ref");
-                        if( hasName )
+                        if (hasName) {
                             break;
-                        if(key.equals("junction"))
-                        {
+                        }
+                        if (key.equals("junction")) {
                             isRoundabout = w.get("junction").equals("roundabout");
                             break;
@@ -91,45 +85,39 @@
                     }
 
-                    if( !hasName && !isRoundabout)
-                        errors.add( new TestError(this, Severity.WARNING, tr("Unnamed ways"), UNNAMED_WAY, w) );
-                    else if(isRoundabout)
-                        errors.add( new TestError(this, Severity.WARNING, tr("Unnamed junction"), UNNAMED_JUNCTION, w) );
+                    if (!hasName && !isRoundabout) {
+                        errors.add(new TestError(this, Severity.WARNING, tr("Unnamed ways"), UNNAMED_WAY, w));
+                    } else if (isRoundabout) {
+                        errors.add(new TestError(this, Severity.WARNING, tr("Unnamed junction"), UNNAMED_JUNCTION, w));
+                    }
                 }
             }
         }
 
-        if(!w.isTagged() && !multipolygonways.contains(w))
-        {
-            if(w.hasKeys())
-                errors.add( new TestError(this, Severity.WARNING, tr("Untagged ways (commented)"), COMMENTED_WAY, w) );
-            else
-                errors.add( new TestError(this, Severity.WARNING, tr("Untagged ways"), UNTAGGED_WAY, w) );
+        if (!w.isTagged() && !multipolygonways.contains(w)) {
+            if (w.hasKeys()) {
+                errors.add(new TestError(this, Severity.WARNING, tr("Untagged ways (commented)"), COMMENTED_WAY, w));
+            } else {
+                errors.add(new TestError(this, Severity.WARNING, tr("Untagged ways"), UNTAGGED_WAY, w));
+            }
         }
 
-        if( w.getNodesCount() == 0 )
-        {
-            errors.add( new TestError(this, Severity.ERROR, tr("Empty ways"), EMPTY_WAY, w) );
+        if (w.getNodesCount() == 0) {
+            errors.add(new TestError(this, Severity.ERROR, tr("Empty ways"), EMPTY_WAY, w));
+        } else if (w.getNodesCount() == 1) {
+            errors.add(new TestError(this, Severity.ERROR, tr("One node ways"), ONE_NODE_WAY, w));
         }
-        else if( w.getNodesCount() == 1 )
-        {
-            errors.add( new TestError(this, Severity.ERROR, tr("One node ways"), ONE_NODE_WAY, w) );
-        }
-
     }
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         multipolygonways = new LinkedList<Way>();
-        for (Relation r : Main.main.getCurrentDataSet().getRelations())
-        {
-            if(r.isUsable() && "multipolygon".equals(r.get("type")))
-            {
-                for (RelationMember m : r.getMembers())
-                {
-                    if(m.getMember() != null && m.getMember() instanceof Way &&
-                    m.getMember().isUsable() && !m.getMember().isTagged())
+        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
+            if (r.isUsable() && "multipolygon".equals(r.get("type"))) {
+                for (RelationMember m : r.getMembers()) {
+                    if (m.getMember() != null && m.getMember() instanceof Way &&
+                            m.getMember().isUsable() && !m.getMember().isTagged()) {
                         multipolygonways.add((Way)m.getMember());
+                    }
                 }
             }
@@ -138,6 +126,5 @@
 
     @Override
-    public void endTest()
-    {
+    public void endTest() {
         multipolygonways = null;
         super.endTest();
@@ -145,11 +132,8 @@
 
     @Override
-    public boolean isFixable(TestError testError)
-    {
-        if( testError.getTester() instanceof UntaggedWay )
-        {
+    public boolean isFixable(TestError testError) {
+        if (testError.getTester() instanceof UntaggedWay)
             return testError.getCode() == EMPTY_WAY
                 || testError.getCode() == ONE_NODE_WAY;
-        }
 
         return false;
@@ -157,6 +141,5 @@
 
     @Override
-    public Command fixError(TestError testError)
-    {
+    public Command fixError(TestError testError) {
         return DeleteCommand.delete(Main.map.mapView.getEditLayer(), testError.getPrimitives());
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java	(revision 3671)
@@ -20,5 +20,6 @@
  * @author jrreid
  */
-public class WronglyOrderedWays extends Test  {
+public class WronglyOrderedWays extends Test {
+
     protected static int WRONGLY_ORDERED_COAST = 1001;
     protected static int WRONGLY_ORDERED_WATER = 1002;
@@ -26,11 +27,10 @@
 
     /** The already detected errors */
-    Bag<Way, Way> _errorWays;
+    protected Bag<Way, Way> errorWays;
 
     /**
      * Constructor
      */
-    public WronglyOrderedWays()
-    {
+    public WronglyOrderedWays() {
         super(tr("Wrongly Ordered Ways."),
               tr("This test checks the direction of water, land and coastline ways."));
@@ -38,24 +38,21 @@
 
     @Override
-    public void startTest(ProgressMonitor monitor)
-    {
+    public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
-        _errorWays = new Bag<Way, Way>();
+        errorWays = new Bag<Way, Way>();
     }
 
     @Override
-    public void endTest()
-    {
-        _errorWays = null;
+    public void endTest() {
+        errorWays = null;
         super.endTest();
     }
 
     @Override
-    public void visit(Way w)
-    {
+    public void visit(Way w) {
         String errortype = "";
         int type;
 
-        if( !w.isUsable() )
+        if (!w.isUsable())
             return;
         if (w.getNodesCount() <= 0)
@@ -63,25 +60,18 @@
 
         String natural = w.get("natural");
-        if( natural == null)
+        if (natural == null)
             return;
 
-        if( natural.equals("coastline") )
-        {
+        if (natural.equals("coastline")) {
             errortype = tr("Reversed coastline: land not on left side");
             type= WRONGLY_ORDERED_COAST;
-        }
-        else if(natural.equals("water") )
-        {
+        } else if (natural.equals("water")) {
             errortype = tr("Reversed water: land not on left side");
             type= WRONGLY_ORDERED_WATER;
-        }
-        else if( natural.equals("land") )
-        {
+        } else if (natural.equals("land")) {
             errortype = tr("Reversed land: land not on left side");
             type= WRONGLY_ORDERED_LAND;
-        }
-        else
+        } else
             return;
-
 
         /**
@@ -93,22 +83,18 @@
          *
          */
-
-        if(w.getNode(0) == w.getNode(w.getNodesCount()-1))
-        {
+        if(w.getNode(0) == w.getNode(w.getNodesCount()-1)) {
             double area2 = 0;
 
-            for (int node = 1; node < w.getNodesCount(); node++)
-            {
+            for (int node = 1; node < w.getNodesCount(); node++) {
                 area2 += (w.getNode(node-1).getCoor().lon() * w.getNode(node).getCoor().lat()
                 - w.getNode(node).getCoor().lon() * w.getNode(node-1).getCoor().lat());
             }
 
-            if(((natural.equals("coastline") || natural.equals("land")) && area2 < 0.)
-            || (natural.equals("water") && area2 > 0.))
-            {
+            if (((natural.equals("coastline") || natural.equals("land")) && area2 < 0.)
+                    || (natural.equals("water") && area2 > 0.)) {
                 List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
                 primitives.add(w);
                 errors.add( new TestError(this, Severity.OTHER, errortype, type, primitives) );
-                _errorWays.add(w,w);
+                errorWays.add(w,w);
             }
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/util/AgregatePrimitivesVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/AgregatePrimitivesVisitor.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/AgregatePrimitivesVisitor.java	(revision 3671)
@@ -19,6 +19,5 @@
  * @author frsantos
  */
-public class AgregatePrimitivesVisitor extends AbstractVisitor
-{
+public class AgregatePrimitivesVisitor extends AbstractVisitor {
     /** Aggregated data */
     final Collection<OsmPrimitive> aggregatedData = new HashSet<OsmPrimitive>();
@@ -29,8 +28,6 @@
      * @return The aggregated primitives
      */
-    public Collection<OsmPrimitive> visit(Collection<OsmPrimitive> data)
-    {
-        for (OsmPrimitive osm : data)
-        {
+    public Collection<OsmPrimitive> visit(Collection<OsmPrimitive> data) {
+        for (OsmPrimitive osm : data) {
             osm.visit(this);
         }
@@ -39,20 +36,22 @@
     }
 
-    public void visit(Node n)
-    {
-        if(!aggregatedData.contains(n))
+    @Override
+    public void visit(Node n) {
+        if (!aggregatedData.contains(n)) {
             aggregatedData.add(n);
-    }
-
-    public void visit(Way w)
-    {
-        if(!aggregatedData.contains(w))
-        {
-            aggregatedData.add(w);
-            for (Node n : w.getNodes())
-                visit(n);
         }
     }
 
+    @Override
+    public void visit(Way w) {
+        if (!aggregatedData.contains(w)) {
+            aggregatedData.add(w);
+            for (Node n : w.getNodes()) {
+                visit(n);
+            }
+        }
+    }
+
+    @Override
     public void visit(Relation r) {
         if (!aggregatedData.contains(r)) {
Index: trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 3671)
@@ -31,6 +31,5 @@
      * @param data The collection of primitives
      */
-    public void visit(Collection<? extends OsmPrimitive> data)
-    {
+    public void visit(Collection<? extends OsmPrimitive> data) {
         String multipleName = null;
         String multiplePluralClassname = null;
@@ -40,27 +39,23 @@
 
         multipleClassname = null;
-        for (OsmPrimitive osm : data)
-        {
+        for (OsmPrimitive osm : data) {
             String name = osm.get("name");
-            if(name == null) name = osm.get("ref");
-            if(!initializedname)
-            {
+            if (name == null) {
+                name = osm.get("ref");
+            }
+            if (!initializedname) {
                 multipleName = name; initializedname = true;
-            }
-            else if(multipleName != null && (name == null  || !name.equals(multipleName)))
-            {
+            } else if (multipleName != null && (name == null  || !name.equals(multipleName))) {
                 multipleName = null;
             }
 
-            if(firstName == null && name != null)
+            if (firstName == null && name != null) {
                 firstName = name;
+            }
             osm.visit(this);
-            if (multipleClassname == null)
-            {
+            if (multipleClassname == null) {
                 multipleClassname = className;
                 multiplePluralClassname = classNamePlural;
-            }
-            else if (!multipleClassname.equals(className))
-            {
+            } else if (!multipleClassname.equals(className)) {
                 multipleClassname = "object";
                 multiplePluralClassname = trn("object", "objects", 2);
@@ -68,17 +63,17 @@
         }
 
-        if( size == 1 )
+        if (size == 1) {
             displayName = name;
-        else if(multipleName != null)
+        } else if (multipleName != null) {
             displayName = size + " " + trn(multipleClassname, multiplePluralClassname, size) + ": " + multipleName;
-        else if(firstName != null)
+        } else if (firstName != null) {
             displayName = size + " " + trn(multipleClassname, multiplePluralClassname, size) + ": " + tr("{0}, ...", firstName);
-        else
+        } else {
             displayName = size + " " + trn(multipleClassname, multiplePluralClassname, size);
+        }
     }
 
     @Override
-    public JLabel toLabel()
-    {
+    public JLabel toLabel() {
         return new JLabel(getText(), getIcon(), JLabel.HORIZONTAL);
     }
@@ -88,6 +83,5 @@
      * @return the name of the items
      */
-    public String getText()
-    {
+    public String getText() {
         return displayName;
     }
@@ -97,7 +91,6 @@
      * @return the icon of the items
      */
-    public Icon getIcon()
-    {
-        if( size == 1 )
+    public Icon getIcon() {
+        if (size == 1)
             return icon;
         else
Index: trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java	(revision 3671)
@@ -43,4 +43,5 @@
      * is displayed.
      */
+    @Override
     public void visit(Node n) {
         name = n.getDisplayName(DefaultNameFormatter.getInstance());
@@ -55,4 +56,5 @@
      * is displayed with x being the number of nodes in the way.
      */
+    @Override
     public void visit(Way w) {
         name = w.getDisplayName(DefaultNameFormatter.getInstance());
@@ -65,4 +67,5 @@
     /**
      */
+    @Override
     public void visit(Relation e) {
         name = e.getDisplayName(DefaultNameFormatter.getInstance());
@@ -77,8 +80,8 @@
     }
 
-
     private void addId(OsmPrimitive osm) {
-        if (Main.pref.getBoolean("osm-primitives.showid"))
+        if (Main.pref.getBoolean("osm-primitives.showid")) {
             name += tr(" [id: {0}]", osm.getId());
+        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 3671)
@@ -38,6 +38,5 @@
      * @return A list with all the cells the way starts or ends
      */
-    public static List<List<Way>> getWaysInCell(Way w, Map<Point2D,List<Way>> cellWays)
-    {
+    public static List<List<Way>> getWaysInCell(Way w, Map<Point2D,List<Way>> cellWays) {
         if (w.getNodesCount() == 0)
             return Collections.emptyList();
@@ -59,7 +58,6 @@
         cell = new Point2D.Double(x0, y0);
         cellNodes.add(cell);
-        List<Way> ways = cellWays.get( cell );
-        if( ways == null )
-        {
+        List<Way> ways = cellWays.get(cell);
+        if (ways == null) {
             ways = new ArrayList<Way>();
             cellWays.put(cell, ways);
@@ -69,10 +67,8 @@
         // End of the way
         cell = new Point2D.Double(x1, y1);
-        if( !cellNodes.contains(cell) )
-        {
+        if (!cellNodes.contains(cell)) {
             cellNodes.add(cell);
             ways = cellWays.get( cell );
-            if( ways == null )
-            {
+            if (ways == null) {
                 ways = new ArrayList<Way>();
                 cellWays.put(cell, ways);
@@ -82,17 +78,15 @@
 
         // Then floor coordinates, in case the way is in the border of the cell.
-        x0 = (long)Math.floor(n1.getEastNorth().east()  * OsmValidator.griddetail);
-        y0 = (long)Math.floor(n1.getEastNorth().north() * OsmValidator.griddetail);
-        x1 = (long)Math.floor(n2.getEastNorth().east()  * OsmValidator.griddetail);
-        y1 = (long)Math.floor(n2.getEastNorth().north() * OsmValidator.griddetail);
+        x0 = (long) Math.floor(n1.getEastNorth().east()  * OsmValidator.griddetail);
+        y0 = (long) Math.floor(n1.getEastNorth().north() * OsmValidator.griddetail);
+        x1 = (long) Math.floor(n2.getEastNorth().east()  * OsmValidator.griddetail);
+        y1 = (long) Math.floor(n2.getEastNorth().north() * OsmValidator.griddetail);
 
         // Start of the way
         cell = new Point2D.Double(x0, y0);
-        if( !cellNodes.contains(cell) )
-        {
+        if (!cellNodes.contains(cell)) {
             cellNodes.add(cell);
-            ways = cellWays.get( cell );
-            if( ways == null )
-            {
+            ways = cellWays.get(cell);
+            if (ways == null) {
                 ways = new ArrayList<Way>();
                 cellWays.put(cell, ways);
@@ -103,10 +97,8 @@
         // End of the way
         cell = new Point2D.Double(x1, y1);
-        if( !cellNodes.contains(cell) )
-        {
+        if (!cellNodes.contains(cell)) {
             cellNodes.add(cell);
-            ways = cellWays.get( cell );
-            if( ways == null )
-            {
+            ways = cellWays.get(cell);
+            if (ways == null) {
                 ways = new ArrayList<Way>();
                 cellWays.put(cell, ways);
@@ -114,5 +106,4 @@
             cells.add(ways);
         }
-
         return cells;
     }
@@ -128,6 +119,5 @@
      * @return A list with the coordinates of all cells
      */
-    public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail)
-    {
+    public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail) {
         List<Point2D> cells = new ArrayList<Point2D>();
         double x0 = n1.getEastNorth().east() * gridDetail;
@@ -136,6 +126,5 @@
         double y1 = n2.getEastNorth().north() * gridDetail + 1;
 
-        if( x0 > x1 )
-        {
+        if (x0 > x1) {
             // Move to 1st-4th cuadrants
             double aux;
@@ -147,13 +136,12 @@
         double dy  = y1 - y0;
         long stepY = y0 <= y1 ? 1 : -1;
-        long gridX0 = (long)Math.floor(x0);
-        long gridX1 = (long)Math.floor(x1);
-        long gridY0 = (long)Math.floor(y0);
-        long gridY1 = (long)Math.floor(y1);
+        long gridX0 = (long) Math.floor(x0);
+        long gridX1 = (long) Math.floor(x1);
+        long gridY0 = (long) Math.floor(y0);
+        long gridY1 = (long) Math.floor(y1);
 
         long maxSteps = (gridX1 - gridX0) + Math.abs(gridY1 - gridY0) + 1;
-        while( (gridX0 <= gridX1 && (gridY0 - gridY1)*stepY <= 0) && maxSteps-- > 0)
-        {
-            cells.add( new Point2D.Double(gridX0, gridY0) );
+        while ((gridX0 <= gridX1 && (gridY0 - gridY1)*stepY <= 0) && maxSteps-- > 0) {
+            cells.add( new Point2D.Double(gridX0, gridY0));
 
             // Is the cross between the segment and next vertical line nearer than the cross with next horizontal line?
@@ -166,10 +154,10 @@
             double distY = Math.pow(scanX - x0, 2) + Math.pow(gridY0 + stepY - y0, 2);
 
-            if( distX < distY)
+            if (distX < distY) {
                 gridX0 += 1;
-            else
+            } else {
                 gridY0 += stepY;
+            }
         }
-
         return cells;
     }
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 3671)
@@ -1,4 +1,3 @@
 // License: GPL. See LICENSE file for details.
-
 package org.openstreetmap.josm.gui;
 
@@ -77,5 +76,4 @@
 import org.openstreetmap.josm.actions.ZoomOutAction;
 import org.openstreetmap.josm.actions.OrthogonalizeAction.Undo;
-import org.openstreetmap.josm.actions.ValidateAction;
 import org.openstreetmap.josm.actions.audio.AudioBackAction;
 import org.openstreetmap.josm.actions.audio.AudioFasterAction;
@@ -89,4 +87,5 @@
 import org.openstreetmap.josm.gui.tagging.TaggingPresetSearchAction;
 import org.openstreetmap.josm.tools.Shortcut;
+
 /**
  * This is the JOSM main menu bar. It is overwritten to initialize itself and provide all menu
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 3671)
@@ -2,6 +2,4 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -48,9 +46,10 @@
 import org.openstreetmap.josm.data.validation.ValidatorVisitor;
 import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
@@ -73,10 +72,10 @@
     public ValidatorTreePanel tree;
 
+    /** The fix button */
     private SideButton fixButton;
-    /** The fix button */
+    /** The ignore button */
     private SideButton ignoreButton;
-    /** The ignore button */
+    /** The select button */
     private SideButton selectButton;
-    /** The select button */
 
     private JPopupMenu popupMenu;
@@ -98,4 +97,5 @@
         JMenuItem zoomTo = new JMenuItem(tr("Zoom to problem"));
         zoomTo.addActionListener(new ActionListener() {
+            @Override
             public void actionPerformed(ActionEvent e) {
                 zoomToProblem();
@@ -129,5 +129,4 @@
         }
         add(buttonPanel, BorderLayout.SOUTH);
-
     }
 
@@ -154,6 +153,7 @@
     @Override
     public void setVisible(boolean v) {
-        if (tree != null)
+        if (tree != null) {
             tree.setVisible(v);
+        }
         super.setVisible(v);
         Main.map.repaint();
@@ -176,12 +176,14 @@
         for (TreePath path : selectionPaths) {
             DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
-            if (node == null)
+            if (node == null) {
                 continue;
+            }
 
             Enumeration<DefaultMutableTreeNode> children = node.breadthFirstEnumeration();
             while (children.hasMoreElements()) {
                 DefaultMutableTreeNode childNode = children.nextElement();
-                if (processedNodes.contains(childNode))
+                if (processedNodes.contains(childNode)) {
                     continue;
+                }
 
                 processedNodes.add(childNode);
@@ -215,6 +217,7 @@
         for (TreePath path : selectionPaths) {
             DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
-            if (node == null)
+            if (node == null) {
                 continue;
+            }
 
             Object mainNodeInfo = node.getUserObject();
@@ -232,6 +235,7 @@
                     while (children.hasMoreElements()) {
                         DefaultMutableTreeNode childNode = children.nextElement();
-                        if (processedNodes.contains(childNode))
+                        if (processedNodes.contains(childNode)) {
                             continue;
+                        }
 
                         processedNodes.add(childNode);
@@ -248,6 +252,7 @@
                     }
                     continue;
-                } else if (asked == JOptionPane.CANCEL_OPTION)
+                } else if (asked == JOptionPane.CANCEL_OPTION) {
                     continue;
+                }
             }
 
@@ -255,6 +260,7 @@
             while (children.hasMoreElements()) {
                 DefaultMutableTreeNode childNode = children.nextElement();
-                if (processedNodes.contains(childNode))
+                if (processedNodes.contains(childNode)) {
                     continue;
+                }
 
                 processedNodes.add(childNode);
@@ -329,16 +335,17 @@
             }
         }
-
         Main.main.getCurrentDataSet().setSelected(sel);
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         String actionCommand = e.getActionCommand();
-        if (actionCommand.equals("Select"))
+        if (actionCommand.equals("Select")) {
             setSelectedItems();
-        else if (actionCommand.equals("Fix"))
+        } else if (actionCommand.equals("Fix")) {
             fixErrors(e);
-        else if (actionCommand.equals("Ignore"))
+        } else if (actionCommand.equals("Ignore")) {
             ignoreErrors(e);
+        }
     }
 
@@ -389,6 +396,7 @@
         }
         selectButton.setEnabled(true);
-        if (ignoreButton != null)
+        if (ignoreButton != null) {
             ignoreButton.setEnabled(true);
+        }
 
         return hasFixes;
@@ -415,6 +423,7 @@
         public void mouseClicked(MouseEvent e) {
             fixButton.setEnabled(false);
-            if (ignoreButton != null)
+            if (ignoreButton != null) {
                 ignoreButton.setEnabled(false);
+            }
             selectButton.setEnabled(false);
 
@@ -428,6 +437,7 @@
             if (isDblClick) {
                 Main.main.getCurrentDataSet().setSelected(sel);
-                if(Main.pref.getBoolean("validator.autozoom", false))
+                if(Main.pref.getBoolean("validator.autozoom", false)) {
                     AutoScaleAction.zoomTo(sel);
+                }
             }
         }
@@ -449,8 +459,10 @@
      */
     public class SelectionWatch implements TreeSelectionListener {
+        @Override
         public void valueChanged(TreeSelectionEvent e) {
             fixButton.setEnabled(false);
-            if (ignoreButton != null)
+            if (ignoreButton != null) {
                 ignoreButton.setEnabled(false);
+            }
             selectButton.setEnabled(false);
 
@@ -467,5 +479,5 @@
 
     public static class ValidatorBoundingXYVisitor extends BoundingXYVisitor implements ValidatorVisitor {
-
+        @Override
         public void visit(OsmPrimitive p) {
             if (p.isUsable()) {
@@ -474,4 +486,5 @@
         }
 
+        @Override
         public void visit(WaySegment ws) {
             if (ws.lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount())
@@ -481,4 +494,5 @@
         }
 
+        @Override
         public void visit(List<Node> nodes) {
             for (Node n: nodes) {
@@ -491,10 +505,12 @@
         if (!Main.pref.getBoolean(ValidatorPreference.PREF_FILTER_BY_SELECTION, false))
             return;
-        if (newSelection.isEmpty())
+        if (newSelection.isEmpty()) {
             tree.setFilter(null);
+        }
         HashSet<OsmPrimitive> filter = new HashSet<OsmPrimitive>(newSelection);
         tree.setFilter(filter);
     }
 
+    @Override
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
         updateSelection(newSelection);
@@ -539,11 +555,10 @@
                     final Command fixCommand = error.getFix();
                     if (fixCommand != null) {
-                        SwingUtilities.invokeAndWait(
-                                new Runnable() {
-                                    public void run() {
-                                        Main.main.undoRedo.addNoRedraw(fixCommand);
-                                    }
-                                }
-                        );
+                        SwingUtilities.invokeAndWait(new Runnable() {
+                            @Override
+                            public void run() {
+                                Main.main.undoRedo.addNoRedraw(fixCommand);
+                            }
+                        });
                         error.setIgnored(true);
                     }
@@ -552,4 +567,5 @@
                 monitor.subTask(tr("Updating map ..."));
                 SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
                     public void run() {
                         Main.main.undoRedo.afterAdd();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 3671)
@@ -33,5 +33,4 @@
  * @author frsantos
  */
-
 public class ValidatorTreePanel extends JTree {
     /** Serializable ID */
@@ -41,5 +40,5 @@
      * The validation data.
      */
-    protected DefaultTreeModel treeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
+    protected DefaultTreeModel valTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
 
     /** The list of errors shown in the tree */
@@ -60,5 +59,5 @@
     public ValidatorTreePanel(List<TestError> errors) {
         ToolTipManager.sharedInstance().registerComponent(this);
-        this.setModel(treeModel);
+        this.setModel(valTreeModel);
         this.setRootVisible(false);
         this.setShowsRootHandles(true);
@@ -87,6 +86,7 @@
                     res += "<br>" + d;
                 res += "</html>";
-            } else
+            } else {
                 res = node.toString();
+            }
         }
         return res;
@@ -100,8 +100,9 @@
     @Override
     public void setVisible(boolean v) {
-        if (v)
+        if (v) {
             buildTree();
-        else
-            treeModel.setRoot(new DefaultMutableTreeNode());
+        } else {
+            valTreeModel.setRoot(new DefaultMutableTreeNode());
+        }
         super.setVisible(v);
     }
@@ -115,5 +116,5 @@
 
         if (errors == null || errors.isEmpty()) {
-            treeModel.setRoot(rootNode);
+            valTreeModel.setRoot(rootNode);
             return;
         }
@@ -127,7 +128,7 @@
                 DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
                 Object userObject = node.getUserObject();
-                if (userObject instanceof Severity)
+                if (userObject instanceof Severity) {
                     oldSelectedRows.add(userObject);
-                else if (userObject instanceof String) {
+                } else if (userObject instanceof String) {
                     String msg = (String) userObject;
                     msg = msg.substring(0, msg.lastIndexOf(" ("));
@@ -145,6 +146,7 @@
 
         for (TestError e : errors) {
-            if (e.getIgnored())
+            if (e.getIgnored()) {
                 continue;
+            }
             Severity s = e.getSeverity();
             String d = e.getDescription();
@@ -158,6 +160,7 @@
                     }
                 }
-                if (!found)
+                if (!found) {
                     continue;
+                }
             }
             if (d != null) {
@@ -168,6 +171,7 @@
                 }
                 b.add(d, e);
-            } else
+            } else {
                 errorTree.get(s).add(m, e);
+            }
         }
 
@@ -176,6 +180,7 @@
             Bag<String, TestError> severityErrors = errorTree.get(s);
             Map<String, Bag<String, TestError>> severityErrorsDeep = errorTreeDeep.get(s);
-            if (severityErrors.isEmpty() && severityErrorsDeep.isEmpty())
+            if (severityErrors.isEmpty() && severityErrorsDeep.isEmpty()) {
                 continue;
+            }
 
             // Severity node
@@ -183,11 +188,12 @@
             rootNode.add(severityNode);
 
-            if (oldSelectedRows.contains(s))
+            if (oldSelectedRows.contains(s)) {
                 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode }));
+            }
 
             for (Entry<String, List<TestError>> msgErrors : severityErrors.entrySet()) {
                 // Message node
-                List<TestError> errors = msgErrors.getValue();
-                String msg = msgErrors.getKey() + " (" + errors.size() + ")";
+                List<TestError> errs = msgErrors.getValue();
+                String msg = msgErrors.getKey() + " (" + errs.size() + ")";
                 DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg);
                 severityNode.add(messageNode);
@@ -197,5 +203,5 @@
                 }
 
-                for (TestError error : errors) {
+                for (TestError error : errs) {
                     // Error node
                     DefaultMutableTreeNode errorNode = new DefaultMutableTreeNode(error);
@@ -218,15 +224,17 @@
                 for (Entry<String, List<TestError>> msgErrors : errorlist.entrySet()) {
                     // Message node
-                    List<TestError> errors = msgErrors.getValue();
+                    List<TestError> errs = msgErrors.getValue();
                     String msg;
-                    if (groupNode != null)
-                        msg = msgErrors.getKey() + " (" + errors.size() + ")";
-                    else
-                        msg = bag.getKey() + " - " + msgErrors.getKey() + " (" + errors.size() + ")";
+                    if (groupNode != null) {
+                        msg = msgErrors.getKey() + " (" + errs.size() + ")";
+                    } else {
+                        msg = bag.getKey() + " - " + msgErrors.getKey() + " (" + errs.size() + ")";
+                    }
                     DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg);
-                    if (groupNode != null)
+                    if (groupNode != null) {
                         groupNode.add(messageNode);
-                    else
+                    } else {
                         severityNode.add(messageNode);
+                    }
 
                     if (oldSelectedRows.contains(msgErrors.getKey())) {
@@ -239,5 +247,5 @@
                     }
 
-                    for (TestError error : errors) {
+                    for (TestError error : errs) {
                         // Error node
                         DefaultMutableTreeNode errorNode = new DefaultMutableTreeNode(error);
@@ -248,5 +256,5 @@
         }
 
-        treeModel.setRoot(rootNode);
+        valTreeModel.setRoot(rootNode);
         for (TreePath path : expandedPaths) {
             this.expandPath(path);
@@ -260,6 +268,7 @@
     public void setErrorList(List<TestError> errors) {
         this.errors = errors;
-        if (isVisible())
+        if (isVisible()) {
             buildTree();
+        }
     }
 
@@ -273,9 +282,11 @@
         errors.clear();
         for (TestError error : newerrors) {
-            if (!error.getIgnored())
+            if (!error.getIgnored()) {
                 errors.add(error);
-        }
-        if (isVisible())
+            }
+        }
+        if (isVisible()) {
             buildTree();
+        }
     }
 
@@ -293,10 +304,12 @@
 
     public void setFilter(Set<OsmPrimitive> filter) {
-        if (filter != null && filter.size() == 0)
+        if (filter != null && filter.isEmpty()) {
             this.filter = null;
-        else
+        } else {
             this.filter = filter;
-        if (isVisible())
+        }
+        if (isVisible()) {
             buildTree();
+        }
     }
 
@@ -330,5 +343,5 @@
      */
     public DefaultMutableTreeNode getRoot() {
-        return (DefaultMutableTreeNode) treeModel.getRoot();
+        return (DefaultMutableTreeNode) valTreeModel.getRoot();
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreeRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreeRenderer.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreeRenderer.java	(revision 3671)
@@ -25,19 +25,15 @@
     public Component getTreeCellRendererComponent(JTree tree, Object value,
             boolean selected, boolean expanded, boolean leaf, int row,
-            boolean hasFocus)
-    {
+            boolean hasFocus) {
         super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
 
-        DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
+        DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
         Object nodeInfo = node.getUserObject();
 
-        if (nodeInfo instanceof Severity)
-        {
-            Severity s = (Severity)nodeInfo;
+        if (nodeInfo instanceof Severity) {
+            Severity s = (Severity) nodeInfo;
             setIcon(ImageProvider.get("data", s.getIcon()));
-        }
-        else if (nodeInfo instanceof TestError)
-        {
-            TestError error = (TestError)nodeInfo;
+        } else if (nodeInfo instanceof TestError) {
+            TestError error = (TestError) nodeInfo;
             MultipleNameVisitor v = new MultipleNameVisitor();
             v.visit(error.getPrimitives());
@@ -45,5 +41,4 @@
             setIcon(v.getIcon());
         }
-
         return this;
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 3671)
@@ -35,5 +35,4 @@
     private int updateCount = -1;
 
-
     public ValidatorLayer() {
         super(tr("Validation errors"));
@@ -67,6 +66,7 @@
             while (errorMessages.hasMoreElements()) {
                 Object tn = errorMessages.nextElement().getUserObject();
-                if (tn instanceof TestError)
+                if (tn instanceof TestError) {
                     ((TestError) tn).paint(g, mv);
+                }
             }
 
@@ -86,6 +86,7 @@
         StringBuilder b = new StringBuilder();
         for (Severity s : Severity.values()) {
-            if (errorTree.containsKey(s))
+            if (errorTree.containsKey(s)) {
                 b.append(tr(s.toString())).append(": ").append(errorTree.get(s).size()).append("<br>");
+            }
         }
 
@@ -134,7 +135,9 @@
     }
 
+    @Override
     public void activeLayerChange(Layer oldLayer, Layer newLayer) {
     }
 
+    @Override
     public void layerAdded(Layer newLayer) {
     }
@@ -143,4 +146,5 @@
      * If layer is the OSM Data layer, remove all errors
      */
+    @Override
     public void layerRemoved(Layer oldLayer) {
         if (oldLayer instanceof OsmDataLayer &&  Main.map.mapView.getEditLayer() == null) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java	(revision 3671)
@@ -23,8 +23,8 @@
  * @author frsantos
  */
-public class ValidatorPreference implements PreferenceSetting
-{
+public class ValidatorPreference implements PreferenceSetting {
 
     public static class Factory implements PreferenceSettingFactory {
+        @Override
         public PreferenceSetting createPreferenceSetting() {
             return new ValidatorPreference();
@@ -66,4 +66,5 @@
     private Collection<Test> allTests;
 
+    @Override
     public void addGui(PreferenceTabbedPane gui)
     {
@@ -89,6 +90,5 @@
 
         allTests = OsmValidator.getTests();
-        for(Test test: allTests)
-        {
+        for (Test test: allTests) {
             test.addGui(testPanel);
         }
@@ -103,29 +103,29 @@
     }
 
-    public boolean ok()
-    {
+    @Override
+    public boolean ok() {
         StringBuilder tests = new StringBuilder();
         StringBuilder testsBeforeUpload = new StringBuilder();
-        Boolean res = false;
 
-        for (Test test : allTests)
-        {
-            if(test.ok())
-                res = false;
+        for (Test test : allTests) {
             String name = test.getClass().getSimpleName();
-            tests.append( ',' ).append( name ).append( '=' ).append( test.enabled );
-            testsBeforeUpload.append( ',' ).append( name ).append( '=' ).append( test.testBeforeUpload );
+            tests.append(',').append(name).append('=').append(test.enabled);
+            testsBeforeUpload.append(',').append(name).append('=').append(test.testBeforeUpload);
         }
 
-        if (tests.length() > 0 ) tests = tests.deleteCharAt(0);
-        if (testsBeforeUpload.length() > 0 ) testsBeforeUpload = testsBeforeUpload.deleteCharAt(0);
+        if (tests.length() > 0) {
+            tests = tests.deleteCharAt(0);
+        }
+        if (testsBeforeUpload.length() > 0) {
+            testsBeforeUpload = testsBeforeUpload.deleteCharAt(0);
+        }
 
-        OsmValidator.initializeTests( allTests );
+        OsmValidator.initializeTests(allTests);
 
-        Main.pref.put( PREF_TESTS, tests.toString());
-        Main.pref.put( PREF_TESTS_BEFORE_UPLOAD, testsBeforeUpload.toString());
-        Main.pref.put( PREF_USE_IGNORE, prefUseIgnore.isSelected());
-        Main.pref.put( PREF_OTHER_UPLOAD, prefOtherUpload.isSelected());
-        Main.pref.put( PREF_LAYER, prefUseLayer.isSelected());
+        Main.pref.put(PREF_TESTS, tests.toString());
+        Main.pref.put(PREF_TESTS_BEFORE_UPLOAD, testsBeforeUpload.toString());
+        Main.pref.put(PREF_USE_IGNORE, prefUseIgnore.isSelected());
+        Main.pref.put(PREF_OTHER_UPLOAD, prefOtherUpload.isSelected());
+        Main.pref.put(PREF_LAYER, prefUseLayer.isSelected());
         return false;
     }
Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 3670)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 3671)
@@ -92,5 +92,4 @@
     public final static Collection<PluginProxy> pluginList = new LinkedList<PluginProxy>();
 
-
     /**
      * Removes deprecated plugins from a collection of plugins. Modifies the
