]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Sorting created duplicates
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 20 Sep 2011 12:15:00 +0000 (12:15 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:16 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22338 ac1ea38d-2e2b-0410-8846-a27921b304fc

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

index 1ae5ed2450b45e469cd57135140f37bb306bf211..4fb9cf24e88e9f2b8078c5e3036019445aec2a8d 100644 (file)
@@ -174,12 +174,12 @@ public class GraphComparator {
                        Resource r2 = stack2.pop();\r
                \r
                        if (comparableResources.contains(r1, r2)) {\r
-                               System.out.println("already tested " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2));\r
+                               //System.out.println("already tested " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2));\r
                                continue;\r
                        }\r
                        comparableResources.map(r1, r2);\r
                        \r
-                       System.out.println("test " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2));\r
+                       //System.out.println("test " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2));\r
                        compareProps(r1, r2);\r
                        \r
                        for (Resource rel : tested) {\r
@@ -313,14 +313,18 @@ public class GraphComparator {
                }\r
                if (ss1 < sorted1.size()) {\r
                        for (Statement s : list1) {\r
-                               if (!sorted1.contains(s))\r
-                                       sorted1.add(s);\r
+                               if (!sorted1.contains(s)) {\r
+                                       sorted1.set(ss1,s);\r
+                                       ss1++;\r
+                               }\r
                        }\r
                }\r
                if (ss2 < sorted2.size()) {\r
                        for (Statement s : list2) {\r
-                               if (!sorted2.contains(s))\r
-                                       sorted2.add(s);\r
+                               if (!sorted2.contains(s)) {\r
+                                       sorted2.set(ss2,s);\r
+                                       ss2++;\r
+                               }\r
                        }\r
                }\r
                \r