RFR: 8377910: Minor cleanup of java/io/FileDescriptor/Sharing.java [v2]

Brian Burkhalter bpb at openjdk.org
Fri Feb 13 18:50:25 UTC 2026


On Fri, 13 Feb 2026 17:52:48 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Null checks potentially mask a more serious, fundamental problem and should be removed to allow a `NullPointerException` to be throw if the variable is `null`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8377910: In class OpenClose make arrays local to run method and other instance variables final

test/jdk/java/io/FileDescriptor/Sharing.java line 380:

> 378:                  if (fd.valid()) { // fd should not be valid after first close() call
> 379:                      System.err.println("OpenClose: FileDescriptor shouldn't be valid");
> 380:                      fail = true;

The failure reported in the parent issue occurs because `fd.valid()` is `true` at line 378. Code inspection alone does not reveal any reason for it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29718#discussion_r2805600941


More information about the core-libs-dev mailing list