directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DIRSHARED-130) GeneralizedTime parser does not preserve milliseconds
Date Mon, 27 Jun 2011 12:28:47 GMT

     [ 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

        

Mime
View raw message