|
|
|
Test case:
@RequestScoped public class TestVarargs { public void varargsMethod(String The original issue WELD-1141 is not fixed in the 1 . 1 . x branch . strings) {} } public class TestClass { @Inject TestVarargs testVarargs;
public void runTest() { testClass(testVarargs This issue is still present in JBoss that uses WELD 1 . getClass()); testClass(TestVarargs 1 . class); }
private void testClass(Class<?> clazz) { for (Method m : clazz x . 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 This is not a varargs method while the original one was. This breaks proper method lookup pull request to get this fixed in tools that use reflection - in my case it was ZK EL resolver: for ${bean 1 . method('String arg')} where signature is method(String 1 . ..) there was proper code x so it can be backported to handle a varargs call but only if the method was indeed declared as Method JBoss EAP . isVarargs(), which was not the case when ${bean} was a Weld proxy.
|
|
|
|