Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 96894 invoked from network); 10 Sep 2007 19:47:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2007 19:47:53 -0000 Received: (qmail 34966 invoked by uid 500); 10 Sep 2007 19:47:44 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 34945 invoked by uid 500); 10 Sep 2007 19:47:44 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 34924 invoked by uid 99); 10 Sep 2007 19:47:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 12:47:44 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 19:47:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1342F714191 for ; Mon, 10 Sep 2007 12:47:30 -0700 (PDT) Message-ID: <15962315.1189453650074.JavaMail.jira@brutus> Date: Mon, 10 Sep 2007 12:47:30 -0700 (PDT) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Assigned: (OPENJPA-361) Incorrect GREG_OFFSET offset or inconsistent usage in UUIDGenerator In-Reply-To: <4459832.1189346849735.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kevin Sutter reassigned OPENJPA-361: ------------------------------------ Assignee: Albert Lee > Incorrect GREG_OFFSET offset or inconsistent usage in UUIDGenerator > ------------------------------------------------------------------- > > Key: OPENJPA-361 > URL: https://issues.apache.org/jira/browse/OPENJPA-361 > Project: OpenJPA > Issue Type: Bug > Components: lib > Affects Versions: 1.0.0 > Environment: All platforms > Reporter: Albert Lee > Assignee: Albert Lee > Priority: Trivial > Attachments: OPENJPA-361.patch > > > In UUIDGenerator, GREG_OFFSET is defined as > // offset to move from 1/1/1970, which is 0-time for Java, to gregorian > // 0-time 10/15/1582, and multiplier to go from 100nsec to msec units > private static final long GREG_OFFSET = 0x01b21dd213814000L; > This constant is used as: > // calculate time as current millis plus offset times 100 ns ticks > long currentTime = (_currentMillis + GREG_OFFSET) * MILLI_MULT; > Based of the usage, GREG_OFFSET should be in msec unit and this value should be > (1970-1582) * 365.25 * 24 * 3600 * 1000 (ms) = 12,219,292,800,000 (ms) = 0xB1D 069B 5400 (ms) > The defined constant value 0x1b21dd213814000L is the last value in 100ns unit not ms. > This also offsets the currentTime calculation off by a factor of 10**4. > To correct the discrepency, either: > 1) GREG_OFFSET should assign the value of 0xB1D 069B 5400L instead of 0x1b2 1dd2 1381 4000L, or > 2) long currentTime = (_currentMillis * MILLI_MULT ) + GREG_OFFSET ; > Since UUID is an arbituary value, therefore I don't believe the current implementation is "incorrect" but just inconsistent in its implementation description. > Please comment on if: > 1) the suggested change will have any undesirable side-effect for UUID > 2) there is any legacy/backward compatibility problem > 3) this is worth to change at all. > If there is no objection, I'll correct the "problem" early next week. > Albert Lee. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.