public Priority[] filePriorities() {
download_priority_vector v = th.get_file_priorities();
int size = (int) v.size();
Priority[] arr = new Priority[size];
for (int i = 0; i < size; i++) {
arr[i] = Priority.fromSwig(v.get(i));
}
return arr;
}
When Priority.fromSwig() received the swig value out of v.get(i), it receives a value that does not correspond to any of the expected Priority enums swig values.
The swig values on each one of these enums are:
IGNORE -> int 0NORMAL -> int 1
...
and so on.
When Priority.fromSwig(v.get(i)) is running, v.get(i) is passing something completely unexpected:
and the loop ends up throwing an IllegalArgumentException("Invalid native value");
The issue is clearly with the download_priority_vector object returned by th.get_file_priorities()
The implementation of this method in torrent_handle.java is as follows:
public download_priority_vector get_file_priorities() {
return new download_priority_vector(libtorrent_jni.torrent_handle_get_file_priorities(swigCPtr, this), true);
}
I played manually with the libtorrent_jni code with the debugger with no luck, my guess is that this is deeper in the stack.
When
Priority.fromSwig()
received theswig
value out ofv.get(i)
, it receives a value that does not correspond to any of the expectedPriority
enums swig values.The swig values on each one of these enums are:
IGNORE -> int 0
NORMAL -> int 1
... and so on.When
Priority.fromSwig(v.get(i))
is running,v.get(i)
is passing something completely unexpected:and the loop ends up throwing an
IllegalArgumentException("Invalid native value");
The issue is clearly with the
download_priority_vector
object returned byth.get_file_priorities()
The implementation of this method in
torrent_handle.java
is as follows:I played manually with the
libtorrent_jni
code with the debugger with no luck, my guess is that this is deeper in the stack.