If a Java method such as
public static void foo(Object... args) {}
is called from Jython as
The call should be valid and the argsthat gets passed to the Java method should be [1, 2, [3, 4]].
The current method checks the final arg to check if it's a sequence and assumes the varargs are already being passed as a list so the call fails. A similar call without the list (eg foo(1, 2, 3)) works as expected.
A similar bug (but the other way around) can be see by calling a Java method such as
static void foo(int[] a, int... b) {}
as
which should be valid, but needs an additional empty list added to fit the vararg signature.
If a Java method such as
is called from Jython as
The call should be valid and the
argsthat gets passed to the Java method should be[1, 2, [3, 4]].The current method checks the final arg to check if it's a sequence and assumes the varargs are already being passed as a list so the call fails. A similar call without the list (eg
foo(1, 2, 3)) works as expected.A similar bug (but the other way around) can be see by calling a Java method such as
as
which should be valid, but needs an additional empty list added to fit the vararg signature.