maintainer-feedback requested: [Bug 235018] java/openjdk8: adding millisecond resolution to get/setLastModified breaks many apps
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Jan 17 07:15:46 UTC 2019
Bugzilla Automation <bugzilla at FreeBSD.org> has asked freebsd-java mailing list
<java at FreeBSD.org> for maintainer-feedback:
Bug 235018: java/openjdk8: adding millisecond resolution to get/setLastModified
breaks many apps
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235018
--- Description ---
The first diff in
files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c:
--- jdk/src/solaris/native/java/io/UnixFileSystem_md.c.orig 2018-12-12
23:07:51.229721000 +0100
+++ jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2018-12-12
23:12:21.847169000 +0100
@@ -208,7 +208,8 @@
WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
struct stat64 sb;
if (stat64(path, &sb) == 0) {
- rv = 1000 * (jlong)sb.st_mtime;
+ rv = (jlong)sb.st_mtim.tv_sec * 1000;
+ rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
}
} END_PLATFORM_STRING(env, path);
return rv;
Breaks many applications that depend on second vs. millisecond resolution...
for example the Last-modified header in tomcat is now incorrect and in a
REST-like API/DB it leads the header and actual file time not being equal when
they are in fact equal without the above patch.
This fundamentally breaks Java's promise of "Compile one, run anywhere"
More information about the freebsd-java
mailing list