RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux [v11]

Alan Bateman alanb at openjdk.org
Tue Oct 10 08:33:11 UTC 2023


On Tue, 10 Oct 2023 08:20:28 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> 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.

If you do leave a trace message here then better to put it after the if-then-else so that it's clear on all platforms whether file create time is tested or not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1351858240


More information about the nio-dev mailing list