On Fri, 10 Jul 2026 17:14:48 GMT, Jaikiran Pai <[email protected]> wrote:

>> PS The bug in question 
>> [JDK-8386811](https://bugs.openjdk.org/browse/JDK-8386811): "Specify the 
>> behaviour of java.lang.ref.Reference types when constructed with a null 
>> referent".
>
> The specification of `Objects#hasIdentity(Object)`, which is being linked 
> here from the throws clause, states:
> 
>> <p>This method returns {@code false} if and only if the parameter is {@code 
>> null} or ...
> 
> So I think it implicitly covers the `null` part and this throws clause 
> description maybe OK in its current form.
> 
> This is similar to what I accepted for a different review here 
> https://git.openjdk.org/jdk/pull/31123#discussion_r3557680258

Hmm. We'll see what the fix for  JDK-8386811 is like.

The preview block for this constructor states "The referent must have 
identity", which would exclude `null` per the definition in 
`Objects.hasIdentity`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3560846097

Reply via email to