RFR: 8364588: Export the NPE backtracking functionality to general null-checking APIs [v4]

David Holmes dholmes at openjdk.org
Wed Oct 22 02:42:08 UTC 2025


On Tue, 5 Aug 2025 16:04:08 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Provide a general facility for our null check APIs like Objects::requireNonNull or future Checks::nullCheck (void), converting the existing infrastructure to start tracking from a given stack site (depth offset) and a given stack slot (offset value).
>> 
>> This is a necessary prerequisite for https://bugs.openjdk.org/browse/JDK-8233268, which proposes enhanced null messages to `Objects::requireNonNull`.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update NPE per roger review

As I said earlier the hotspot changes seem reasonable. I find the enum usage a bit clunky but that is just me.

I will approve for hotspot side - though as hotspot requires two reviews you should wait for a second hotspot review. Thanks.

test/hotspot/jtreg/runtime/exceptionMsgs/NullPointerException/NullCheckAPITest.java line 65:

> 63:     }
> 64: 
> 65:     static void throwNpe() {

Nit: `throwNPE`

-------------

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26600#pullrequestreview-3363495671
PR Review Comment: https://git.openjdk.org/jdk/pull/26600#discussion_r2450252079


More information about the core-libs-dev mailing list