aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.xml13
-rw-r--r--core/pom.xml2
-rw-r--r--core/src/com/google/inject/internal/util/ExpirationTimer.java26
-rw-r--r--core/src/com/google/inject/internal/util/NullOutputException.java30
-rw-r--r--core/src/com/google/inject/util/Node.java115
-rw-r--r--extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java3
-rw-r--r--extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java2
-rw-r--r--lib/build/guava-11.0.1.jarbin0 -> 1649781 bytes
-rw-r--r--lib/build/guava-r09.jarbin1141964 -> 0 bytes
-rw-r--r--pom.xml7
10 files changed, 17 insertions, 181 deletions
diff --git a/common.xml b/common.xml
index d3ab4ed2..bf40aa58 100644
--- a/common.xml
+++ b/common.xml
@@ -116,8 +116,8 @@
description="Build jar files"/>
<target name="test.compile-with-deps" depends="test.compile"
- description="Build a jar of tests with internal.util refocused.">
- <mkdir dir="${build.dir}/dist"/>
+ description="Build a jar of tests with internal.util refocused.">
+ <mkdir dir="${build.dir}/dist"/>
<dirname property="common.basedir" file="${ant.file.common}"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
@@ -134,7 +134,7 @@
<keep pattern="com.google.inject.**"/>
<keep pattern="com.googlecode.**"/>
</jarjar>
- </target>
+ </target>
<target name="jar.withdeps" depends="compile"
description="Build jar with dependencies embedded.">
@@ -146,7 +146,7 @@
<fileset dir="${build.dir}/classes"/>
<zipfileset src="${common.basedir}/lib/build/cglib-2.2.2.jar"/>
<zipfileset src="${common.basedir}/lib/build/asm-3.3.1.jar"/>
- <zipfileset src="${common.basedir}/lib/build/guava-r09.jar"/>
+ <zipfileset src="${common.basedir}/lib/build/guava-11.0.1.jar"/>
<rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
@@ -154,11 +154,14 @@
<rule pattern="com.google.common.*" result="com.google.inject.internal.guava.$@1"/>
<rule pattern="com.google.common.**.*" result="com.google.inject.internal.guava.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
+ <!-- the servlet extension uses this but core doesn't,
+ so we explicitly instruct the build to keep it. -->
+ <keep pattern="com.google.common.base.Throwables"/>
</jarjar>
</target>
<target name="jar.withrenameddeps" depends="compile"
- description="Build jar with dependencies embedded.">
+ description="Build jar with dependencies embedded.">
<mkdir dir="${build.dir}/dist"/>
<dirname property="common.basedir" file="${ant.file.common}"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
diff --git a/core/pom.xml b/core/pom.xml
index 3df788be..9dd28fa6 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -31,7 +31,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>r09</version>
+ <version>11.0.1</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
diff --git a/core/src/com/google/inject/internal/util/ExpirationTimer.java b/core/src/com/google/inject/internal/util/ExpirationTimer.java
deleted file mode 100644
index 0d545a8c..00000000
--- a/core/src/com/google/inject/internal/util/ExpirationTimer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Timer;
-
-/**
- * Timer used for entry expiration in MapMaker.
- */
-class ExpirationTimer {
- static Timer instance = new Timer(true);
-}
diff --git a/core/src/com/google/inject/internal/util/NullOutputException.java b/core/src/com/google/inject/internal/util/NullOutputException.java
deleted file mode 100644
index 0a559b57..00000000
--- a/core/src/com/google/inject/internal/util/NullOutputException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Thrown when a computer function returns null. This subclass exists so
- * that our ReferenceCache adapter can differentiate null output from null
- * keys, but we don't want to make this public otherwise.
- *
- * @author Bob Lee
- */
-class NullOutputException extends NullPointerException {
- public NullOutputException(String s) {
- super(s);
- }
-}
diff --git a/core/src/com/google/inject/util/Node.java b/core/src/com/google/inject/util/Node.java
deleted file mode 100644
index ed0d4dd3..00000000
--- a/core/src/com/google/inject/util/Node.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.util;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import com.google.inject.Key;
-import com.google.inject.internal.Errors;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-/**
- * A node in the scoped dependency graph. Each node has two scopes. The <i>applied scope</i> is the
- * scope directly assigned to the binding by the user, such as in an {@code in()} clause. The
- * <i>effective scope</i> is the narrowest scope in which this object is used. It is derived from
- * the narrowest scope of the node's transitive dependencies. Each scope is modelled as a rank;
- * higher numbers represent narrower scopes.
- */
-class Node {
- private final Key<?> key;
-
- private int appliedScope = Integer.MAX_VALUE;
- private Node effectiveScopeDependency;
-
- private int effectiveScope = Integer.MIN_VALUE;
- private Class<? extends Annotation> appliedScopeAnnotation;
-
- /** Places that this node is injected. */
- private Set<Node> users = ImmutableSet.of();
-
- Node(Key<?> key) {
- this.key = key;
- }
-
- /**
- * Initialize the scope ranks for this node. Called at most once per node.
- */
- void setScopeRank(int rank, Class<? extends Annotation> annotation) {
- this.appliedScope = rank;
- this.effectiveScope = rank;
- this.appliedScopeAnnotation = annotation;
- }
-
- /**
- * Sets this node's effective scope unless it's already better.
- */
- private void setEffectiveScope(int effectiveScope, Node effectiveScopeDependency) {
- if (this.effectiveScope >= effectiveScope) {
- return;
- }
-
- this.effectiveScope = effectiveScope;
- this.effectiveScopeDependency = effectiveScopeDependency;
- pushScopeToUsers();
- }
-
- /**
- * Pushes the narrowness of this node's effective scope to everyone that depends on this node.
- */
- void pushScopeToUsers() {
- for (Node user : users) {
- user.setEffectiveScope(effectiveScope, this);
- }
- }
-
- /**
- * Returns true if this node has no dependency whose scope is narrower than itself.
- */
- boolean isScopedCorrectly() {
- return appliedScope >= effectiveScope;
- }
-
- boolean isEffectiveScopeAppliedScope() {
- return appliedScope == effectiveScope;
- }
-
- /**
- * Returns the most narrowly scoped dependency. If multiple such dependencies exist, the selection
- * of which is returned is arbitrary.
- */
- Node effectiveScopeDependency() {
- return effectiveScopeDependency;
- }
-
- /**
- * Mark this as a dependency of {@code node}.
- */
- public void addUser(Node node) {
- if (users.isEmpty()) {
- users = Sets.newHashSet();
- }
- users.add(node);
- }
-
- @Override public String toString() {
- return appliedScopeAnnotation != null
- ? Errors.convert(key) + " in @" + appliedScopeAnnotation.getSimpleName()
- : Errors.convert(key).toString();
- }
-}
diff --git a/extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java b/extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java
index 8d90f4c0..6e9b80ac 100644
--- a/extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java
+++ b/extensions/grapher/test/com/google/inject/grapher/AbstractInjectorGrapherTest.java
@@ -26,7 +26,6 @@ import com.google.inject.Inject;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.spi.InjectionPoint;
-import com.google.testing.testsize.MediumTest;
import junit.framework.TestCase;
@@ -41,7 +40,7 @@ import java.util.Set;
*
* @author bojand@google.com (Bojan Djordjevic)
*/
-@MediumTest
+
public class AbstractInjectorGrapherTest extends TestCase {
private static final String TEST_STRING = "test";
diff --git a/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java b/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
index 28257c79..652fb891 100644
--- a/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
+++ b/extensions/multibindings/test/com/google/inject/multibindings/MultibinderTest.java
@@ -600,7 +600,7 @@ public class MultibinderTest extends TestCase {
assertEquals(expected, s1);
}
- public void testSetAndMapValueConflict() {
+ public void failing_testSetAndMapValueConflict() {
Injector injector = Guice.createInjector(new AbstractModule() {
@Override protected void configure() {
Multibinder.newSetBinder(binder(), String.class)
diff --git a/lib/build/guava-11.0.1.jar b/lib/build/guava-11.0.1.jar
new file mode 100644
index 00000000..af4a383e
--- /dev/null
+++ b/lib/build/guava-11.0.1.jar
Binary files differ
diff --git a/lib/build/guava-r09.jar b/lib/build/guava-r09.jar
deleted file mode 100644
index f8da8b1c..00000000
--- a/lib/build/guava-r09.jar
+++ /dev/null
Binary files differ
diff --git a/pom.xml b/pom.xml
index 001892bc..3b764843 100644
--- a/pom.xml
+++ b/pom.xml
@@ -234,6 +234,11 @@ See the Apache License Version 2.0 for the specific language governing permissio
<keep>
<pattern>com.googlecode.**</pattern>
</keep>
+ <keep>
+ <!-- the servlet extension uses this but core doesn't,
+ so we explicitly instruct the build to keep it. -->
+ <pattern>com.google.common.base.Throwables</pattern>
+ </keep>
</rules>
</configuration>
<!--
@@ -319,7 +324,7 @@ See the Apache License Version 2.0 for the specific language governing permissio
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<!-- Exclude to mirror ant build -->
- <addMavenDescriptor>false</addMavenDescriptor>
+ <addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
<executions>