Fix inconsistent behavior of java.nio.file.attribute.BasicFileAttributes.lastModifiedTime()
Alan.Bateman at oracle.com
Fri Nov 24 18:24:01 UTC 2017
On 24/11/2017 17:29, Schaef, Martin wrote:
> There is a fix in Java 10 that increases the precision for File.lastModified (https://bugs.openjdk.java.net/browse/JDK-8177809 ). My issue is that the two methods (File.lastModified and BasicFileAttributes.lastModifiedTime) behave differently depending on the gcc version. And this is not addressed by the JDK 10 patch either.
> Find my original patch below. It addresses the Java 8 issue but would work if JDK-8177809 is back-ported.
Your patch removes the code for high precision timestamps from all
platforms, I don't think we want that.
If you backport JDK-8177809 and build with any recent gcc then you
should find that the results are consistent. If you really need to
build gcc 4.1.x (2006) then the changes for JDK-8177809 would require
#ifdef so that they aren't compiled in.
I realize your interest is jdk8u but for the main line then we do need
to re-examine the dusty #ifdef in UnixNativeDispatcher.c. I think Oracle
builds of jDK 10 use gcc 4.9.2, I believe others are probably building
with newer versions.
More information about the core-libs-dev