You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Alex Karasulu (JIRA)" <ji...@apache.org> on 2011/06/26 13:46:48 UTC
[jira] [Created] (DIRSHARED-131) GeneralizedTime parser does not
preserve milliseconds
GeneralizedTime parser does not preserve milliseconds
-----------------------------------------------------
Key: DIRSHARED-131
URL: https://issues.apache.org/jira/browse/DIRSHARED-131
Project: Directory Shared
Issue Type: Bug
Affects Versions: 1.0.0-M5
Reporter: Alex Karasulu
Assignee: Alex Karasulu
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
[jira] [Updated] (DIRSHARED-131) GeneralizedTime parser does not
preserve milliseconds
Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSHARED-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Karasulu updated DIRSHARED-131:
------------------------------------
Remaining Estimate: 1h
Original Estimate: 1h
> GeneralizedTime parser does not preserve milliseconds
> -----------------------------------------------------
>
> Key: DIRSHARED-131
> URL: https://issues.apache.org/jira/browse/DIRSHARED-131
> 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