Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes return value type in a JNI method #735

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

IBMJimmyk
Copy link
Contributor

When compiling with xlclang++ (16.1.0) the following error occurs:

openj9-openjdk-jdk8/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp:295:12: error: cannot initialize return object of type 'jobject' (aka '_jobject *') with an rvalue of type 'bool'
    return false;
           ^~~~~
1 error generated.

The problem is that Java_com_sun_java_util_jar_pack_NativeUnpack_getUnusedInput expects a return value of type jobject. But, that particular line is returning false which is a bool.

This fix changes false to null so the return value type is correct.

Java_com_sun_java_util_jar_pack_NativeUnpack_getUnusedInput expects a
return value of type jobject. One line in the method was returning
false. Some compilers do not accept this so it has been changed to
return null instead.

Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
@pshipton pshipton merged commit e38fde9 into ibmruntimes:openj9 Feb 2, 2024
2 checks passed
@IBMJimmyk IBMJimmyk deleted the clang branch February 21, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants