update to asm-3.3.1, update to new cglib that fixes a bug with bridge methods, add test that verifies the fix works. (previously it worked within Eclipse but not javac because eclipse's compiler wrote out bridge methods differently.)
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1540 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/build.xml b/build.xml
index a66a186..8ee1c4c 100644
--- a/build.xml
+++ b/build.xml
@@ -235,8 +235,8 @@
</fileset>
<arg value="-DNO_AOP" />
</munge>
- <replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/asm-3.1.jar"/>" value=""/>
- <replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/cglib-2.2.1-snapshot.jar"/>" value=""/>
+ <replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/asm-3.3.1.jar"/>" value=""/>
+ <replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/cglib-2.2.2.jar"/>" value=""/>
</target>
<target name="clean.all"
diff --git a/common.xml b/common.xml
index a318ab3..087f730 100644
--- a/common.xml
+++ b/common.xml
@@ -142,8 +142,8 @@
classpath="${common.basedir}/lib/build/jarjar-snapshot.jar"/>
<jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
<fileset dir="${build.dir}/classes"/>
- <zipfileset src="${common.basedir}/lib/build/cglib-2.2.1-snapshot.jar"/>
- <zipfileset src="${common.basedir}/lib/build/asm-3.1.jar"/>
+ <zipfileset src="${common.basedir}/lib/build/cglib-2.2.2.jar"/>
+ <zipfileset src="${common.basedir}/lib/build/asm-3.3.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"/>
diff --git a/core/test/com/google/inject/MethodInterceptionTest.java b/core/test/com/google/inject/MethodInterceptionTest.java
index 1ce6966..3f27683 100644
--- a/core/test/com/google/inject/MethodInterceptionTest.java
+++ b/core/test/com/google/inject/MethodInterceptionTest.java
@@ -19,6 +19,7 @@
import com.google.inject.internal.util.ImmutableList;
import com.google.inject.internal.util.ImmutableMap;
import com.google.inject.internal.util.Iterables;
+import com.google.inject.matcher.AbstractMatcher;
import com.google.inject.matcher.Matchers;
import static com.google.inject.matcher.Matchers.only;
import com.google.inject.spi.ConstructorBinding;
@@ -28,6 +29,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import junit.framework.TestCase;
+
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
@@ -234,4 +236,33 @@
}
public static final class NotInterceptable {}
+
+ public void testInterceptingNonBridgeWorks() {
+ Injector injector = Guice.createInjector(new AbstractModule() {
+ @Override
+ protected void configure() {
+ bind(Interface.class).to(Impl.class);
+ bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
+ public boolean matches(Method t) {
+ return !t.isBridge() && t.getDeclaringClass() != Object.class;
+ }
+ }, new CountingInterceptor());
+ }
+ });
+ Interface intf = injector.getInstance(Interface.class);
+ assertEquals(0, count.get());
+ intf.aMethod(null);
+ assertEquals(1, count.get());
+ }
+
+ static class ErasedType {}
+ static class RetType extends ErasedType {}
+ static abstract class Superclass<T extends ErasedType> {
+ public T aMethod(T t) { return null; }
+ }
+ public interface Interface {
+ RetType aMethod(RetType obj);
+ }
+ public static class Impl extends Superclass<RetType> implements Interface {
+ }
}
diff --git a/lib/build/asm-3.1.jar b/lib/build/asm-3.1.jar
deleted file mode 100644
index b3baf3f..0000000
--- a/lib/build/asm-3.1.jar
+++ /dev/null
Binary files differ
diff --git a/lib/build/asm-3.3.1.jar b/lib/build/asm-3.3.1.jar
new file mode 100644
index 0000000..349f0d4
--- /dev/null
+++ b/lib/build/asm-3.3.1.jar
Binary files differ
diff --git a/lib/build/cglib-2.2.1-snapshot.jar b/lib/build/cglib-2.2.1-snapshot.jar
deleted file mode 100644
index 3a57aae..0000000
--- a/lib/build/cglib-2.2.1-snapshot.jar
+++ /dev/null
Binary files differ
diff --git a/lib/build/cglib-2.2.2.jar b/lib/build/cglib-2.2.2.jar
new file mode 100644
index 0000000..564b9f8
--- /dev/null
+++ b/lib/build/cglib-2.2.2.jar
Binary files differ