On Fri, 8 Apr 2022 16:50:45 GMT, Alan Bateman <[email protected]> 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