Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 14407)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 14408)
@@ -266,5 +266,8 @@
             return;
 
-        Set<Node> sharedNodes = findIntersectionNodes(r);
+        Set<Node> sharedNodes = new HashSet<>();
+        Set<Way> intersectionWays = new HashSet<>();
+        findIntersectionNodes(r, sharedNodes, intersectionWays);
+
         List<PolyData> innerPolygons = polygon.getInnerPolygons();
         List<PolyData> outerPolygons = polygon.getOuterPolygons();
@@ -272,4 +275,5 @@
         allPolygons.addAll(outerPolygons);
         allPolygons.addAll(innerPolygons);
+
         Map<PolyData, List<PolyData>> crossingPolyMap = findIntersectingWays(r, innerPolygons, outerPolygons);
 
@@ -278,8 +282,14 @@
                 PolyData pd1 = allPolygons.get(i);
                 checkPolygonForSelfIntersection(r, pd1);
+                // check if this ring has a way that is known to intersect with another way
+
+                if (!hasIntersectionWay(pd1, intersectionWays))
+                    continue;
+
                 for (int j = i + 1; j < allPolygons.size(); j++) {
                     PolyData pd2 = allPolygons.get(j);
                     if (!checkProblemMap(crossingPolyMap, pd1, pd2)) {
-                        checkPolygonsForSharedNodes(r, pd1, pd2, sharedNodes);
+                        if (hasIntersectionWay(pd2, intersectionWays))
+                            checkPolygonsForSharedNodes(r, pd1, pd2, sharedNodes);
                     }
                 }
@@ -298,4 +308,19 @@
             checkRoles(r, allPolygons, wayMap, sharedNodes);
         }
+    }
+
+    /**
+     * Simple check if given ring contains way that is known to intersect.
+     * @param pd the ring
+     * @param intersectionWays the known intersection ways
+     * @return true if one or more ways are in the set of known ways
+     */
+    private boolean hasIntersectionWay(PolyData pd, Set<Way> intersectionWays) {
+        for (Way w : intersectionWays) {
+            if (pd.getWayIds().contains(w.getUniqueId())) {
+                return true;
+            }
+        }
+        return false;
     }
 
@@ -340,8 +365,8 @@
      * or two times in one way and at least once in another way we found an intersection.
      * @param r the relation
-     * @return List of nodes were ways intersect
-     */
-    private static Set<Node> findIntersectionNodes(Relation r) {
-        Set<Node> intersectionNodes = new HashSet<>();
+     * @param sharedNodes We be filled with shared nodes
+     * @param intersectionWays We be filled with ways that have a shared node
+     */
+    private static void findIntersectionNodes(Relation r, Set<Node> sharedNodes, Set<Way> intersectionWays) {
         Map<Node, List<Way>> nodeMap = new HashMap<>();
         for (RelationMember rm : r.getMembers()) {
@@ -361,9 +386,9 @@
                 ways.add(rm.getWay());
                 if (ways.size() > 2 || (ways.size() == 2 && i != 0 && i + 1 != numNodes)) {
-                    intersectionNodes.add(n);
-                }
-            }
-        }
-        return intersectionNodes;
+                    sharedNodes.add(n);
+                    intersectionWays.addAll(ways);
+                }
+            }
+        }
     }
 
