diff --git a/jnius/jnius_conversion.pxi b/jnius/jnius_conversion.pxi index 1828153..74870e7 100644 --- a/jnius/jnius_conversion.pxi +++ b/jnius/jnius_conversion.pxi @@ -52,6 +52,8 @@ cdef void populate_args(JNIEnv *j_env, list definition_args, jvalue *j_args, arg elif isinstance(py_arg, JavaObject): jo = py_arg j_args[index].l = jo.obj + elif isinstance(py_arg, (tuple, list)): + j_args[index].l = convert_pyarray_to_java(j_env, argtype, py_arg) else: raise JavaException('Invalid python object for this ' 'argument. Want {0!r}, got {1!r}'.format( diff --git a/tests/org/jnius/BasicsTest.java b/tests/org/jnius/BasicsTest.java index 091e71c..066c61d 100644 --- a/tests/org/jnius/BasicsTest.java +++ b/tests/org/jnius/BasicsTest.java @@ -112,4 +112,8 @@ public class BasicsTest { return false; return (x[0].equals("hello") && x[1].equals("world")); } + + public boolean methodParamsObject(Object x) { + return true; + } } diff --git a/tests/test_basics.py b/tests/test_basics.py index fb81f60..e060ac2 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -77,3 +77,8 @@ class BasicsTest(unittest.TestCase): self.assertEquals(test.methodParamsArrayI([1, 2, 3]), True) self.assertEquals(test.methodParamsArrayString([ 'hello', 'world']), True) + + def test_instances_methods_params_object_list_str(self): + test = autoclass('org.jnius.BasicsTest')() + self.assertEquals(test.methodParamsObject([ + 'hello', 'world']), True)