From 61f2f3fe93a8677656d9568464675703e681ae18 Mon Sep 17 00:00:00 2001 From: Stuart Douglas <stuart.w.douglas@gmail.com> Date: Thu, 15 Mar 2012 16:40:38 +1100 Subject: [PATCH 2/2] WELD-1091 Fix issue with bridge methods --- .../bean/proxy/InterceptedSubclassFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java b/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java index 822080c..c35c0de 100644 --- a/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java +++ b/impl/src/main/java/org/jboss/weld/bean/proxy/InterceptedSubclassFactory.java @@ -25,6 +25,7 @@ import java.util.Set; import javax.enterprise.inject.spi.Bean; import javassist.NotFoundException; +import javassist.bytecode.AccessFlag; import javassist.bytecode.Bytecode; import javassist.bytecode.ClassFile; import javassist.bytecode.DuplicateMemberException; @@ -106,9 +107,9 @@ public class InterceptedSubclassFactory<T> extends ProxyFactory<T> { if (!Modifier.isFinal(method.getModifiers()) && enhancedMethodSignatures.contains(new MethodSignatureImpl(method))) { try { MethodInformation methodInfo = new RuntimeMethodInformation(method); - MethodInformation delegatingMethodInfo = new StaticMethodInformation(method.getName() + SUPER_DELEGATE_SUFFIX, methodInfo.getParameterTypes(), methodInfo.getReturnType(), proxyClassType.getName()); - proxyClassType.addMethod(MethodUtils.makeMethod(delegatingMethodInfo, method.getExceptionTypes(), createDelegateToSuper(proxyClassType, methodInfo), proxyClassType.getConstPool())); + MethodInformation delegatingMethodInfo = new StaticMethodInformation(method.getName() + SUPER_DELEGATE_SUFFIX, method.getParameterTypes(), method.getReturnType(), proxyClassType.getName(), Modifier.PRIVATE | (method.getModifiers() & AccessFlag.BRIDGE)); proxyClassType.addMethod(MethodUtils.makeMethod(methodInfo, method.getExceptionTypes(), addConstructedGuardToMethodBody(proxyClassType, createForwardingMethodBody(proxyClassType, methodInfo), methodInfo), proxyClassType.getConstPool())); + proxyClassType.addMethod(MethodUtils.makeMethod(delegatingMethodInfo, method.getExceptionTypes(), createDelegateToSuper(proxyClassType, methodInfo), proxyClassType.getConstPool())); log.trace("Adding method " + method); } catch (DuplicateMemberException e) { // do nothing. This will happen if superclass methods have -- 1.7.9.3