Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 15460)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 15461)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
 import org.openstreetmap.josm.data.projection.Ellipsoid;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.Test;
@@ -411,4 +412,5 @@
 
     private class MyWaySegment {
+        /** the way */
         public final Way w;
         private final Node n1;
@@ -429,5 +431,5 @@
          */
         boolean isConnectedTo(Node startNode) {
-            return isConnectedTo(startNode, null, new HashSet<>(), 0);
+            return isConnectedTo(startNode, new HashSet<>(), 0);
         }
 
@@ -435,10 +437,9 @@
          * Check if the given node is connected to this segment using a reasonable short way.
          * @param node the given node
-         * @param startWay previously visited way or null if first
          * @param visited set of visited nodes
          * @param len length of the travelled route
          * @return true if a reasonable connection was found
          */
-        boolean isConnectedTo(Node node, Way startWay, Set<Node> visited, double len) {
+        private boolean isConnectedTo(Node node, Set<Node> visited, double len) {
             if (n1 == node || n2 == node) {
                 return true;
@@ -462,5 +463,5 @@
                             final boolean containsN = visited.contains(next);
                             visited.add(next);
-                            if (!containsN && isConnectedTo(next, way, visited,
+                            if (!containsN && isConnectedTo(next, visited,
                                     len + node.getCoor().greatCircleDistance(next.getCoor()))) {
                                 return true;
@@ -478,11 +479,8 @@
                 return Double.NaN;
             EastNorth closest = Geometry.closestPointToSegment(n1.getEastNorth(), n2.getEastNorth(), coord);
-            Node x = new Node();
-            x.setEastNorth(closest);
-            return x.getCoor().greatCircleDistance(n.getCoor());
-
-        }
-
-        boolean nearby(Node n, double dist) {
+            return n.getCoor().greatCircleDistance(ProjectionRegistry.getProjection().eastNorth2latlon(closest));
+        }
+
+        private boolean nearby(Node n, double dist) {
             if (w.containsNode(n))
                 return false;
@@ -491,5 +489,5 @@
         }
 
-        BBox getBounds(double fudge) {
+        private BBox getBounds(double fudge) {
             double x1 = n1.getCoor().lon();
             double x2 = n2.getCoor().lon();
@@ -539,6 +537,5 @@
             EastNorth en = endnode.getEastNorth();
             EastNorth closest = Geometry.closestPointToSegment(n1.getEastNorth(), n2.getEastNorth(), en);
-            Node x = new Node(closest);
-            BBox bbox = new BBox(endnode.getCoor(), x.getCoor());
+            BBox bbox = new BBox(endnode.getCoor(), ProjectionRegistry.getProjection().eastNorth2latlon(closest));
             for (Way nearbyWay : ds.searchWays(bbox)) {
                 if (nearbyWay != w && nearbyWay.isUsable() && nearbyWay.hasTag("barrier")
@@ -558,5 +555,4 @@
             return false;
         }
-
     }
 
