Skip to content

Commit

Permalink
Use correct JNI function to call ArrayList.add()
Browse files Browse the repository at this point in the history
Various testcases are being run as part of the `openj9` project.
Currently one of these tests is failing since they are able to detect
that the wrong method signature is being used by JNI calls at runtime.

This update makes the same method call only it expects a boolean to be
returned from the method call. This allows for the test to pass the JNI
method signature check.

This fixes [openj9 issue 17795](eclipse-openj9/openj9#17795).

Signed-off-by: Jason Katonica <katonica@us.ibm.com>
  • Loading branch information
jasonkatonica committed Jan 9, 2024
1 parent b058bf9 commit e85cf1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jdk/src/share/native/sun/security/pkcs11/j2secmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
* ===========================================================================
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -241,7 +247,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_Secmod_nssGetModuleList
if (jModule == NULL) {
return NULL;
}
(*env)->CallVoidMethod(env, jList, jAdd, jModule);
(*env)->CallBooleanMethod(env, jList, jAdd, jModule);
if ((*env)->ExceptionCheck(env)) {
return NULL;
}
Expand Down

0 comments on commit e85cf1a

Please sign in to comment.