Skip to content

Instantly share code, notes, and snippets.

@gissuebot
gissuebot / autobinder.patch
Created July 7, 2014 17:54
Migrated attachment for Guice issue 49, comment 18
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;
@gissuebot
gissuebot / GUICE_ISSUE_49_PATCH_SUGGESTION_20071106.txt
Created July 7, 2014 17:54
Migrated attachment for Guice issue 49, comment 19
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;
@gissuebot
gissuebot / GUICE_ISSUE_49_PATCH_SUGGESTION_20071107.txt
Created July 7, 2014 17:54
Migrated attachment for Guice issue 49, comment 20
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;
@gissuebot
gissuebot / guice-1.0.pom
Created July 7, 2014 17:55
Migrated attachment for Guice issue 60, comment 3
<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>
@gissuebot
gissuebot / complete_with_predestroy.patch
Created July 7, 2014 17:55
Migrated attachment for Guice issue 62, comment 36
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.
@gissuebot
gissuebot / guice-singleton-recreation.patch
Created July 7, 2014 17:55
Migrated attachment for Guice issue 62, comment 72
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.
@gissuebot
gissuebot / GuiceObjectFactory.InstallModule.patch
Created July 7, 2014 17:56
Migrated attachment for Guice issue 63, comment 0
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());
@gissuebot
gissuebot / guice_overrides.diff
Created July 7, 2014 17:56
Migrated attachment for Guice issue 67, comment 5
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());
@gissuebot
gissuebot / tool.txt
Created July 7, 2014 17:57
Migrated attachment for Guice issue 72, comment 1
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)
@gissuebot
gissuebot / inSubpackage.txt
Created July 7, 2014 17:57
Migrated attachment for Guice issue 75, comment 0
/**
* 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>()
{