From owner-freebsd-java@freebsd.org Fri Jan 18 12:04:56 2019 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD18149B012 for ; Fri, 18 Jan 2019 12:04:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D2B248CAE6 for ; Fri, 18 Jan 2019 12:04:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 95EB3149B011; Fri, 18 Jan 2019 12:04:55 +0000 (UTC) Delivered-To: java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D74149B010 for ; Fri, 18 Jan 2019 12:04:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A088CAE5 for ; Fri, 18 Jan 2019 12:04:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 533FF1F52B for ; Fri, 18 Jan 2019 12:04:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IC4snq068148 for ; Fri, 18 Jan 2019 12:04:54 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x0IC4sPJ068137 for java@FreeBSD.org; Fri, 18 Jan 2019 12:04:54 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: java@FreeBSD.org Subject: [Bug 235018] java/openjdk8: adding millisecond resolution to get/setLastModified breaks many apps Date: Fri, 18 Jan 2019 12:04:54 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: michael.osipov@siemens.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: java@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2019 12:04:56 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235018 --- Comment #6 from Michael Osipov --- I think we need to break things down here because here we have several issu= es mixed: 1. Yes, I do agree that this change is wrong because the code isn't maintain and not portable. Moreover, this isn't something platform-specific. I have found the changes in Java 10 for millisecond precision, but Java 8 shall re= main as-is: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f0b93fbd8cf8/src/solaris/na= tive/java/io/UnixFileSystem_md.c 2. You are application is flawed (ifUnmodifiedSinceTime.equals(lastModifiedTime)) and you are relying on an implementation detail instead on the documentation: > The Javadoc clearly says: A long value representing the time the file was= last modified, measured in milliseconds since the epoch (00:00:00 GMT, Ja= nuary 1, 1970), or 0L if the file does not exist or if an I/O error occurs It may or may not contain millisecond precision, but the entire value is milliseconds. HTTP dates values are in second resolution, yet you convert i= t to a field with millisecond resolution. You must truncate both values down to seconds to make it comparable. Everything else is just flawed. If you would rely on NIO2 or new date time API with Instants you'd have the same issue in Java 8. --=20 You are receiving this mail because: You are the assignee for the bug.=