Adam Michalik created WELD-1141:
-----------------------------------
Summary: Bean proxy class has non-varargs method for original varargs method
Key: WELD-1141
URL:
https://issues.jboss.org/browse/WELD-1141
Project: Weld
Issue Type: Bug
Affects Versions: 1.1.8.Final
Reporter: Adam Michalik
Test case:
@RequestScoped
public class TestVarargs {
public void varargsMethod(String... strings) {}
}
public class TestClass {
@Inject
TestVarargs testVarargs;
public void runTest() {
testClass(testVarargs.getClass());
testClass(TestVarargs.class);
}
private void testClass(Class<?> clazz) {
for (Method m : clazz.getMethods()) {
if (m.getName().equals("varargsMethod")) {
System.out.println(clazz + " : " + m + " : " +
m.isVarArgs());
}
}
}
}
Prints:
class TestVarargs$Proxy$_$$_WeldClientProxy : public void
TestVarargs$Proxy$_$$_WeldClientProxy.varargsMethod(java.lang.String[]) : false
class TestVarargs : public void TestVarargs.varargsMethod(java.lang.String[]) : true
The method generated in Weld proxy class is not a varargs method while the original one
was. This breaks proper method lookup in tools that use reflection - in my case it was ZK
EL resolver: for ${bean.method('String arg')} where signature is method(String...)
there was proper code to handle a varargs call but only if the method was indeed declared
as Method.isVarargs(), which was not the case when ${bean} was a Weld proxy.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira