Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A6AC244E6 for ; Mon, 27 Jun 2011 12:29:10 +0000 (UTC) Received: (qmail 89155 invoked by uid 500); 27 Jun 2011 12:29:10 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 89114 invoked by uid 500); 27 Jun 2011 12:29:10 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 89106 invoked by uid 99); 27 Jun 2011 12:29:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2011 12:29:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2011 12:29:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 56222433FD8 for ; Mon, 27 Jun 2011 12:28:47 +0000 (UTC) Date: Mon, 27 Jun 2011 12:28:47 +0000 (UTC) From: "Alex Karasulu (JIRA)" To: dev@directory.apache.org Message-ID: <842715694.43532.1309177727332.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1087177426.41318.1309088807321.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (DIRSHARED-130) GeneralizedTime parser does not preserve milliseconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DIRSHARED-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Karasulu closed DIRSHARED-130. ----------------------------------- Resolution: Fixed Made it so by default the fractional seconds component is included. > GeneralizedTime parser does not preserve milliseconds > ----------------------------------------------------- > > Key: DIRSHARED-130 > URL: https://issues.apache.org/jira/browse/DIRSHARED-130 > Project: Directory Shared > Issue Type: Bug > Affects Versions: 1.0.0-M5 > Reporter: Alex Karasulu > Assignee: Alex Karasulu > Original Estimate: 1h > Remaining Estimate: 1h > > The GeneralizedTime class in the o.a.d.s.util package of shared-util module does not seem to preserve the milliseconds field of the time. Here's a test that shows the presence of the bug. I will add this test after creating this JIRA issue. > @Test > public void testLoseofMilliseconds() throws Exception > { > Date date = new Date(); > long originalTime = date.getTime(); > LOG.info( "original time = {}", originalTime ); > Calendar calendar = Calendar.getInstance(); > calendar.setTime( date ); > GeneralizedTime gt = new GeneralizedTime( calendar ); > String gtStr = gt.toGeneralizedTime(); > > GeneralizedTime recalculatedGt = new GeneralizedTime( gtStr ); > long recalculatedTime = recalculatedGt.getCalendar().getTime().getTime(); > > assertEquals( "The original time after GeneralizedTime transformation should stick", > originalTime, recalculatedTime ); > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira