diff --git a/java/rocksjni/concurrent_task_limiter.cc b/java/rocksjni/concurrent_task_limiter.cc index ddcdda478..591f721a2 100644 --- a/java/rocksjni/concurrent_task_limiter.cc +++ b/java/rocksjni/concurrent_task_limiter.cc @@ -15,7 +15,7 @@ */ jlong Java_org_rocksdb_ConcurrentTaskLimiterImpl_newConcurrentTaskLimiterImpl0( JNIEnv* env, jclass, jstring jname, jint limit) { - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::string name = ROCKSDB_NAMESPACE::JniUtil::copyStdString(env, jname, &has_exception); if (JNI_TRUE == has_exception) { diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index b11edf7fc..fbf324179 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -945,6 +945,7 @@ rocksdb_convert_cf_paths_from_java_helper(JNIEnv* env, jobjectArray path_array, jlong* size_array_ptr = env->GetLongArrayElements(size_array, nullptr); if (nullptr == size_array_ptr) { // exception thrown: OutOfMemoryError + *has_exception = JNI_TRUE; return {}; } std::vector cf_paths; @@ -977,7 +978,7 @@ void Java_org_rocksdb_Options_setCfPaths(JNIEnv* env, jclass, jlong jhandle, jobjectArray path_array, jlongArray size_array) { auto* options = reinterpret_cast(jhandle); - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::vector cf_paths = rocksdb_convert_cf_paths_from_java_helper(env, path_array, size_array, &has_exception); @@ -4142,7 +4143,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setCfPaths(JNIEnv* env, jclass, jlongArray size_array) { auto* options = reinterpret_cast(jhandle); - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::vector cf_paths = rocksdb_convert_cf_paths_from_java_helper(env, path_array, size_array, &has_exception);