History log of /external/guice/core/src/com/google/inject/internal/InjectorImpl.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5e6c93348c4250012801b6e41753789d760f06e4 20-Apr-2015 timofeyb <timofeyb@google.com> Implement more granular locks for a Singleton scope in Guice.

Now when you can create two independent singletons using
the same injector in different threads.
This make it easy to create scopes creating singletons using
thread pools with all the concurrency being done by Guice.
As a nice side effect Singleton scope is no longer treated
specially in Guice codebase.

The obvious problem to solve is potential deadlocks:
A requires B, B requires C, C requires A where all are
singletons and all are created simultaneously.
It's impossible to detect this deadlock using information
within one thread, so we have to have a shared storage.

An idea is to have a map of creators' locks and a map
of which threads are waiting for other singletons to be created.
Using this information circular dependencies are trivially
discovered within O(N) where N is a number of concurrent threads.

Important to not that no other deadlock scenarios within
Guice code is introduced as Guice does not expose any
other scopes that can span several threads.

Now it would be possible for
client code to deadlock on itself with two lazy singletons
calling each other's providers during creation.
This is deemed as a non-issue as it is up to the client
to write a thread-safe code.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=91610630
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
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/core/src/com/google/inject/internal/InjectorImpl.java
9867f9c2142355ae958f9eeb8fb96811082c8812 02-Feb-2015 sameb <sameb@google.com> Implement my old patch for issue #366, with some tweaks. This does the
following:
* Fixes @Provides injection so that parameters are checked for nullability.
By default this will error. The flag is named:
guice_check_nullable_provides_params and can be set to ERROR, WARNING or IGNORE.
* Adds InjectionPoint.forMethod to build an InjectionPoint off an arbitrary
method.
* Adds Binder.getProvider(Dependency) to a get a Provider for a given
dependency (with all its nullability & injection points maintained).
* Update ProviderLookup to accept a Dependency in addition to a Key.

This is in preparation for two things:
1) Allowing multibindings/mapbindings/optionalbindings to be specified as
annotations on methods in a module.
2) Adding a dagger compatibility module.
... the general idea will be that I'll also add a hook into
ProvidesMethodModule somehow to look at arbitrary other annotations and let
folks process them specially.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=85353820
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
fdbdc63cc56fd2e8d8e45180261be21696f89a8d 20-Jan-2015 Tavian Barnes <tavianator@tavianator.com> Fix linked binding behavior with requireExplicitBindings() in the parent.

The old behavior was to try to create the binding in the parent,
swallow the error, and create it in the child. This restores that
behavior, as bindings created in the current injector shouldn't be
prohibited.
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
6c9726f5611c276cd51561c73633a5dc4288838e 07-Jan-2015 Tavian Barnes <tavianator@tavianator.com> Clarify some documentation about linked bindings and child injectors.
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
1dd0a91aa5824ebd63d1f0a038d3c9dedbe56bd1 20-Dec-2014 Tavian Barnes <tavianator@tavianator.com> Fix https://github.com/google/guice/issues/888.

When Binder.requireExplicitBindings() is in effect, don't allow any
JIT bindings to be created in parent injectors, even JIT bindings that
are normally exempt such as the targets of linked key bindings.
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
12857901e511f32395cbe2722f55af93b81f01aa 06-Aug-2014 Sam Berlin <sameb@google.com> Guice: Fix for issue 295 (@ProvidedBy doesn't work with enums)
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=72100195
/external/guice/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.java
ca81e59c8864a19e061fe5fd3c8dece43cbaf847 01-Jul-2014 Sam Berlin <sameb@google.com> Submitting Stuart McCulloch's patch from https://github.com/sonatype/sisu-guice/blob/master/PATCHES/GUICE_288_decouple_thread_local.patch.

This rearranges the furniture a bit so we can track down some strange allocations in ThreadLocal#get().

Thanks, Stuart!
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69169927
/external/guice/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.java
c01ba1d84d542110167e7bdb4bb6d522b30055ea 18-Sep-2013 Christian Edward Gruber <cgruber@google.com> Convert an anonymous subclass of ThreadLocal in the implementation of InjectorImpl to a nested class, thus eliminating its implicit parent reference. This implicit parent reference creates some additional work during debugging and is unnecessary.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=51925521
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
9e2d95b4393bd41b7eb882705d208124e2a4dd18 27-Jun-2013 Christian Edward Gruber <cgruber@google.com> Clean up some formatting (includes some format artifacts from internal changes), and remove executable bit from several files which do not need them.
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
e39158525475eca7971966c667494d240be7e242 16-May-2013 Christian Edward Gruber <cgruber@google.com> Change Key so that it upgrades Annotation classes where all methods have default values into an instance of the Annotation with the defaults as values, so that:
@Retention(RUNTIME)
@BindingAnnotation @interface AllDefaults {
int hasDefault() default 1;
}

@AllDefaults class Foo {}

void testKey() {
assertEquals(Key.get(Foo.class, Foo.class.getAnnotation(AllDefaults.class)),
Key.get(Foo.class, AllDefaults.class));
}

Also adds an option to "require exact binding annotations", which disables the error-prone fallback built into Guice whereby a binding for @Named Foo can substitute for @Named("foo") Foo if the latter doesn't exist but the former does.

-----------------
Manually Synced.
COMMIT=45600016
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
c756777526309dc6c9ff2b5df80a8f811d390c09 01-Jun-2012 Sam Berlin <sameb@google.com> Add Binder.requireAtInjectOnConstructors, to force Guice to require @Inject annotations on constructors.

Revision created by MOE tool push_codebase.
MOE_MIGRATION=4906
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
d51292d5a4a788b1275eb9ad55cf612e68640bbf 27-Feb-2012 Sam Berlin <sameb@google.com> Change ProvisionListener to expose Binding instead of Key, and change bindListener to use a Matcher for Binding instead of Key. This is a backwards incompatible change, but we haven't released yet, so it's worth doing.

Revision created by MOE tool push_codebase.
MOE_MIGRATION=4269
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
efa4e9f24a309c38c1356fd43eb76fcbca8d975a 13-Sep-2011 guice.mirrorbot@gmail.com <guice.mirrorbot@gmail.com@d779f126-a31b-0410-b53b-1d3aecad763e> Fix a bug in the way failed JIT bindings are cleaned up. Because we removed bindings from the jitBindings Map, it was possible for an Injector to try and recreate the failed JIT binding. Normally we want this behavior.. but in the case of a circular failed JIT binding, it can lead to a ComputationException from ComputingConcurrentHashMap, because we attempt to create two ConstructorInjectors for the same InjectionPoint recursively.


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3242


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1584 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
5221c15e183cb7029a305766d137d909f77e8941 22-Jul-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> Fix a few common.collect-related deprecation warnings... because it's easy!

Revision created by MOE tool push_codebase.
MOE_MIGRATION=2700


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1574 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.java
ba75f3563a179ddd3de14cfed6ba663e9e298032 12-Jun-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 631 -- expose dependency hierarchy in ProvisionListener.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1553 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
132a5db7c643b8f367eb5f09024cf13ea37c9831 05-Jun-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 78 - provision interception. this only lets you listen to provisions (both before & after provisioning occurs), it does not let you change the return value of the provision.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1551 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
d5737a60194ed44bfd8ae7948f9ca7806785d2dd 02-May-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> fix @ProvidedBy circular dependencies.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1546 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
c94f4506c70ea41068ed9c5a00ddf6711eb7357f 02-May-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> assert that ProviderInternalFactory doesn't think circular dependencies exist when the providers are in different PrivateModules, temporarily remove check for @ProvidedBy due to other things that need fixing first.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1545 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
425d099754a30565152d166d13ec1e951ff19410 02-May-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> fix provider circular dependency detection to use the Key it is creating, not the Key it is fulfulling, to catch errors sooner.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1544 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
e6ce1886f5f8f700cea00bafefd093ccbbe8addf 30-Apr-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> fix issue 626 -- properly handle circular proxies between providers (either failing or proxying), prevents StackOverflowErrors.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1543 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
9cdfe3a047011b6f78d84b189602d238bac2945a 02-Mar-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 610 - let requireExplicitBindings still allow TypeConverters to create ConvertedConstantBindings.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1512 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
cc17f1438ed7beb10c042ddbe60fb3d8a3265147 27-Feb-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> significantly improve error reporting for binding a key already bound in a child injector or private module. include all sources in the error msg (since it can be in many sibling private modules or child injectors), including whether or not it as a JIT binding.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1508 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
45ca7f66156b947c7b9c45a71ad48be9a0bcda08 20-Feb-2011 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 345 - better error message for private modules. show the source of a child binding instead of just saying its in a child injector. also give a hint that you may have wanted to expose the binding.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1498 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.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/core/src/com/google/inject/internal/InjectorImpl.java
b2f1760648f0231cec447d837ba4651d75bbf315 19-Nov-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> issue 436 -- add Injector.getTypeConverters, and expand ConvertedConstantBinding to expose the TypeConverter for it. patch graciously provided by Stuart, thanks!

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1376 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
f712ffddfa3237a84bd457ebb999bfa0951cd422 29-Oct-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> make sure MembersInjector dependencies don't blow up on requireExplicitBindings.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1327 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
6f0aee697724288e42823393d700ea770fd69da5 27-Oct-2010 sberlin <sberlin@d779f126-a31b-0410-b53b-1d3aecad763e> move @nullable to internal.util

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1323 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java
74d714c1e72bb60706ed9df4d1982971c88c10aa 21-Oct-2010 mcculls <mcculls@d779f126-a31b-0410-b53b-1d3aecad763e> Issue 552: (step 1) move core code to its own subdirectory

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1300 d779f126-a31b-0410-b53b-1d3aecad763e
/external/guice/core/src/com/google/inject/internal/InjectorImpl.java