harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-540) [classlib][text]Method applyPattern(String) of java.text.ChoiceFormat incorrectly throws IllegalArgumentException.
Date Thu, 01 Jun 2006 02:03:29 GMT
[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
    Priority: Trivial


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


Mime
View raw message