This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: test/com/google/inject/AutobinderTest.java | |
=================================================================== | |
--- test/com/google/inject/AutobinderTest.java (revision 0) | |
+++ test/com/google/inject/AutobinderTest.java (revision 0) | |
@@ -0,0 +1,358 @@ | |
+package com.google.inject; | |
+ | |
+import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
+ | |
+import java.lang.annotation.Annotation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/com/google/inject/Binder.java | |
=================================================================== | |
--- src/com/google/inject/Binder.java (revision 379) | |
+++ src/com/google/inject/Binder.java (working copy) | |
@@ -20,6 +20,7 @@ | |
import com.google.inject.binder.AnnotatedConstantBindingBuilder; | |
import com.google.inject.binder.LinkedBindingBuilder; | |
import com.google.inject.matcher.Matcher; | |
+import com.google.inject.spi.Dependency; | |
import com.google.inject.spi.Message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/com/google/inject/Binder.java | |
=================================================================== | |
--- src/com/google/inject/Binder.java (revision 379) | |
+++ src/com/google/inject/Binder.java (working copy) | |
@@ -20,6 +20,7 @@ | |
import com.google.inject.binder.AnnotatedConstantBindingBuilder; | |
import com.google.inject.binder.LinkedBindingBuilder; | |
import com.google.inject.matcher.Matcher; | |
+import com.google.inject.spi.Dependency; | |
import com.google.inject.spi.Message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.google</groupId> | |
<artifactId>guice</artifactId> | |
<version>1.0</version> | |
<name>Guice</name> | |
<description> | |
Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5, brought to you by Google. | |
</description> | |
<url>http://code.google.com/p/google-guice/</url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/com/google/inject/spi/CloseErrors.java | |
=================================================================== | |
--- src/com/google/inject/spi/CloseErrors.java Mon Oct 06 13:42:22 BST 2008 | |
+++ src/com/google/inject/spi/CloseErrors.java Mon Oct 06 13:42:22 BST 2008 | |
@@ -0,0 +1,40 @@ | |
+/** | |
+ * | |
+ * Licensed to the Apache Software Foundation (ASF) under one or more | |
+ * contributor license agreements. See the NOTICE file distributed with | |
+ * this work for additional information regarding copyright ownership. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 1036f6c87d87 core/src/com/google/inject/Scopes.java | |
--- a/core/src/com/google/inject/Scopes.java Sat Dec 24 20:12:28 2011 +0300 | |
+++ b/core/src/com/google/inject/Scopes.java Sat Dec 24 22:52:42 2011 +0300 | |
@@ -48,9 +48,14 @@ | |
*/ | |
private volatile Object instance; | |
+ private volatile RuntimeException creatorError; | |
+ | |
// DCL on a volatile is safe as of Java 5, which we obviously require. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: C:/projects/guice/struts2/plugin/src/com/google/inject/struts2/GuiceObjectFactory.java | |
=================================================================== | |
--- C:/projects/guice/struts2/plugin/src/com/google/inject/struts2/GuiceObjectFactory.java (revision 298) | |
+++ C:/projects/guice/struts2/plugin/src/com/google/inject/struts2/GuiceObjectFactory.java (working copy) | |
@@ -100,6 +100,10 @@ | |
logger.info("Creating injector..."); | |
this.injector = Guice.createInjector(new AbstractModule() { | |
protected void configure() { | |
+ if (module != null) { | |
+ logger.info("Installing module " + module.getClass().getName()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/com/google/inject/InjectorImpl.java | |
=================================================================== | |
--- src/com/google/inject/InjectorImpl.java (revision 433) | |
+++ src/com/google/inject/InjectorImpl.java (working copy) | |
@@ -741,31 +741,90 @@ | |
protected List<SingleMemberInjector> create(Class<?> key) { | |
List<SingleMemberInjector> injectors | |
= new ArrayList<SingleMemberInjector>(); | |
- addInjectors(key, injectors); | |
+ addInjectors(key, injectors, new MethodOverrides()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "main" com.google.inject.ProvisionException: Error while locating instance | |
bound to guicetest.tool.Tool | |
for member at guicetest.service.impl.Service.<init>(Service.java:15) | |
at com.google.inject.InjectorImpl$SingleParameterInjector.inject(InjectorImpl.java:646) | |
at com.google.inject.InjectorImpl.getParameters(InjectorImpl.java:666) | |
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:140) | |
at com.google.inject.InjectorImpl$ImplicitBinding.get(InjectorImpl.java:1006) | |
at com.google.inject.InjectorImpl$9$1.call(InjectorImpl.java:708) | |
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:747) | |
at com.google.inject.InjectorImpl$9.get(InjectorImpl.java:702) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a matcher which matches classes in the given package or any | |
* subpackage. | |
* @author Gregory Kick | |
*/ | |
public static Matcher<Class> inSubpackage(final Package p) | |
{ | |
Objects.nonNull(p, "package"); | |
return new AbstractMatcher<Class>() | |
{ |