RFR: 8276994: java/nio/channels/Channels/TransferTo.java leaves multi-GB files in /tmp

Lance Andersen lancea at openjdk.java.net
Sun Nov 14 14:58:31 UTC 2021


On Sun, 14 Nov 2021 14:40:15 GMT, Markus KARG <duke at openjdk.java.net> wrote:

>> test/jdk/java/nio/channels/Channels/TransferTo.java line 285:
>> 
>>> 283:     @BeforeClass
>>> 284:     public static void createTempFileRegistry() {
>>> 285:         tempFiles = new LinkedList();
>> 
>> This could be initialized as part of the declaration.
>
> Yes I could do that but I think it is better to understand for the reader as it clearly explains that this code is part of the test management, not part of the test logic.

This is a simple test so really no need  not do the initialization as part of the declaration given there is no other work done by this method.

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

PR: https://git.openjdk.java.net/jdk/pull/6379


More information about the nio-dev mailing list