From ef93920fd436fd4c2578bdcba3a89f3fe1c5f2e6 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Tue, 20 Sep 2011 12:15:00 +0000 Subject: [PATCH] Sorting created duplicates git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22338 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/interop/test/GraphComparator.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 1ae5ed2..4fb9cf2 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java @@ -174,12 +174,12 @@ public class GraphComparator { Resource r2 = stack2.pop(); if (comparableResources.contains(r1, r2)) { - System.out.println("already tested " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2)); + //System.out.println("already tested " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2)); continue; } comparableResources.map(r1, r2); - System.out.println("test " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2)); + //System.out.println("test " + NameUtils.getSafeName(g, r1) + " " + NameUtils.getSafeName(g, r2)); compareProps(r1, r2); for (Resource rel : tested) { @@ -313,14 +313,18 @@ public class GraphComparator { } if (ss1 < sorted1.size()) { for (Statement s : list1) { - if (!sorted1.contains(s)) - sorted1.add(s); + if (!sorted1.contains(s)) { + sorted1.set(ss1,s); + ss1++; + } } } if (ss2 < sorted2.size()) { for (Statement s : list2) { - if (!sorted2.contains(s)) - sorted2.add(s); + if (!sorted2.contains(s)) { + sorted2.set(ss2,s); + ss2++; + } } } -- 2.47.1