From 6dc3a67a70066b374abba65faafca54db79991f6 Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Mon, 13 Jan 2020 13:47:14 +0200 Subject: [PATCH] Added object checks for graph path comparison gitlab #21 Change-Id: I6dc5cfd1eae225590a551e5a5004f604e9e2cfea --- .../org/simantics/interop/test/GraphComparator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java b/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java index 6f8c4d1..9f14ecd 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java @@ -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; } -- 2.47.1