From 6b2f34f88a39031d17b858ffcf631b2fd101c2eb Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Mon, 27 Mar 2023 15:12:20 +0000 Subject: [PATCH] 8304718: GetIntArrayElements should not be passed JNI_FALSE Reviewed-by: serb --- src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m | 2 +- src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c | 2 +- .../windows/native/libawt/windows/awt_Component.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m index ee0f4c87eaf..92d7cb12855 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m @@ -759,7 +759,7 @@ Java_sun_lwawt_macosx_LWCToolkit_initIDs CHECK_NULL(getButtonDownMasksID); jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID); CHECK_EXCEPTION(); - jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE); + jint * tmp = (*env)->GetIntArrayElements(env, obj, NULL); CHECK_NULL(tmp); gButtonDownMasks = (jint*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), gNumberOfButtons); diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c index bdf2f348ec6..d39c65f5e22 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c @@ -243,7 +243,7 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton DTRACE_PRINTLN("RobotPeer: setup()"); num_buttons = numberOfButtons; - tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, JNI_FALSE); + tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, NULL); CHECK_NULL(tmp); masks = (jint *)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), num_buttons); diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp index 61f4f2684ca..ccd723435e1 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp @@ -6584,7 +6584,7 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls) "java/awt/event/InputEvent", "getButtonDownMasks", "()[I").l; CHECK_NULL(obj); - jint * tmp = env->GetIntArrayElements(obj, JNI_FALSE); + jint * tmp = env->GetIntArrayElements(obj, nullptr); CHECK_NULL(tmp); jsize len = env->GetArrayLength(obj); AwtComponent::masks = SAFE_SIZE_NEW_ARRAY(jint, len);