Index: trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java	(revision 7144)
+++ trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java	(revision 7145)
@@ -48,5 +48,5 @@
          * @return list of nodes
          */
-        private List<Node> getNodes() {
+        public List<Node> getNodes() {
             List<Node> nodes = new ArrayList<>();
 
@@ -108,5 +108,30 @@
      * @return error description if the ways cannot be split, {@code null} if all fine.
      */
-    public String makeFromWays(Collection<Way> ways){
+    public String makeFromWays(Collection<Way> ways) {
+        try {
+            List<JoinedPolygon> joinedWays = joinWays(ways);
+            //analyze witch way is inside witch outside.
+            return makeFromPolygons(joinedWays);
+        } catch (JoinedPolygonCreationException ex) {
+            return ex.getMessage();
+        }
+    }
+
+    /**
+     * An exception indicating an error while joining ways to multipolygon rings.
+     */
+    public static class JoinedPolygonCreationException extends RuntimeException {
+        public JoinedPolygonCreationException(String message) {
+            super(message);
+        }
+    }
+
+    /**
+     * Joins the given {@code ways} to multipolygon rings.
+     * @param ways the ways to join.
+     * @return a list of multipolygon rings.
+     * @throws JoinedPolygonCreationException if the creation fails.
+     */
+    public static List<JoinedPolygon> joinWays(Collection<Way> ways) throws JoinedPolygonCreationException {
         List<JoinedPolygon> joinedWays = new ArrayList<>();
 
@@ -117,5 +142,5 @@
         for(Way w: ways) {
             if (w.getNodesCount() < 2) {
-                return tr("Cannot add a way with only {0} nodes.", w.getNodesCount());
+                throw new JoinedPolygonCreationException(tr("Cannot add a way with only {0} nodes.", w.getNodesCount()));
             }
 
@@ -162,5 +187,5 @@
 
                 if (adjacentWays.size() != 2) {
-                    return tr("Each node must connect exactly 2 ways");
+                    throw new JoinedPolygonCreationException(tr("Each node must connect exactly 2 ways"));
                 }
 
@@ -181,6 +206,5 @@
         }
 
-        //analyze witch way is inside witch outside.
-        return makeFromPolygons(joinedWays);
+        return joinedWays;
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7144)
+++ trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7145)
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.BBox;
+import org.openstreetmap.josm.data.osm.MultipolygonCreate;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.NodePositionComparator;
@@ -860,7 +861,17 @@
     public static boolean isPolygonInsideMultiPolygon(List<Node> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {
         // Extract outer/inner members from multipolygon
-        MultiPolygonMembers mpm = new MultiPolygonMembers(multiPolygon);
+        final MultiPolygonMembers mpm = new MultiPolygonMembers(multiPolygon);
+        // Construct complete rings for the inner/outer members
+        final List<MultipolygonCreate.JoinedPolygon> outerRings;
+        final List<MultipolygonCreate.JoinedPolygon> innerRings;
+        try {
+            outerRings = MultipolygonCreate.joinWays(mpm.outers);
+            innerRings = MultipolygonCreate.joinWays(mpm.inners);
+        } catch (MultipolygonCreate.JoinedPolygonCreationException ex) {
+            Main.debug("Invalid multipolygon " + multiPolygon);
+            return false;
+        }
         // Test if object is inside an outer member
-        for (Way out : mpm.outers) {
+        for (MultipolygonCreate.JoinedPolygon out : outerRings) {
             if (nodes.size() == 1
                     ? nodeInsidePolygon(nodes.get(0), out.getNodes())
@@ -868,5 +879,5 @@
                 boolean insideInner = false;
                 // If inside an outer, check it is not inside an inner
-                for (Way in : mpm.inners) {
+                for (MultipolygonCreate.JoinedPolygon in : innerRings) {
                     if (polygonIntersection(in.getNodes(), out.getNodes()) == PolygonIntersection.FIRST_INSIDE_SECOND
                             && (nodes.size() == 1
@@ -880,5 +891,5 @@
                 if (!insideInner) {
                     // Final check using predicate
-                    if (isOuterWayAMatch == null || isOuterWayAMatch.evaluate(out)) {
+                    if (isOuterWayAMatch == null || isOuterWayAMatch.evaluate(out.ways.get(0) /* TODO give a better representation of the outer ring to the predicate */)) {
                         return true;
                     }
