Vojtech Zavrel created OWB-960:
----------------------------------

             Summary: Proxying varargs methods not working
                 Key: OWB-960
                 URL: https://issues.apache.org/jira/browse/OWB-960
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Interceptor and Decorators
    Affects Versions: 1.2.2
         Environment: Doesn't matter
            Reporter: Vojtech Zavrel


There is a problem when proxying varargs methods in OWB 1.2.x (at least 1.2.2 
and 1.2.4). Can you confirm it?

The bahaviour is that java.lang.reflect.Method.isVarArgs() returns false (if 
the object is OWB proxied) even if the method has varargs MODIFIER. There is a 
simple solution with modification of classes NormalScopeProxy, 
InterceptorDecoratorProxyFactory and NormalScopeProxyFactory. The 
targetModifiers are calculated in noncomplete way. The right way is adding 
bitwise inclusive OR also for VARARGS modifier (which is not public in Java 
API).

static final int VARARGS = 0x00000080;
final int targetModifiers = delegatedMethod.getModifiers() & 
(Modifier.PROTECTED | Modifier.PUBLIC | VARARGS);

Version 1.1.x that have bean using javaassist was fine. Same issue used to be 
in WELD (https://issues.jboss.org/browse/WELD-1141) 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to