Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no multidimensional array support #29

Closed
flying-sheep opened this issue Sep 6, 2012 · 5 comments
Closed

no multidimensional array support #29

flying-sheep opened this issue Sep 6, 2012 · 5 comments

Comments

@flying-sheep
Copy link

testcase:

>>> DB = autoclass("java.awt.image.DataBufferDouble")
>>> DB([[.5]], 1)
JavaException: No constructor matching your arguments
>>> db = DB(1)
>>> db.getBankData()
JavaException: Invalid return definition for array

both errors shouldn’t happen, both are due to the fact that both convert_pyarray_to_java and convert_jarray_to_python can receive a definition starting with "[", i.e. a multidimensional array. e.g. the above function getBankData has the return type signature [[D, so convert_jarray_to_python(j_env, "[D", j_object) is called and fails.

an idea for convert_jarray_to_python would be to insert another elif r=="[" and calling convert_jarray_to_python recursively inside.

@ghost
Copy link

ghost commented Oct 1, 2012

@flying-sheep could test this with the master version of jnius because there have been updates regarding this issue, you can install the lastest version of jnius using the following pip command if you have all the required pip libraries:

pip install git+git://github.com/kivy/pyjnius.git

@tshirtman
Copy link
Member

I tested earlier to see if your fixes had fixed it, and it seems that not.

@flying-sheep
Copy link
Author

obviously. amirouche, one glance on convert_jarray_to_python would tell you that "[" is still not handled there, so how could it work?

i appreciate your work, but giving a detailed bugreport is also work, so plese treat it with respect and actually read what i wrote.

@ghost
Copy link

ghost commented Oct 1, 2012

True.

@flying-sheep
Copy link
Author

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants