harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1014) ChoiceFormat.applyPattern(..) produces stack overflow
Date Mon, 31 Jul 2006 11:56:13 GMT
ChoiceFormat.applyPattern(..) produces stack overflow 
------------------------------------------------------

                 Key: HARMONY-1014
                 URL: http://issues.apache.org/jira/browse/HARMONY-1014
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: WindowsXP
            Reporter: Mikhail Fursov


Here is test:
                Locale[] locales = Locale.getAvailableLocales();
                for (int i=0; i<locales.length;i++) {
                        Locale l = locales[i];
                        Locale.setDefault(l);
                        System.out.println("Locale " + l);
                        DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
                        System.out.println("Currency "+format.getCurrency()); 
                        System.out.println("----\n\n"); 
                }
                System.err.println("Done!");


and stacktrace:
......
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:344)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:332)
        at java.text.NumberFormat.getInstance(NumberFormat.java:263)
        at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:83)
        at java.text.ChoiceFormat.<init>(ChoiceFormat.java:65)
        at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
        at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
        at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
        at java.text.NumberFormat.getInstance(NumberFormat.java:279)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:344)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:332)
        at java.text.NumberFormat.getInstance(NumberFormat.java:263)
        at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:83)
        at java.text.ChoiceFormat.<init>(ChoiceFormat.java:65)
        at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
        at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
        at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
        at java.text.NumberFormat.getInstance(NumberFormat.java:279)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:344)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:332)
        at java.text.NumberFormat.getInstance(NumberFormat.java:263)
        at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:83)
        at java.text.ChoiceFormat.<init>(ChoiceFormat.java:65)
        at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
        at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
        at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
        at java.text.NumberFormat.getInstance(NumberFormat.java:279)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:344)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:332)
        at java.text.NumberFormat.getInstance(NumberFormat.java:263)
        at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:83)
        at java.text.ChoiceFormat.<init>(ChoiceFormat.java:65)
        at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
        at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
        at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
        at java.text.NumberFormat.getInstance(NumberFormat.java:279)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:344)
        at java.text.NumberFormat.getNumberInstance(NumberFormat.java:332)
        at java.text.NumberFormat.getInstance(NumberFormat.java:263)
        at Test.main(Test.java:19)


Proposed fix: 
remove rependency from NumberFormat and use Double.parseDouble to parse numeric values.


-- 
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