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.
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.
- blocks
-
JDK-8233268 Improve integration of Objects.requireNonNull and JEP 358 Helpful NPE
-
- In Progress
-
- links to
-
Review(master) openjdk/jdk/26600