Skip to content

Commit d529557

Browse files
authored
fix: issue with class names in arrow-c jni calls (#867)
## What's Changed Arrow C JNI code used class names which are not according to specification, making code unusable in latest graalvm 25. This PR changes class names according to JNI specification. More details at #866 Closes #866
1 parent 9cfa6ff commit d529557

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

c/src/main/cpp/jni_wrapper.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,20 @@ void ArrowArrayStreamRelease(ArrowArrayStream* stream) {
327327

328328
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
329329
JNIEnv* env;
330-
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION) != JNI_OK) {
331-
return JNI_ERR;
330+
const int err_code = vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION);
331+
if (err_code != JNI_OK) {
332+
return err_code;
332333
}
333334
JNI_METHOD_START
334-
kObjectClass = CreateGlobalClassReference(env, "Ljava/lang/Object;");
335+
kObjectClass = CreateGlobalClassReference(env, "java/lang/Object");
335336
kRuntimeExceptionClass =
336-
CreateGlobalClassReference(env, "Ljava/lang/RuntimeException;");
337+
CreateGlobalClassReference(env, "java/lang/RuntimeException");
337338
kPrivateDataClass =
338-
CreateGlobalClassReference(env, "Lorg/apache/arrow/c/jni/PrivateData;");
339+
CreateGlobalClassReference(env, "org/apache/arrow/c/jni/PrivateData");
339340
kCDataExceptionClass =
340-
CreateGlobalClassReference(env, "Lorg/apache/arrow/c/jni/CDataJniException;");
341+
CreateGlobalClassReference(env, "org/apache/arrow/c/jni/CDataJniException");
341342
kStreamPrivateDataClass = CreateGlobalClassReference(
342-
env, "Lorg/apache/arrow/c/ArrayStreamExporter$ExportedArrayStreamPrivateData;");
343+
env, "org/apache/arrow/c/ArrayStreamExporter$ExportedArrayStreamPrivateData");
343344

344345
kPrivateDataLastErrorField =
345346
GetFieldID(env, kStreamPrivateDataClass, "lastError", "[B");

0 commit comments

Comments
 (0)