RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux [v11]
Severin Gehwolf
sgehwolf at openjdk.org
Tue Oct 10 08:26:09 UTC 2023
On Mon, 9 Oct 2023 18:33:41 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Severin Gehwolf has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Keep wrapper function signature compatible to statx
>> - Refactor test so as to use Linker from JEP 454.
>>
>> @enablePreview still needed as of yet. This can go once
>> JDK-8312522 integrates.
>
> test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java line 30:
>
>> 28: * @library ../.. /test/lib
>> 29: * @build jdk.test.lib.Platform
>> 30: * @enablePreview
>
> It doesn't matter but I think the convention is to put `@enablePreview` before `@library` and `@build`.
This shouldn't matter indeed as I intend to push only once #15103 is pushed not needing the `@enablePreview` annotation.
> test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java line 96:
>
>> 94: // Creation time read depends on statx system call support
>> 95: supportsCreationTimeRead = Linker.nativeLinker().defaultLookup().find("statx").isPresent();
>> 96: System.out.println("[Linux] Debug: supportsCreationTimeRead == " + supportsCreationTimeRead);
>
> I think you left a debug statement here, or if you didn't then maybe drop the work "Debug" as it looks out of place here.
I can drop the `Debug` word, but would like to keep the rest as the test behaves differently whether or not `supportsCreationTimeRead` is true or not. On a `statx`-supporting system it would check that the modified time is different from the creation time. Otherwise it wouldn't. So it's nice to know which mode the test ran in.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1351848302
PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1351843932
More information about the nio-dev
mailing list