On Thu, 9 Apr 2026 15:03:55 GMT, Per Minborg <[email protected]> wrote:

> This PR proposes to improve the documentation for `MemorySegment.NULL`, 
> adding an `@apiNote` discouraging the use of `==` on `MemorySegment.NULL`.
> 
> This PR superseeds https://github.com/openjdk/jdk/pull/30501

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1556:

> 1554:      * the {@code NULL} segment is of 2<sup>62</sup>.
> 1555:      *
> 1556:      * @apiNote Clients should avoid using {@code ==} to compare a 
> segment with

Is this api note not already covered if the implementations are meant to be 
treated as value based, as in no identity comparisons currently?

Though I agree its currently an easy logic error currently.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30653#discussion_r3059557646

Reply via email to