[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 10:26:03 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235018
--- Comment #2 from Michael Osipov <michael.osipov at siemens.com> ---
This affects java.io.UnixFileSystem and probably java.io.File. Well,
File#lastModified() has millisecond precision. Looking at the code in Java 11
you see:
> JNIEXPORT jlong JNICALL
> Java_java_io_UnixFileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
> jobject file)
> {
> jlong rv = 0;
>
> WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
> struct stat64 sb;
> if (stat64(path, &sb) == 0) {
> #if defined(_AIX)
> rv = (jlong)sb.st_mtime * 1000;
> rv += (jlong)sb.st_mtime_n / 1000000;
> #elif defined(MACOSX)
> rv = (jlong)sb.st_mtimespec.tv_sec * 1000;
> rv += (jlong)sb.st_mtimespec.tv_nsec / 1000000;
> #else
> rv = (jlong)sb.st_mtim.tv_sec * 1000;
> rv += (jlong)sb.st_mtim.tv_nsec / 1000000;
> #endif
> }
> } END_PLATFORM_STRING(env, path);
> return rv;
> }
This is the default now.
How does it break Tomcat, I don't get it? The RFC you are quoting is invalid.
Look into RFC 7231, chapter 7.1.1.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-java
mailing list