Issue1615
Created on 2010-05-29.12:48:38 by alex.gronholm, last changed 2010-06-16.14:47:39 by zyasoft.
msg5784 (view) |
Author: Alex Grönholm (alex.gronholm) |
Date: 2010-05-29.12:48:37 |
|
Test.java
---------
public class Test {
public void test(String... args) {
}
}
Python code (jtest.py)
----------------------
import Test
Test().test()
Result
------
Traceback (most recent call last):
File "jtest.py", line 3, in <module>
Test().test()
TypeError: test(): expected 1 args; got 0
|
msg5803 (view) |
Author: Jim Baker (zyasoft) |
Date: 2010-06-14.19:45:22 |
|
This specific call is managed by org.python.core.PyReflectedFunction
|
msg5804 (view) |
Author: Jim Baker (zyasoft) |
Date: 2010-06-14.21:53:15 |
|
PyReflectedFunction and supporting classes do not take in account that a Java method may be using varargs. Because varargs is simply a form of autoboxing, it's possible to still invoke through a workaround. Using the example code submitted by Alex, this would look like:
t = Test()
t.test([]) # instead of t.test()
t.test(["abc", "xyz"]) # instead of t.test("abc", "xyz")
# etc
|
msg5814 (view) |
Author: Jim Baker (zyasoft) |
Date: 2010-06-16.14:47:39 |
|
Fixed by r7066
|
|
Date |
User |
Action |
Args |
2010-06-16 14:47:39 | zyasoft | set | status: open -> closed resolution: fixed messages:
+ msg5814 |
2010-06-14 21:53:16 | zyasoft | set | assignee: zyasoft messages:
+ msg5804 |
2010-06-14 19:45:23 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg5803 |
2010-06-01 20:22:23 | akong | set | nosy:
+ akong |
2010-05-29 12:48:38 | alex.gronholm | create | |
|