JDK-8364588 : Export the NPE backtracking functionality to general null-checking APIs
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 26
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-08-04
  • Updated: 2025-08-08
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Description
JEP 358 has an NPE backtracking functionality that prints the action that causes the NPE and the source of the `null`. The part where it prints the source of the `null` is useful to general null-checking APIs. 

Initially, we anticipated to export this only for Objects::requireNonNull as seen in JDK-8233268. However, it turns out that we may have other APIs that want this too, such as `java.lang.runtime.Checks::nullCheck` as proposed by JDK-8357936. So we should export this into a generic API in `JavaLangAccess` usable by any interested null-checking APIs in the JDK, which also makes it easy to test in our own test suites.

In addition, separating this effort from the actual migration of rNN and nullCheck avoids redundant CSR review cycles and makes the whole work cleaner.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26600 Date: 2025-08-01 15:49:57 +0000
08-08-2025