harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regis <xu.re...@gmail.com>
Subject Re: [classlib][luni] String.toLowerCase/toUpperCase incorrect for supplementary characters (HARMONY-6649)
Date Thu, 30 Sep 2010 07:19:47 GMT
On 2010-09-30 13:44, Regis wrote:
> On 2010-09-27 10:26, Deven You wrote:
>> I have tested this patch on my local machine, Ubuntu10.04 x86. It works
>> well.
>>
>> 2010/9/27 Tim Ellison<t.p.ellison@gmail.com>
>>
>>> On 24/Sep/2010 17:51, Deven You wrote:
>>>> Here is the result of Specjbb
>>>
>>> I don't have a copy of Specjbb to try, so sorry it broke that. I think
>>> I can set up a harmony unit test to emulate the problem here once we
>>> have an acceptable solution.
>>>
>>> Snipped stack trace follows...
>>>> java.util.Locale (initialization failure)
>>>> Caused by: java.lang.NullPointerException
>>>> at com.ibm.icu.util.ULocale.getName(ULocale.java:827)
>>>> at com.ibm.icu.util.ULocale.<init>(ULocale.java:480)
>>>> at java.util.Locale.<init>(Locale.java:234)
>>>> at com.ibm.icu.util.ULocale.<clinit>(ULocale.java:109)
>>>> at com.ibm.icu.util.TimeZone.getTimeZone(TimeZone.java:617)
>>>> at java.util.SimpleTimeZone.getICUTimeZone(SimpleTimeZone.java:48)
>>>> at java.util.SimpleTimeZone.<init>(SimpleTimeZone.java:110)
>>>> at java.util.TimeZone.<clinit>(TimeZone.java:91)
>>>
>
> The problem is not completely resolved, could happen in another loading
> path (may be even more):
>
> run
>
> Collator.getAvailableLocales();
>
> got
>
> java.lang.ExceptionInInitializerError
> at com.ibm.icu.util.ULocale.<clinit>(ULocale.java:109)
> at
> com.ibm.icu.impl.ICUResourceBundle.instantiateBundle(ICUResourceBundle.java:810)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.getBundleInstance(ICUResourceBundle.java:801)
>
> at com.ibm.icu.util.UResourceBundle.getRootType(UResourceBundle.java:489)
> at
> com.ibm.icu.util.UResourceBundle.instantiateBundle(UResourceBundle.java:536)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.createULocaleList(ICUResourceBundle.java:509)
>
> at com.ibm.icu.impl.ICUResourceBundle.access$100(ICUResourceBundle.java:38)
> at
> com.ibm.icu.impl.ICUResourceBundle$AvailEntry.getULocaleList(ICUResourceBundle.java:691)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.createLocaleList(ICUResourceBundle.java:530)
>
> at com.ibm.icu.impl.ICUResourceBundle.access$200(ICUResourceBundle.java:38)
> at
> com.ibm.icu.impl.ICUResourceBundle$AvailEntry.getLocaleList(ICUResourceBundle.java:697)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.getAvailableLocales(ICUResourceBundle.java:449)
>
> at com.ibm.icu.text.Collator.getAvailableLocales(Collator.java:566)
> at java.text.Collator.getAvailableLocales(Collator.java:277)
> at TestMain.main(TestMain.java:57)
> Caused by: java.lang.NullPointerException
> at com.ibm.icu.util.ULocale.getName(ULocale.java:827)
> at com.ibm.icu.util.ULocale.<init>(ULocale.java:480)
> at java.util.Locale.<init>(Locale.java:228)
> at java.util.Locale.<init>(Locale.java:201)
> at java.util.Locale.<clinit>(Locale.java:51)
> at com.ibm.icu.util.ULocale.<clinit>(ULocale.java:109)
> ... 14 more
>
> and seems Deven's patch works here, but will see another exception may
> be caused by new version icu4j 4.4.1.1
>
> java.lang.NullPointerException
> at
> com.ibm.icu.impl.ICUResourceBundle.createBundle(ICUResourceBundle.java:1008)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.instantiateBundle(ICUResourceBundle.java:833)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.getBundleInstance(ICUResourceBundle.java:801)
>
> at com.ibm.icu.util.UResourceBundle.getRootType(UResourceBundle.java:489)
> at
> com.ibm.icu.util.UResourceBundle.instantiateBundle(UResourceBundle.java:536)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.createULocaleList(ICUResourceBundle.java:509)
>
> at com.ibm.icu.impl.ICUResourceBundle.access$100(ICUResourceBundle.java:38)
> at
> com.ibm.icu.impl.ICUResourceBundle$AvailEntry.getULocaleList(ICUResourceBundle.java:691)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.createLocaleList(ICUResourceBundle.java:530)
>
> at com.ibm.icu.impl.ICUResourceBundle.access$200(ICUResourceBundle.java:38)
> at
> com.ibm.icu.impl.ICUResourceBundle$AvailEntry.getLocaleList(ICUResourceBundle.java:697)
>
> at
> com.ibm.icu.impl.ICUResourceBundle.getAvailableLocales(ICUResourceBundle.java:449)
>
> at com.ibm.icu.text.Collator.getAvailableLocales(Collator.java:566)
> at java.text.Collator.getAvailableLocales(Collator.java:277)
> at TestMain.main(TestMain.java:57)
>

This NPE is because icu4j need a classloader to create ResourceBundle, it get 
classloader like this:

ClassLoader cl = Collator.class.getClassLoader();

In Harmony, Collator is bootstrap classloader, so cl is null, but icu4j doesn't 
check 'null' here. I can't find any way to workaround it in Harmony's code.

-- 
Best Regards,
Regis.

Mime
View raw message