changeset 1273:6ec804500621

Avoid duplicate clones in w-diff branch by using a set instead of a list. flys-client/trunk@2843 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 27 Sep 2011 13:52:18 +0000
parents 2ce5d7ac9e60
children f76c90b3086f
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Sep 27 13:49:34 2011 +0000
+++ b/flys-client/ChangeLog	Tue Sep 27 13:52:18 2011 +0000
@@ -1,3 +1,10 @@
+2011-09-27	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
+
+	Use HashSet to avoid duplicate clones in Collections with WDiffs.
+
+	* src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java:
+	  Use HashSet instead of list to avoid duplicate clones, cosmetics.
+
 2011-09-27	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
 
 	Cosmetics, documentation.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Tue Sep 27 13:49:34 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Tue Sep 27 13:52:18 2011 +0000
@@ -1,8 +1,9 @@
 package de.intevation.flys.client.client.ui;
 
 import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
-import java.util.List;
 import java.util.Set;
 
 import com.google.gwt.core.client.GWT;
@@ -79,7 +80,7 @@
         Canvas widget = createWidget();
         Canvas submit = getNextButton();
 
-        VLayout layout = new VLayout();
+        VLayout layout       = new VLayout();
         HLayout helperLayout = new HLayout();
         label.setHeight(50);
         helperLayout.addMember(new DatacagePairWidget(this.artifact,
@@ -140,7 +141,8 @@
         GWT.log("DatacageTwinPanel.onClick");
         Config config = Config.getInstance();
         ListGridRecord[] records = differencesList.getRecords();
-        ArrayList<Recommendation> ar = new ArrayList<Recommendation>();
+
+        Set<Recommendation> ar = new HashSet<Recommendation>();
         for (ListGridRecord record : records) {
             DatacagePairWidget.RecommendationPairRecord r =
                 (DatacagePairWidget.RecommendationPairRecord) record;
@@ -164,8 +166,8 @@
 
                     fireStepForwardEvent(new StepForwardEvent(
                         getData(rs, artifacts)));
-                } }
-                );
+                }
+              } );
     }
 
 

http://dive4elements.wald.intevation.org