Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2019 07:15:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        java@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 235018] java/openjdk8: adding millisecond resolution to get/setLastModified breaks many apps
Message-ID:  <bug-235018-8522-j2OvMETo6j@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-235018-8522@https.bugs.freebsd.org/bugzilla/>
References:  <bug-235018-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-java mailing l=
ist
<java@FreeBSD.org> for maintainer-feedback:
Bug 235018: java/openjdk8: adding millisecond resolution to get/setLastModi=
fied
breaks many apps
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235018



--- 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) =3D=3D 0) {
-	     rv =3D 1000 * (jlong)sb.st_mtime;
+	     rv  =3D (jlong)sb.st_mtim.tv_sec * 1000;
+	     rv +=3D (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 w=
hen
they are in fact equal without the above patch.

This fundamentally breaks Java's promise of "Compile one, run anywhere"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235018-8522-j2OvMETo6j>