Merge "More consistent JNI error reporting."