harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Yu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6207) [classlib][text] SimpleDateFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition would fail
Date Tue, 16 Jun 2009 11:33:07 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720075#action_12720075

Jim Yu commented on HARMONY-6207:

Hi Tim,

Our implementation of SimpleDateFormat class is correct for this testcase. The reason of why
the testcase failed is that we used getTime method of GregorianCalendar instance to create
a Date instance as the expected value. However, there is a non-bug behavior difference between
GregorianCalendar instances of Harmony and ICU.(ICU complies with newer version of CLDR while
Harmony complies with older one I guess.) So when the testcase want to assert that the expected
Date instance created by Harmony equals the result Date instance created by ICU is true, it
failed. In a word, the testcase discovered a non-bug difference of GregorianCalendar between
Harmony and ICU other than a bug of SimpleDateFormat class. So I think we can create Date
instances directly to generate the expected values.
BTW, the non-bug behavior difference between GregorianCalendar instances of Harmony and ICU
is  another issue that we might need to consider how to solve it. But I don't think it is
the blocker for this case. 

> [classlib][text] SimpleDateFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition
would fail
> ----------------------------------------------------------------------------------------------------
>                 Key: HARMONY-6207
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6207
>             Project: Harmony
>          Issue Type: Test
>          Components: Classlib
>    Affects Versions: 5.0M9
>            Reporter: Jim Yu
>         Attachments: HARMONY-6207.diff
>   Original Estimate: 48h
>  Remaining Estimate: 48h
> Currently, the testcase SimpleDateFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition
would fail. I've investigated the root cause of this failure and found the main reason is
that the GregorianCalendar class used in the testcase is implemented by Harmony itself not
delegating to ICU. So when we call getTime of GregorianCalendar to get an Date instance as
the expected value, it would not equal to the one created by ICU as the result. E.g. the following
testcase [1] would fail while [2] can pass. So I use Date instances directly for these failing
ones in my patch. 
> [1] test.parse("yyy", "99", new GregorianCalendar(99, Calendar.JANUARY, 1)
>                 .getTime(), 0, 2);
> [2] test.parse("yyy", "99", new com.ibm.icu.util.GregorianCalendar(99, Calendar.JANUARY,
>                 .getTime(), 0, 2);

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message