JDK-8333714 : Cleanup the usages of CHECK_EXCEPTION_NULL_FAIL macro in java launcher
  • Type: Task
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-06-06
  • Updated: 2024-11-08
  • Resolved: 2024-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b03Fixed
Related Reports
Relates :  
Relates :  
Description
The java launcher currently uses a CHECK_EXCEPTION_NULL_FAIL which gets passed a value. This macro first checks if a preceding operation has thrown any exception and if yes then it exits the callsite with a "return 0". Else, it then checks if the passed value is NULL and if yes, then again it exits the callsite with a "return 0". 

This macro has been used to check if a JNI specified function completed successfully. However, each of the callsites where this macro is used invokes a JNI specified function which is specified to return NULL if the operation isn't successful. As such, a mere NULL check should be enough at such call sites instead of this macro. 

This issue was brought up during a recent PR review and it was suggested that a new issue be opened to address this https://github.com/openjdk/jdk/pull/18786#issuecomment-2147452633
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/19576 Date: 2024-06-06 11:53:10 +0000
08-11-2024

Changeset: efab48c0 Author: Jaikiran Pai <jpai@openjdk.org> Date: 2024-06-14 12:48:43 +0000 URL: https://git.openjdk.org/jdk/commit/efab48c06554476eae7a7bd946dee033d16a9c38
14-06-2024