From: Matti Tahvonen Date: Thu, 14 Aug 2008 08:29:58 +0000 (+0000) Subject: reverted IndexedContainer specific hack (IdentityHashMap => Set). IndexedContainerPro... X-Git-Tag: 6.7.0.beta1~4356 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0b85de0bd83db6b99c5a87991e5755dad440ab75;p=vaadin-framework.git reverted IndexedContainer specific hack (IdentityHashMap => Set). IndexedContainerProperty now has a reasonable hasCode svn changeset:5185/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/Table.java b/src/com/itmill/toolkit/ui/Table.java index fb11b165c7..bdcca0f5d5 100644 --- a/src/com/itmill/toolkit/ui/Table.java +++ b/src/com/itmill/toolkit/ui/Table.java @@ -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); } }