You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/06/02 11:44:30 UTC
[jira] Assigned: (HARMONY-540) [classlib][text]Method
applyPattern(String) of java.text.ChoiceFormat incorrectly throws
IllegalArgumentException.
[ http://issues.apache.org/jira/browse/HARMONY-540?page=all ]
Mikhail Loenko reassigned HARMONY-540:
--------------------------------------
Assign To: Mikhail Loenko
> [classlib][text]Method applyPattern(String) of java.text.ChoiceFormat incorrectly throws IllegalArgumentException.
> ------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-540
> URL: http://issues.apache.org/jira/browse/HARMONY-540
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Paulex Yang
> Assignee: Mikhail Loenko
> Priority: Trivial
> Attachments: 01.Harmony540.diff
>
> java.text.ChoiceFormat.applyPattern(String) has different behavior with RI,
> 1. RI's java.text.ChoiceFormat.applyPattern(String) set pattern to be empty when the parameter doesn't start with number, but Harmony throws IllegalArgumentException.
> 2. RI can parse the parameter correctly in which '<' follows first number, but Harmony throws IllegalArgumentException.
> The following test case reproduces the bug,
> public void testApplyPattern() throws Exception{
> ChoiceFormat f = new ChoiceFormat("");
> //for difference 2
> f=new ChoiceFormat("");
> f.applyPattern("-1<is negative| 0#is zero or fraction | 1#is one | 1<is more than 1");
> //for difference 1
> f = new ChoiceFormat("");
> f.applyPattern("-1#is negative|0#is zero or fraction|1#is one|1<is more than 1");
> String str = "org.apache.harmony.tests.java.text.ChoiceFormat";
> f.applyPattern(str);
> String ptrn = f.toPattern();
> assertEquals("Return value should be empty string for invalid pattern",
> 0, ptrn.length());
> }
> RI 5.0 passes these tests, but Harmony throws IllegalArgumentException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira