RFR: 8283719: java/util/logging/CheckZombieLockTest.java failing intermittently [v2]

Daniel Fuchs dfuchs at openjdk.java.net
Fri Apr 8 17:08:25 UTC 2022


On Fri, 8 Apr 2022 16:50:45 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Incorporated review comments
>
> test/jdk/java/util/logging/CheckZombieLockTest.java line 247:
> 
>> 245:                 try (FileChannel fc = FileChannel.open(Paths.get(lock.getAbsolutePath()),
>> 246:                     StandardOpenOption.CREATE_NEW, StandardOpenOption.APPEND,
>> 247:                     StandardOpenOption.WRITE)) {
> 
> Changing this to use try-with-resources looks good. In passing I wonder why it calls lock.getAbsolutePath(), it's okay to call open with a relative path. Also, if you change this test to use import static then you could change this line to:
> 
> `try (FileChannel fc = FileChannel.open(Path.of(lock), CREATE_NEW, APPEND, WRITE))`

Good idea. Done.

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

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


More information about the core-libs-dev mailing list