Revision: 1540
Author: sberlin
Date: Wed Apr 20 09:57:24 2011
Log: 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.)
http://code.google.com/p/google-guice/source/detail?r=1540
Added:
/trunk/lib/build/asm-3.3.1.jar
/trunk/lib/build/cglib-2.2.2.jar
Deleted:
/trunk/lib/build/asm-3.1.jar
/trunk/lib/build/cglib-2.2.1-snapshot.jar
Modified:
/trunk/build.xml
/trunk/common.xml
/trunk/core/test/com/google/inject/MethodInterceptionTest.java
=======================================
--- /dev/null
+++ /trunk/lib/build/asm-3.3.1.jar Wed Apr 20 09:57:24 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/lib/build/cglib-2.2.2.jar Wed Apr 20 09:57:24 2011
Binary file, no diff available.
=======================================
--- /trunk/lib/build/asm-3.1.jar Mon May 26 13:36:11 2008
+++ /dev/null
Binary file, no diff available.
=======================================
--- /trunk/lib/build/cglib-2.2.1-snapshot.jar Sun Jan 11 12:12:42 2009
+++ /dev/null
Binary file, no diff available.
=======================================
--- /trunk/build.xml Mon Dec 20 14:26:44 2010
+++ /trunk/build.xml Wed Apr 20 09:57:24 2011
@@ -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"
=======================================
--- /trunk/common.xml Thu Feb 24 06:49:01 2011
+++ /trunk/common.xml Wed Apr 20 09:57:24 2011
@@ -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"/>
=======================================
--- /trunk/core/test/com/google/inject/MethodInterceptionTest.java Mon Feb
28 09:49:54 2011
+++ /trunk/core/test/com/google/inject/MethodInterceptionTest.java Wed Apr
20 09:57:24 2011
@@ -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 {
+ }
+}
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.