Open timothyg-stripe opened 5 months ago
Looks like the operative code was (accidentally?) removed in https://github.com/corretto/corretto-8/commit/7b6d16bf467d537847df9c012a7d1596f46de784#diff-8e35b358b547148e08382745171514dd7efb6958f14e6ac55bf98c5a970639d9
Hello @timothyg-stripe thank you for your report.
Some time ago that code path was intentionally deleted to not change "old behavior" of that method for compatibility.
We are investigating whether we can enable this code path now or not.
@mrserb Note though: I would expect java.io.File.lastModified()
to have more compatibility impact than NIO, but the behavior of that was changed in 4b000c743faf02e14e336af9ddff24e49469c01c
correct, we found the issues only with other method. Still looking into this.
This bug is specific to Corretto 8. It cannot be reproduced under
Describe the bug
On Linux x86-64, file ctime, mtime, and atime returned from Corretto 8
java.nio.Files.readAttributes()
only have second precision. This seems to be caused by a lack of these lines from OpenJDK in Corretto 8. It causes Corretto to act in a different way compared to other OpenJDK vendors.Confusingly,
java.io.File.lastModified()
does return timestamps with millisecond precision, making Corretto internally inconsistent.To Reproduce
TestFileTime.java:
Expected behavior
I expect the two ways to get file mtime (via java.io and java.nio) to return the same value (one with millisecond precision). I also expect ctime and atime to return timestamps with millisecond precision. This is the behavior on Azul Zulu and Eclipse Temurin.
Platform information
OS:
Version: