]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
refs #3138
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 19 Jan 2012 16:31:28 +0000 (16:31 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:18 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@24013 ac1ea38d-2e2b-0410-8846-a27921b304fc

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

index ab0d437f496cbca99041ef14aeb2c0f6ca5ec169..5ba622b620f9379d0c6deec0ebe07a46f5780cc9 100644 (file)
@@ -951,6 +951,7 @@ public class GraphComparator {
         * @throws ValidationException \r
         */\r
        private void compareProps(Resource r1, Resource r2) throws ServiceException, DoesNotContainValueException, ValidationException {\r
+               System.out.println("compareProps " + r1 + " " + NameUtils.getSafeName(g, r1) + " " + r2 + " " + NameUtils.getSafeName(g, r2));\r
                ArrayList<Statement> ss1 = new ArrayList<Statement>();\r
                ArrayList<Statement> ss2 = new ArrayList<Statement>();\r
                ss1.addAll(g.getStatements(r1, b.HasProperty));\r
@@ -982,6 +983,11 @@ public class GraphComparator {
                        }\r
                        Statement s1 = ss1.get(i1);\r
                        Statement s2 = ss2.get(i2);\r
+                       if (s1.isAsserted(r1) && s2.isAsserted(r2)) {\r
+                               i1++;\r
+                               i2++;\r
+                               continue;\r
+                       }\r
                        int c = scomp.compare(s1, s2);\r
                        switch (c) {\r
                                case 0:{\r
@@ -997,7 +1003,8 @@ public class GraphComparator {
                                                                addComparable(s1, s2, false);\r
                                                        }\r
                                                } else {\r
-                                                       compareProps(s1.getObject(), s2.getObject());\r
+                                                       if (!s1.getObject().equals(s1.getSubject()) && !s2.getObject().equals(s2.getSubject()))\r
+                                                               compareProps(s1.getObject(), s2.getObject());\r
                                                }\r
                                        } else {\r
                                                addModification(s1, s2);\r
index 1417588f10f7ac828386176d8edaace5d55a1196..e3251ac07f2756b42224e76c9eb3a664edeb03c5 100644 (file)
@@ -102,6 +102,11 @@ public class TypeComparator extends ResourceComparator {
                        }\r
                        Statement s1 = ss1.get(i1);\r
                        Statement s2 = ss2.get(i2);\r
+                       if (s1.isAsserted(r1) && s2.isAsserted(r2)) {\r
+                               i1++;\r
+                               i2++;\r
+                               continue;\r
+                       }\r
                        int c = scomp.compare(s1, s2);\r
                        switch (c) {\r
                                case 0:{\r