On Wed, 24 Jun 2026 16:56:39 GMT, Jorn Vernee <[email protected]> wrote:
>> Chen Liang 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 four additional >> commits since the last revision: >> >> - Some comments from Viktor, more missing use of NON_FLAT_LAYOUT >> - Merge branch 'lworld' of https://github.com/openjdk/valhalla into >> cleanup/lw-reviews-0 >> - Redundant whitespace >> - Changes from review comments etc. > > src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template line > 114: > >> 112: throw new NullPointerException("Uninitialized >> null-restricted field"); >> 113: } >> 114: #end[Reference] > > Just for my understanding: why is it okay to remove this? The VM and low level libraries ensure null restricted fields never carry null upon write (with strict field initialization). The checks upon read are thus redundant. DirectMethodHandle getters and ArrayVarHandle both have no null check when they read values out of a null-restricted structure. So I think we don't need to be extra cautious here, too. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2576#discussion_r3468854696
