On Thu, 16 Jul 2026 14:18:46 GMT, Jaikiran Pai <[email protected]> wrote:

>> src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java line 125:
>> 
>>> 123:             super(name, link.getFileAttributes());
>>> 124:             this.file = null;
>>> 125:             this.link = Objects.requireNonNull(link);
>> 
>> That's too late to call `requireNonNull`. We already called 
>> `link.getFileAttributes()` a few lines above
>
> Good catch. I've filed https://bugs.openjdk.org/browse/JDK-8388400 to address 
> this.

The null check was an intention statement about a PathNode having 3 states; in 
each of the 3 states, the fields for other 2 states are all null, the fields 
for the current state is non-null. An implicit null check for the non-null 
current state is not clear compared to a requireNonNull directly assigned to 
the intended field.

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

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

Reply via email to