]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Added object checks for graph path comparison 75/3775/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 13 Jan 2020 11:47:14 +0000 (13:47 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 13 Jan 2020 11:47:14 +0000 (13:47 +0200)
gitlab #21

Change-Id: I6dc5cfd1eae225590a551e5a5004f604e9e2cfea

org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java

index 6f8c4d1b15e13d10a652dac5551abbb7d0a329e1..9f14ecdebe6fdc75dd76f377fc472e0818731cfa 100644 (file)
@@ -711,16 +711,20 @@ public class GraphComparator {
                                if (leftPath.getLength() != rightPath.getLength())
                                        continue;
                                if (comparableResources.contains(leftPath.getEnd(), rightPath.getEnd())) {
-                                       boolean preds = true;
+                                       boolean match = true;
                                        for (int i = 0; i < leftPath.getLength(); i++) {
                                                Statement sl = leftPath.getStatements().get(i);
                                                Statement sr = rightPath.getStatements().get(i);
                                                if (!sl.getPredicate().equals(sr.getPredicate()) && !comparableResources.contains(sl.getPredicate(), sr.getPredicate())) {
-                                                       preds = false;
+                                                       match = false;
+                                                       break;
+                                               }
+                                               if ((getComparableResources().containsLeft(sl.getObject()) || getComparableResources().containsRight(sr.getObject())) && !getComparableResources().contains(sl.getObject(), sr.getObject())) {
+                                                       match = false;
                                                        break;
                                                }
                                        }
-                                       if (preds) {
+                                       if (match) {
                                                map.map(leftPath, rightPath);
                                                break;
                                        }