You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here is my issue:
in java: i have defined a Class Calculator which contains method -- public Value run(Value... inputs). And a little test data has been prepared for testing this method --
Now, for business purpose, i have to implement this unit test using python again and the corresponding java class: Value and Calculator will be reused by leveraging jnius. Here is my python code:
solution 1:
ArrayList = autoclass('java.util.ArrayList')
list = ArrayList()
list.add(Value.create(0.6))
list.add(Value.create(0.7))
calculator.run(list.toArray())
and then the exception has been thrown:
jnius.JavaException: JVM exception occurred: java.lang.ArrayStoreException.
solution 2:
import numpy as np
inputs = [Value.create(0.6), Value.create(0.7)]
calculator.run(np.array(inputs))
and then thrown:
jnius.JavaException: Invalid variable (array([<com/***/Value at 0x7f8a985599e8 jclass=com/***/Value jself=<LocalRef obj=0x7f8ac3d751f8 at 0x7f8a9852c4b0>>,
<com.***.Value at 0x7f8a98559990 jclass=com/***/Value jself=<LocalRef obj=0x7f8ac3d751f0 at 0x7f8a9852c930>>],
dtype=object),) used for L array 'Lcom/***/Value;'
Do you know how to implement the same semantics as shown in java?
👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.
here is my issue:
in java: i have defined a Class Calculator which contains method -- public Value run(Value... inputs). And a little test data has been prepared for testing this method --
and then run calculator.run(inputs).
Now, for business purpose, i have to implement this unit test using python again and the corresponding java class: Value and Calculator will be reused by leveraging jnius. Here is my python code:
solution 1:
and then the exception has been thrown:
jnius.JavaException: JVM exception occurred: java.lang.ArrayStoreException.
solution 2:
Do you know how to implement the same semantics as shown in java?
and then run calculator.run(inputs).
Thanks very much!
The text was updated successfully, but these errors were encountered: