An alternative way to support ShareableModule, Modules.override and Multibinder: use annotations that compare equal iff the binding strategy matches, so Guice will dedupe for us.

This CL includes a noteworthy adaptation of an earlier attempt which caused timeouts in some client tests, forcing a rollback ([]). Because Key caches its hashCode, we were inadvertently inserting every binding for a given multibound set into the same hashmap bucket, causing at best O(n^2) behaviour (and possibly worse, depending on how HashMap is implemented). To fix this, this CL adds changes to core Guice to recompute the Key's hashCode at injector construction time. (In fact, at the end of every Elements.getElements call, so any SPI-based code gets the same benefits.)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=51233981
17 files changed