-
Notifications
You must be signed in to change notification settings - Fork 60
Generator broken for jbyteArray return type #82
Copy link
Copy link
Open
Description
Suppose a wrapper like so:
private final native byte[] get_some_bytes(JNIEnv env, @JniArg(cast = "void*") long nativep);
public byte[] getBytes(long nativep) {
return get_some_bytes(null, nativep);
}
And on the wrapper side:
static jbyteArray
get_some_bytes(JNIEnv *env, void *v) {
jbyteArray value;
if (!v) {
return 0;
}
value = (*env)->NewByteArray(env, ...);
if (value == NULL)
return NULL;
(*env)->SetByteArrayRegion(env, value, 0, ..., ...);
return value;
}
Despite the "correct" JNI typing, the following error occurs:
#error Warning: bad return type. :private final native byte[] blah.get_some_bytes(org.fusesource.hawtjni.runtime.JNIEnv,long)
After going through every reference I could find, and reading the 'clazz' implementation in hawtjni, I believe this is currently broken and not a manifestation of a problem in the source code above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels