]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22479...
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 29 Sep 2011 12:18:03 +0000 (12:18 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:17 +0000 (11:22 +0200)
org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java

index 163dda4917b82e3a34303938a56ce07d2b2e30d3..3c59b50a2082db09e122c4dcca9fdb1684ac4ebf 100644 (file)
@@ -626,7 +626,6 @@ public class GraphComparator {
                                }\r
                        }\r
                        js++;\r
-                       \r
                }\r
        }\r
        \r
@@ -678,7 +677,6 @@ public class GraphComparator {
                                \r
                                i2 += same2;\r
                        }\r
-                       \r
                }\r
        }\r
        \r
@@ -773,10 +771,8 @@ public class GraphComparator {
                                                        Statement s2  = ss2.get(i2+off2);\r
                                                        \r
                                                        if (objectsLeft != null) {\r
-                                                               \r
-                                                                       objectsLeft.add(s1.getObject());\r
-                                                                       objectsRight.add(s2.getObject());\r
-                                                               \r
+                                                               objectsLeft.add(s1.getObject());\r
+                                                               objectsRight.add(s2.getObject());\r
                                                        } \r
                                                        comparableStatements.map(s1, s2);\r
                                                        //comparableResources.map(s1.getObject(), s2.getObject());\r
@@ -852,8 +848,6 @@ public class GraphComparator {
                ss1.addAll(g.getStatements(r1, b.HasProperty));\r
                ss2.addAll(g.getStatements(r2, b.HasProperty));\r
                sortStatement(ss1, ss2);\r
-//             Collections.sort(ss1, scomp);\r
-//             Collections.sort(ss2, scomp);\r
                \r
                int i1 = 0; \r
                int i2 = 0;\r
@@ -882,47 +876,46 @@ public class GraphComparator {
                        Statement s2 = ss2.get(i2);\r
                        int c = scomp.compare(s1, s2);\r
                        switch (c) {\r
-                       case 0:{\r
-                               boolean b1 = g.hasValue(s1.getObject());\r
-                               boolean b2 = g.hasValue(s2.getObject());\r
-                               if (b1 == b2) {\r
-                                       if (b1) {\r
-                                               Object v1 = g.getValue(s1.getObject());\r
-                                               Object v2 = g.getValue(s2.getObject());\r
-                                               boolean eq = compareValue(v1, v2);\r
-                                               if (!eq) {\r
-                                                       addModification(s1, s2);\r
-                                                       comparableStatements.map(s1, s2);\r
-                                                       comparableResources.map(s1.getObject(),s2.getObject());\r
+                               case 0:{\r
+                                       boolean b1 = g.hasValue(s1.getObject());\r
+                                       boolean b2 = g.hasValue(s2.getObject());\r
+                                       if (b1 == b2) {\r
+                                               if (b1) {\r
+                                                       Object v1 = g.getValue(s1.getObject());\r
+                                                       Object v2 = g.getValue(s2.getObject());\r
+                                                       boolean eq = compareValue(v1, v2);\r
+                                                       if (!eq) {\r
+                                                               addModification(s1, s2);\r
+                                                               comparableStatements.map(s1, s2);\r
+                                                               comparableResources.map(s1.getObject(),s2.getObject());\r
+                                                       }\r
+                                               } else {\r
+                                                       compareProps(s1.getObject(), s2.getObject());\r
                                                }\r
                                        } else {\r
-                                               compareProps(s1.getObject(), s2.getObject());\r
+                                               addModification(s1, s2);\r
+                                               comparableStatements.map(s1, s2);\r
+                                               comparableResources.map(s1.getObject(),s2.getObject());\r
                                        }\r
-                               } else {\r
-                                       addModification(s1, s2);\r
-                                       comparableStatements.map(s1, s2);\r
-                                       comparableResources.map(s1.getObject(),s2.getObject());\r
+                                       i1++;\r
+                                       i2++;\r
+                                       break;\r
+                               }\r
+                               case -1:{\r
+                                       System.out.println("Compare Prop diff1s " + printStatement(g,s1));\r
+                                       addDeletion(s1);\r
+                                       i1++;\r
+                                       break;\r
+                               }\r
+                                       \r
+                               case 1:{\r
+                                       System.out.println("Compare Prop diff2s " + printStatement(g,s2));\r
+                                       addAddition(s2);\r
+                                       i2++;\r
+                                       break;\r
                                }\r
-                               i1++;\r
-                               i2++;\r
-                               break;\r
-                       }\r
-                       case -1:{\r
-                               System.out.println("Compare Prop diff1s " + printStatement(g,s1));\r
-                               addDeletion(s1);\r
-                               i1++;\r
-                               break;\r
-                       }\r
-                               \r
-                       case 1:{\r
-                               System.out.println("Compare Prop diff2s " + printStatement(g,s2));\r
-                               addAddition(s2);\r
-                               i2++;\r
-                               break;\r
-                       }\r
                        }\r
-                       \r
-                       \r
+\r
                }\r
                \r
                ss1.clear();\r
@@ -930,7 +923,6 @@ public class GraphComparator {
                \r
        }\r
        \r
-       \r
        public static boolean compareValue(Object v1, Object v2) {\r
                if (v1 instanceof Object[] && v2 instanceof Object[])\r
                        return Arrays.deepEquals((Object[])v1, (Object[])v2);\r
@@ -951,7 +943,6 @@ public class GraphComparator {
        }\r
 \r
        \r
-       \r
        public class PredicateComparator implements Comparator<Statement> {\r
                @Override\r
                public int compare(Statement o1, Statement o2) {\r
@@ -1010,8 +1001,6 @@ public class GraphComparator {
                }\r
        }\r
        \r
-\r
-       \r
        public class ResComparator implements Comparator<Resource> {\r
                @Override\r
                public int compare(Resource o1, Resource o2) {\r
@@ -1024,6 +1013,5 @@ public class GraphComparator {
                        return 0;\r
                }\r
        }\r
-       \r
-       \r
+\r
 }\r