RFR: 8377910: Minor cleanup of java/io/FileDescriptor/Sharing.java [v2]
Brian Burkhalter
bpb at openjdk.org
Fri Feb 13 17:52:51 UTC 2026
On Fri, 13 Feb 2026 17:45:13 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> test/jdk/java/io/FileDescriptor/Sharing.java line 370:
>>
>>> 368: for(int i=0;i<numFiles;i++) {
>>> 369: fisArray[i].close();
>>> 370: fosArray[i].close();
>>
>> It might be clearer if you change fisArray and fosArray to be local to the run method. There is no reason for them to be fields in OpenClose. Making fd and done final would help too.
>>
>> I can't see from the bug report what failed but hopefully better output with the changes.
>
>> I can't see from the bug report what failed but hopefully better output with the changes.
>
> It's not clear exactly what failed (in the parent task issue) but perhaps this will disambiguate the situation a bit.
> It might be clearer if you change fisArray and fosArray to be local to the run method. There is no reason for them to be fields in OpenClose. Making fd and done final would help too.
Done in 9dd1613.
Note that this code has bad indentation but I am leaving that alone until the end.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29718#discussion_r2805387796
More information about the core-libs-dev
mailing list