Fix the worst concurrent modification problems in compiler memory-light set/map.

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.

http://gwt-code-reviews.appspot.com/1384804

Review by: zundel@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9858 8db76d5a-ed1c-0410-87a9-c151d255dfc7
5 files changed