Skip to content

Instantly share code, notes, and snippets.

@gissuebot
gissuebot / BindingFactory.txt
Created July 7, 2014 19:14
Migrated attachment for Guice issue 778, comment 1
Index: test/com/google/inject/commands/CommandRecorderTest.java
===================================================================
--- test/com/google/inject/commands/CommandRecorderTest.java (revision 486)
+++ test/com/google/inject/commands/CommandRecorderTest.java (working copy)
@@ -760,6 +760,10 @@
public Void visitGetProvider(GetProviderCommand command) {
throw new AssertionFailedError();
}
+
+ public Void visitAddBindingFactory(AddBindingFactoryCommand command) {
@gissuebot
gissuebot / GUICE_776_optimize_with_source.patch
Created July 7, 2014 19:13
Migrated attachment for Guice issue 776, comment 1
Description: Avoid unnecessary object creation if .withSource doesn't change the source
Author: Stuart McCulloch <mcculls@gmail.com>
Bug-Google: http://code.google.com/p/google-guice/issues/detail?id=776
Last-Update: 2013-10-22
diff --git a/core/src/com/google/inject/internal/Errors.java b/core/src/com/google/inject/internal/Errors.java
index 25e73ca..d8dd43c 100644
--- a/core/src/com/google/inject/internal/Errors.java
+++ b/core/src/com/google/inject/internal/Errors.java
@@ -115,7 +115,7 @@ public final class Errors implements Serializable {
@gissuebot
gissuebot / ExternalDocumentation.wiki.patch
Created July 7, 2014 19:13
Migrated attachment for Guice issue 773, comment 0
--- a/ExternalDocumentation.wiki
+++ b/ExternalDocumentation.wiki
@@ -9,6 +9,11 @@
===[http://www.apress.com/book/view/1590599977 Google Guice by Robbie Vanbrabant]===
_Google Guice: Agile Lightweight Dependency Injection Framework_ will not only tell you “how,” it will also tell you “why” and “why not,” so that all the knowledge you gain will be as widely applicable as possible. Filled with examples and background information, this book is an invaluable addition to your knowledge of modern agile Java.
+===[http://www.packtpub.com/learning-google-guice/book]===
+Learning Google Guice is a concise, hands-on book that covers the various areas of dependency injection using the features provided by the latest version of Google Guice. It focuses on core functionalities as well as the various extensions surrounding Guice that make it useful in other areas like web development, integration with frameworks for web development, and persistence.
+
+As a reader, you will start from developing a trivial application
@gissuebot
gissuebot / override.patch
Created July 7, 2014 19:13
Migrated attachment for Guice issue 770, comment 0
From 6c1c5f6d33e06481863a1a721fd2cf4087674797 Mon Sep 17 00:00:00 2001
From: Jakub Narloch <jmnarloch@gmail.com>
Date: Mon, 9 Sep 2013 00:03:21 +0200
Subject: [PATCH] Added functionality for runtime buinding override, by
creating new child injector that can override/or hide the
bindings of it's parent injector.
---
core/src/com/google/inject/Binder.java | 2 +
.../inject/internal/AbstractBindingProcessor.java | 7 +-
@gissuebot
gissuebot / sql.txt
Created July 7, 2014 19:13
Migrated attachment for Guice issue 763, comment 1
Description of the issue:
using thread pool in AOP: fixedPool.submit
there is weird that fixedPool.submit called a lots times
Steps to reproduce:
let:
final ExecutorService fixedPool = Executors.newFixedThreadPool(10);
@gissuebot
gissuebot / sql.txt
Created July 7, 2014 19:13
Migrated attachment for Guice issue 763, comment 0
let:
final ExecutorService fixedPool = Executors.newFixedThreadPool(10);
@AsyncDBCall
public void ssss(){
System.out.println("ssss");
}
when calling:
@gissuebot
gissuebot / GUICE_760_switch_to_cachebuilder.patch
Created July 7, 2014 19:11
Migrated attachment for Guice issue 760, comment 3
Description: Update internal caches to use Guava's CacheBuilder API
Author: Stuart McCulloch <mcculls@gmail.com>
Bug-Google: http://code.google.com/p/google-guice/issues/detail?id=760
Last-Update: 2013-09-12
diff --git a/core/src/com/google/inject/internal/Annotations.java b/core/src/com/google/inject/internal/Annotations.java
index 07e9a83..991a231 100644
--- a/core/src/com/google/inject/internal/Annotations.java
+++ b/core/src/com/google/inject/internal/Annotations.java
@@ -20,8 +20,10 @@ import com.google.common.base.Function;
@gissuebot
gissuebot / GUICE_760_switch_to_cachebuilder.patch
Created July 7, 2014 19:11
Migrated attachment for Guice issue 760, comment 1
diff --git a/core/src/com/google/inject/internal/Annotations.java b/core/src/com/google/inject/internal/Annotations.java
index 07e9a83..991a231 100644
--- a/core/src/com/google/inject/internal/Annotations.java
+++ b/core/src/com/google/inject/internal/Annotations.java
@@ -20,8 +20,10 @@ import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Joiner.MapJoiner;
import com.google.common.base.Preconditions;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
@gissuebot
gissuebot / 0001-Do-not-hide-root-exceptions-on-ASM-Java8-errors.patch
Created July 7, 2014 19:11
Migrated attachment for Guice issue 757, comment 10
From ba922af5fd294ea65955d49cbcee2815d612de79 Mon Sep 17 00:00:00 2001
From: Ben Tebulin <tebulin@gmail.com>
Date: Tue, 3 Dec 2013 17:49:50 +0100
Subject: [PATCH] Do not hide root errors on issues resolving line numbers
Currently ASM fails under Java 8. On configuration exceptions Guice
tries too resolve the real root code location which might sometimes
fail due to an ASM failure.
Instead of leading to a totally unrelated $ComputedException which
@gissuebot
gissuebot / Java8LambdaIssue.java
Created July 7, 2014 19:11
Migrated attachment for Guice issue 757, comment 0
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Provides;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.function.Supplier;
public final class Java8LambdaIssue {