On Fri, 19 Jun 2026 01:40:26 GMT, Jaikiran Pai <[email protected]> wrote:

>> Can I please get a review of this change which specifies that the 
>> `IdentityException` throws a `NullPointerException` if the `Class` passed to 
>> its constructor is null?
>> 
>> This change is being proposed as part of the JEP-401 standard library 
>> changes that are currently under review at 
>> https://github.com/openjdk/jdk/pull/31123.
>> 
>> A new jtreg test has been introduced to verify the basic semantics of this 
>> exception class.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Jaikiran Pai has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains three additional 
> commits since the last revision:
> 
>  - reduce the constructors in IdentityException
>  - merge latest from lworld branch
>  - 8386815: [lworld] IdentityException should specify that it throws 
> NullPointerException if the given Class is null

Changes requested by [email protected] (no known OpenJDK username).

src/java.base/share/classes/java/lang/IdentityException.java line 74:

> 72:      *               that the cause is nonexistent or unknown.
> 73:      */
> 74:     public IdentityException(Throwable cause) {

I’d rather we kept these, as it’s annoying to have to use 
[`Throwable​::initCause(…)`].

[`Throwable​::initCause(…)`]: 
https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/Throwable.html#initCause(java.lang.Throwable)

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

PR Review: 
https://git.openjdk.org/valhalla/pull/2562#pullrequestreview-4534086735
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2562#discussion_r3443537328

Reply via email to