提交 2c5c30be 编写于 作者: M msheppar

8037909: JNI warnings in jdk/src/windows/native/java/nio/MappedByteBuffer.c

Summary: added CHECK_NULL after JNI GetFieldID native call
Reviewed-by: alanb, chegar
上级 b80e0660
...@@ -83,9 +83,9 @@ Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jobject fdo, ...@@ -83,9 +83,9 @@ Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jobject fdo,
HANDLE h; HANDLE h;
if (handle_fdID == NULL) { if (handle_fdID == NULL) {
jclass clazz = (*env)->FindClass(env, "java/io/FileDescriptor"); jclass clazz = (*env)->FindClass(env, "java/io/FileDescriptor");
if (clazz == NULL) CHECK_NULL(clazz); //exception thrown
return; // exception thrown
handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J"); handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J");
CHECK_NULL(handle_fdID);
} }
h = jlong_to_ptr((*env)->GetLongField(env, fdo, handle_fdID)); h = jlong_to_ptr((*env)->GetLongField(env, fdo, handle_fdID));
result = FlushFileBuffers(h); result = FlushFileBuffers(h);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册