History log of /external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
825f8c1df885b9d7643a9e18e336984f0138edaf 23-Mar-2015 sameb <sameb@google.com> Some work on issue 910 -- ensure that anonymous keys & typeliterals don't
retain references to their parent classes. Still some more work to do in
WeakKeySet to let it clean up more frequently, but this should help for now.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=89328452
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
1bf1e9e0ddef515aaa41a70aa34821ff5564a71d 18-Dec-2014 sameb <sameb@google.com> Add the source of the binding when mapbinder/multibinder fail because of a null
binding.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82465720
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
4f6c5672a1a685228d2970fc2dea89484430279f 06-Nov-2014 flan <flan@google.com> Adds a test that explicitly tests all of the bindings created by MapBinder.
Current tests rely on SpiUtil to validate all bindings, but those tests are
hard to read and reason about; this test is explicit.

Tested:
The new test passes.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=79369985
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
c34e0185fcf508a890c6cd13bdafeb505c3e9e8a 06-Aug-2014 Sam Berlin <sameb@google.com> Implement binding deduplication for multibinder & mapbinder in a different way.
Instead of relying on Guice binding deduplication (and hacking up RealElement
to break the annotation contract to do so, causing weirdness in WeakKeySet &
forcing us to care about "rehashing keys"), we instead deduplicate within
Multibinder. The downside of this is that toInstance or toProvider(instance)
bindings that are deduplicated will remain in the object graph but effectively
be unreachable. However, that's a downside I'm willing to live with to remove
this hack.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=72570932
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
d08bba96c4a647e2fd7588a7ea36c77b09ab2047 10-Jul-2014 Sam Berlin <sameb@google.com> More flake fixing: Refactor WeakKeySetUtils into one spot, make everything use
it, loop 10 times sleeping a second each before relying on things that were
GC'd.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70898677
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
6ae9ff6c662e979efea1c5f7195c47ef5715b20a 10-Jul-2014 Sam Berlin <sameb@google.com> Wrap GcFinalization usage around wrappers that also await a ReferenceQueue. I
couldn't get any failures internally in 10,000 runs even w/o these changes, but
on the external builds I reliably reproduced some flakes in 100 runs w/o this,
and no flakes (that I saw) afterwards.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=70835114
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
c00df28be8bfa45b2bdc8b4d3c101c20a9cbdc12 01-Jul-2014 Sam Berlin <sameb@google.com> Automated code cleanups by internal tool.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69390543
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
d57f8ece5508afc66c4768396c54b412dc9f2cc2 08-Apr-2014 Sam Berlin <sameb@google.com> The bug in the test that became flaky has been fixed. Note that this is not a strict rollback of the rollback - I've added protection against the NPE that would happen if there's a GC between the isBlacklisted call and the getSources call.

*** Original change description ***

Enhance WeakKeySet to auto evict keys and avoid calling toString on Keys.

This should fix https://code.google.com/p/google-guice/issues/detail?id=756.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=64507759
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
c013facb2aa0af03206fd1af2d8314f6a414ec98 08-Apr-2014 Sam Berlin <sameb@google.com> *** Reason for rollback ***

Causes an internal test to become flaky.

*** Original change description ***

Enhance WeakKeySet to auto evict keys and avoid calling toString on Keys.

This should fix https://code.google.com/p/google-guice/issues/detail?id=756.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=64181193
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
bab9b6082ff7c3aefac2dc8c7de0468fe60fe8f6 02-Apr-2014 Christian Edward Gruber <cgruber@google.com> Enhance WeakKeySet to auto evict keys and avoid calling toString on Keys.

This should fix https://code.google.com/p/google-guice/issues/detail?id=756.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=64083354
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
cade897b45ffe5d9d4e48ae7009cf74d8a91e335 02-Apr-2014 Christian Edward Gruber <cgruber@google.com> Preparations for OptionalBinder. This fixes MapBinder's SPI so elements from different MapBinders are distinct, and also fixes ProviderLookup's Provider so it exposes its dependency, which allows MapBinder to properly find its dependencies.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=63811558
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
8859456e7c13e83341641fafc8e6f79651161b0f 10-Mar-2014 Sam Berlin <sameb@google.com> Update MapBinder so it fails on duplicate bindings with a more descriptive error message, including all the keys that had duplicates and where the duplicate bindings were bound. Example error message that has 'a' bound twice and 'b' bound twice:

1) Map injection failed due to duplicated key "a", from bindings at:
com.google.inject.multibindings.MapBinderTest.configure(MapBinderTest.java:337) (via modules: com.google.inject.multibindings.MapBinderTest$1Main -> com.google.inject.multibindings.MapBinderTest$1Module1)
com.google.inject.multibindings.MapBinderTest.configure(MapBinderTest.java:344) (via modules: com.google.inject.multibindings.MapBinderTest$1Main -> com.google.inject.multibindings.MapBinderTest$1Module2)

and key: "b", from bindings at:
com.google.inject.multibindings.MapBinderTest.configure(MapBinderTest.java:345) (via modules: com.google.inject.multibindings.MapBinderTest$1Main -> com.google.inject.multibindings.MapBinderTest$1Module2)
com.google.inject.multibindings.MapBinderTest.configure(MapBinderTest.java:352) (via modules: com.google.inject.multibindings.MapBinderTest$1Main -> com.google.inject.multibindings.MapBinderTest$1Module3)

at com.google.inject.multibindings.MapBinder.initialize(MapBinder.java:380)
at com.google.inject.multibindings.MapBinderTest.configure(MapBinderTest.java:357) (via modules: com.google.inject.multibindings.MapBinderTest$1Main -> com.google.inject.multibindings.MapBinder$RealMapBinder)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=62865462
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
3338a48b6abb9a0641dc3c2c169bb59b9960dc15 06-Dec-2013 Sam Berlin <sameb@google.com> Fix issue 734 -- MapBinder doesn't allow injection of Map<K, javax.inject.Provider<V>>.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=57798745
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
6c69bcf53d4122b0f05f44783c0d8a61afd83911 18-Sep-2013 Christian Edward Gruber <cgruber@google.com> 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.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=50556753
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
b7a02b02d81c830d148355c90bc309bcd66fb592 08-Jul-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> * Remove unused imports
* Sort imports
* Convert tabs to spaces
* Fix the ant no_aop build


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2532


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1572 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
d9c913acca55023ef5d76a32c3d4a51ee6b420cb 26-Jun-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> switch Guice from manually repackaging Guava to depending on Guava. it's still jarjar'd right now, which is causing a ~400k increase in guice-snapshot.jar. next step is to switch to ProGuard to remove the unnecessary code and cut it back down (even further?!). this will let people build from Guice source and depend directly on Guava code without having to worry about hiding internal/util.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1558 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
895fa396feac44617bd45d27329d9edcab0447ad 16-Jun-2011 drew.mclaughlin <drew.mclaughlin@d779f126-a31b-0410-b53b-1d3aecad763e> Implement hashCode and equals for MultimapBinder.

Prevents duplicate installations when using MapBinder.permitDuplicates(), which installs a MultimapBinder every time it is called.


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1555 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
8b64d455b982d5841480a0247c15d68de0759c91 13-Dec-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> Remove InjectorBuilder in favor of methods in Binder.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1457 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
75fcf6f3a7ae2000b8ed85038dfd33bedd0503fa 20-Sep-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 539 - extension SPI for Multibinder/MapBinder.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1253 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
9a227bef3b82a045323ef2cf38ec60b2e42cf0fe 03-Jul-2010 limpbizkit@gmail.com <limpbizkit@gmail.com@d779f126-a31b-0410-b53b-1d3aecad763e> Move internal utility code to separate package.

These files have moved from c.g.i.internal to c.g.i.internal.util. Visibility has been increased when necessary.

AbstractIterator.java
AbstractMapEntry.java
AsynchronousComputationException.java
Classes.java
Collections2.java
ComputationException.java
CustomConcurrentHashMap.java
ExpirationTimer.java
FinalizablePhantomReference.java
FinalizableReference.java
FinalizableReferenceQueue.java
FinalizableSoftReference.java
FinalizableWeakReference.java
Finalizer.java
Function.java
Hashing.java
ImmutableCollection.java
ImmutableEntry.java
ImmutableList.java
ImmutableMap.java
ImmutableSet.java
Iterables.java
Iterators.java
Join.java
LineNumbers.java
Lists.java
MapMaker.java
Maps.java
NullOutputException.java
ObjectArrays.java
Objects.java
Preconditions.java
Sets.java
SourceProvider.java
StackTraceElements.java
Stopwatch.java
Strings.java
ToStringBuilder.java
UnmodifiableIterator.java

The rest of this change is just imports changes. Thanks to Max Bowsher for the idea.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1185 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
680c8b527ea94df6161aa9a61f00563338221e64 11-Jun-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> fixes issue 490 -- sets using marker annotations don't work properly all the time.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1173 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
34d2f00eee00ba170c3dffa72154399b830a67a6 02-May-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> add two more failing tests for Map/Multibinder -- permitDuplicates should be allowable through Module.overrides calls.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1157 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
8bc8387f63053ac03b609277093a06019c7b18b3 26-Apr-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 297 -- allow Multibinder's dependencies to be retrieved in Stage.TOOL. also added a failing test for MapBinder & Modules.override (analog to existing failing test in MultibinderTest).

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1154 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
0efcc6c784a0466ce88f30b70d651476bd7fa5ee 07-Jul-2009 netdpb <netdpb@d779f126-a31b-0410-b53b-1d3aecad763e> Added mutlimap support to MapBinder.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1041 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
398017ae4ed96750fa54dc9ce59dc2f974dcf541 23-Jun-2009 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> New API: Multibinder.permitDuplicates() and MapBinder.permitDuplicates()

When a map binder is configured to permit duplicate keys, the value chosen is arbitrary! This may be frustrating; but otherwise it would be necessary to actually call Provider.get() on the duplicated values to compare 'em; I think the cure would be worse than the disease

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1034 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
63a9605ee0b3190071c38ce7ada836cbbb9d2864 30-Mar-2009 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Test cases that prove we have reliable iteration order for Multibinder and MapBinder

git-svn-id: https://google-guice.googlecode.com/svn/trunk@918 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
53664a7f17492bd0c3c4728df61679147907dd18 21-Feb-2009 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Regrettably replacing jarjar'd Google Collections with minimal copies of the parts that we use.

The main benefit is a (significant) reduction in size of the Guice+AOP .jar - from 1004KB to 641KB. The drawback is that it's now a lot harder to use new Google Collections features, or to keep up-to-date with Google Collections bugfixes and optimizations.



git-svn-id: https://google-guice.googlecode.com/svn/trunk@859 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
ddb3862415e078080293abba05f1a24a921c007c 29-Dec-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Supporting HasDependencies for Multibinder, MapBinder and AssistedInject v1.

AssistedInject v2 support isn't here yet, it's difficult. Since we use a child injector in that package, we need a strategy for how the bindings from that injector should work. I don't think getting this perfect is urgent.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@747 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
72d11dd102eeebf081aa5363469d28b25f9b1384 02-Nov-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Taking advantage of the error message changes in some extensions.

AssistedInject, PrivateModules and Multibindings now have nice messages that are integrated into the main CreationException.

Also tweaking the errors in Binder and Errors. If a module throws a ConfigurationException, that message will be embedded in the main CreationException message.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@655 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
a6e0e787c546a1d5e82861b5c851ca09e3bbfd06 03-Sep-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Moving error sources so they're now reported in the same place for configuration errors and runtime errors. This means that instead of seeing this:
1) Error at com.google.Foo.class(Foo.java:123)
No constructor for Foo was found

We see this:
1) No constructor for Foo was found
at com.google.Foo.class(Foo.java:123)

And what's really nice is we can now have a long chain of sources for errors. For example, suppose we follow bindings and discover something that won't work via a transitive dependency. That'll look like this:
1) No constructor for Foo was found
at com.google.Foo.class(Foo.java:123)
for parameter 0 at com.google.Bar.inject(Bar.java:345)
for field at com.google.Baz.baz(Baz.java:567)

I'll still need to go over the errors code with a few more passes to tighten things up. But I believe this is a small leap forward in the usability in our already-fantastic errors.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@615 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
9532e6267f55105992301add5accfb5c62fdeed8 18-Jun-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Eliminated static from SourceProviders. The new mechanism to specify the source of a binding is like this:
Binder myBinder = binder.withSource(source);



git-svn-id: https://google-guice.googlecode.com/svn/trunk@525 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
49f67c0f62bc1748dd32e1d86616085231e974e7 10-Jun-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Fixing owner types so they're no longer missing in ThrowingProviderBinder. Also adding the necessary precondition checks so that we always include 'em when necessary.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@514 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
eab76471fbc2118a3c07d103d4b5548e153ed9e7 26-May-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> A bunch of polish fixes for 2.0:

-All built-in Matchers are now Serializable. I needed to convert all anonymous inner classes to named nested classes.
-Objects.hashCode()
-Introducing a Types utility class with Serializable ParameterizedType and GenericArrayType implementations. Their hashCodes are consistent with Sun's JDK, although I'm not sure if that means they'll work on other Java SDKs.
- TypeLiteral Serialization fixups. Sun's Type implementations aren't Serializable, so I do some writeReplace hackery to make it just work.
- Adding some missing calls to fail() in try/catch tests
- Introducing the Asserts utility class. I'd like to keep this as lean as possible. Currently it's just the stuff we really need.
- A new TypeLiteral test that shows a problem where two keys that are functionally the same aren't equal

git-svn-id: https://google-guice.googlecode.com/svn/trunk@489 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
fa86216b3d417a08424a964f5f9e17dded91ce88 16-May-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Giving DPB full credit for authoring the MapBinder code.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@484 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
d6967b937274e0e1dab28a196d7aab647c5cc6a4 16-May-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> More testcases for multibindings, including some fairly specific tests for toString() on the Binder API

git-svn-id: https://google-guice.googlecode.com/svn/trunk@483 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java
c75363acf0118de3123ef5e90cd0682562ea2d79 13-May-2008 limpbizkit <limpbizkit@d779f126-a31b-0410-b53b-1d3aecad763e> Checking in David Baker's MapBinder implementation.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@470 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java