DefaultProxyStore violated ProxyStore#nextId contract.

The javadoc for nextId states that the return values must be unique, but
DefaultProxyStore returned the same value twice in a row unless an object is
added to the store. This situation happens when serializing a list of ValueProxy
objects (containing at least two distinct objects), which unfortunately wasn't
tested.

The sequence is now monotonically increasing. It's initial value is the size of
the internal map: in case where the initial map is only made of ValueProxies,
they would all have synthetic IDs starting at 0 up to the size of the map minus
one, so the size of the map can safely be used as the next unique ID (this only
works because no object can ever be removed from the store).

Fixes issue 6961.

Review at: http://gwt-code-reviews.appspot.com/1622803
Patch by: t.broyer

Review by: jasonhall@google.com

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