Reviewers: zundel,

Message:
(I ran into a bug while debugging your PersistentUnitCache patch.)

Due to a bug in com.google.gwt.dev.util.collect.HashMap.put(), we were
eagerly growing the underlying table even when the key was already
mapped.  This causes an iterators to be invalidated on a non-structural
change.  Of course, we weren't actually tracking structural changes,
which would cause the iterator to quietly continue, returning a 'null'
keyed entry when it should not have, and possibly duplicating / skipping
other entries.

1) I fixed the bug in HashMap.put() and HashSet.add() to defer growth
until we're sure the key doesn't exist already.

2) Added basic concurrent modification tracking to the associated
iterators, in a way that doesn't add additional memory to the
collections themselves.

3) Other various and sundry cleanups.



Please review this at http://gwt-code-reviews.appspot.com/1384804/

Affected files:
  M dev/core/src/com/google/gwt/dev/util/collect/HashMap.java
  M dev/core/src/com/google/gwt/dev/util/collect/HashSet.java
  M dev/core/src/com/google/gwt/dev/util/collect/IdentityHashSet.java
  M dev/core/src/com/google/gwt/dev/util/collect/IdentitySets.java
  M dev/core/src/com/google/gwt/dev/util/collect/Sets.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to