]> source.dussan.org Git - vaadin-framework.git/commitdiff
reverted IndexedContainer specific hack (IdentityHashMap => Set). IndexedContainerPro...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 14 Aug 2008 08:29:58 +0000 (08:29 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 14 Aug 2008 08:29:58 +0000 (08:29 +0000)
svn changeset:5185/svn branch:trunk

src/com/itmill/toolkit/ui/Table.java

index fb11b165c7593399970511a779140869f64fef51..bdcca0f5d5831957c7b5867cd59438950ecc5cdc 100644 (file)
@@ -8,7 +8,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
@@ -235,7 +234,7 @@ public class Table extends AbstractSelect implements Action.Container,
      * Note: This should be set or list. IdentityHashMap used due very heavy
      * hashCode in indexed container
      */
-    private Map listenedProperties = null;
+    private HashSet listenedProperties = null;
 
     /**
      * Set of visible components - the is used for needsRepaint calculation.
@@ -1168,11 +1167,11 @@ public class Table extends AbstractSelect implements Action.Container,
 
         if (isContentRefreshesEnabled) {
 
-            Map oldListenedProperties = listenedProperties;
+            HashSet oldListenedProperties = listenedProperties;
             HashSet oldVisibleComponents = visibleComponents;
 
             // initialize the listener collections
-            listenedProperties = new IdentityHashMap();
+            listenedProperties = new HashSet();
             visibleComponents = new HashSet();
 
             // Collects the basic facts about the table page
@@ -1275,12 +1274,11 @@ public class Table extends AbstractSelect implements Action.Container,
                         if (p != null || isGenerated) {
                             if (p instanceof Property.ValueChangeNotifier) {
                                 if (oldListenedProperties == null
-                                        || !oldListenedProperties
-                                                .containsKey(p)) {
+                                        || !oldListenedProperties.contains(p)) {
                                     ((Property.ValueChangeNotifier) p)
                                             .addListener(this);
                                 }
-                                listenedProperties.put(p, null);
+                                listenedProperties.add(p);
                             }
                             if (index < firstIndexNotInCache
                                     && index >= pageBufferFirstIndex) {
@@ -1351,11 +1349,11 @@ public class Table extends AbstractSelect implements Action.Container,
             }
 
             if (oldListenedProperties != null) {
-                for (final Iterator i = oldListenedProperties.keySet()
-                        .iterator(); i.hasNext();) {
+                for (final Iterator i = oldListenedProperties.iterator(); i
+                        .hasNext();) {
                     Property.ValueChangeNotifier o = (ValueChangeNotifier) i
                             .next();
-                    if (!listenedProperties.containsKey(o)) {
+                    if (!listenedProperties.contains(o)) {
                         o.removeListener(this);
                     }
                 }