Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 52614 invoked from network); 24 Sep 2010 17:29:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Sep 2010 17:29:15 -0000 Received: (qmail 65703 invoked by uid 500); 24 Sep 2010 17:29:14 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 65511 invoked by uid 500); 24 Sep 2010 17:29:14 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 65495 invoked by uid 99); 24 Sep 2010 17:29:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Sep 2010 17:29:14 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of devyoudw@gmail.com designates 209.85.160.177 as permitted sender) Received: from [209.85.160.177] (HELO mail-gy0-f177.google.com) (209.85.160.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Sep 2010 17:29:09 +0000 Received: by gyd12 with SMTP id 12so10137gyd.36 for ; Fri, 24 Sep 2010 10:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=vDOurAamTN3d9irkikGQ9+ApkpJ8/B2A/SL7zWhFdi8=; b=XJkHft+UNaKPRSQ2qLoM9gdeGYVqDMoYp6r08fsib/XRymAFCkmzBi3v+8jjA76KRL j8O8Dhs3fuFzfs6PrL2i8B7iVmLN5Vss57UDTHunDRIme2sVwYgZNdCqmsyK9L3Dzx9W voER/gzSCETruxQnGtVZZm9FPqWnIBqTOWqXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=c+HucZLGV9Hgwjn26byTqdoc4tqNr4OgMM4jK8B7m2B0kC0olCc6lltbxWaQUjSVrZ 3CIju7YwT2wTUVTElIy0gJZYiJ9hPaa9Ycn9MKNBRxhTbsBgPp2suBEJPpO4WCGrq7EJ rLNHsL9jggq1Bjat2jVUs7MLPkmmcslnfYLIQ= MIME-Version: 1.0 Received: by 10.100.198.4 with SMTP id v4mr4216609anf.61.1285349075817; Fri, 24 Sep 2010 10:24:35 -0700 (PDT) Received: by 10.100.211.7 with HTTP; Fri, 24 Sep 2010 10:24:35 -0700 (PDT) In-Reply-To: References: <16508996.357041285200633873.JavaMail.jira@thor> <4C9ABC65.6000202@gmail.com> <4C9C0E0B.6080703@gmail.com> <4C9C24C1.6030809@gmail.com> <4C9C31BD.2010504@gmail.com> <4C9C3BFC.2090107@gmail.com> <4C9C44ED.6040506@gmail.com> Date: Sat, 25 Sep 2010 01:24:35 +0800 Message-ID: Subject: Re: [classlib][luni] String.toLowerCase/toUpperCase incorrect for supplementary characters (HARMONY-6649) From: Deven You To: dev@harmony.apache.org Content-Type: multipart/alternative; boundary=0016e645a406139eeb049104a74c --0016e645a406139eeb049104a74c Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Hi Mohan, I have tested the same patch as you, it crashes on drlvm but works well on j9vm. Please try it. Thanks a lot! 2010/9/24 Mohanraj Loganathan > Hi Deven, > > I followed your steps 1 & 2. But java -version crashes with Harmony5.0 > > Attaching the out file of java -version. > > Thanks and Regards, > Mohan > > > 2010/9/24 Deven You : > > I have saw the error before, and I have some investigation of it. I thi= nk > > the root cause is the commit change the class load order. Before this > > commit, Locale class will be loaded before ULocale class And after this > > commit, ULocale is loaded before Locale. > > > > The direct cause is CharsetProviderImpl no longer use String.toUpperCas= e, > > instead it uses its own toUpperCase. And String.toUpperCase calls > > String.toUpperCase(Locale), this ensure Locale class will be loaded > before > > ULocale. However CharsetProviderImpl own toUpperCase uses no Locale, so > it > > causes Locale class loaded after ULocale. > > > > To solve this problem, a work around could simply be below: > > 1.Add a Locale static field in String: > > private static Locale defaulLocale =3D new Locale.getDefaultLocale(); > > ... > > 2. Change the String.toUpperCase() from calling > > toUpperCase(Locale.getDefaultLocale()) to toUpperCase(defaultLocale) > > > > above change could solve the NullPointerException mentioned by Mohan, b= ut > I > > am not sure if it is a good design. > > > > Caused by: java.lang.NullPointerException > > at com.ibm.icu.util.ULocale.getName(ULocale.java:827) > > at com.ibm.icu.util.ULocale.(ULocale.java:480) > > at java.util.Locale.(Locale.java:228) > > at java.util.Locale.(Locale.java:201) > > at java.util.Locale.(Locale.java:51) > > at com.ibm.icu.util.ULocale.(ULocale.java:109) > > > > > > > > > > > > 2010/9/24 Mohanraj Loganathan > > > >> On loading junit.jar[2] i get initialization exception[3]. This > >> exception disappears if i revert the patch committed for > >> (HARMONY-6649) toUpper/toLowerCase. > >> > >> Make sure your junit.jar contains the signature files[1]. (use the > >> junit.jar(version 3.8.2) bundled with eclipse). So with HARMONY-6649 > >> commit, I am not able to load the jar file if it's manifest contains > >> any signature related files. Any thought on this? > >> > >> > >> [1] jar -tvf junit.jar > >> 9714 Thu Aug 07 12:04:14 GMT+05:30 2008 META-INF/MANIFEST.MF > >> 9791 Thu Aug 07 12:04:14 GMT+05:30 2008 META-INF/ECLIPSE.SF > >> 3487 Thu Aug 07 12:04:14 GMT+05:30 2008 META-INF/ECLIPSE.RSA > >> 0 Fri Mar 03 15:22:26 GMT+05:30 2006 META-INF/ > >> 76 Thu Aug 07 12:04:08 GMT+05:30 2008 META-INF/eclipse.inf > >> 0 Fri Mar 03 15:22:10 GMT+05:30 2006 junit/ > >> 0 Fri Mar 03 15:22:26 GMT+05:30 2006 junit3.8.2/ > >> 0 Fri Mar 03 15:22:24 GMT+05:30 2006 junit/awtui/ > >> ............ > >> > >> [2] run command : java -cp junit.jar junit.textui.TestRunner > >> > >> [3] Exception: > >> Uncaught exception in main: > >> java.lang.ExceptionInInitializerError > >> at com.ibm.icu.util.ULocale.(ULocale.java:109) > >> at > >> com.ibm.icu.impl.ICUResourceBundle.instantiateBundle(ICUResourceBundl > >> e.java:810) > >> at > >> com.ibm.icu.impl.ICUResourceBundle.getBundleInstance(ICUResourceBundl > >> e.java:801) > >> at > >> com.ibm.icu.util.UResourceBundle.getRootType(UResourceBundle.java:489 > >> ) > >> at > >> com.ibm.icu.util.UResourceBundle.instantiateBundle(UResourceBundle.ja > >> va:536) > >> at > >> com.ibm.icu.util.UResourceBundle.getBundleInstance(UResourceBundle.ja > >> va:144) > >> at > >> com.ibm.icu.util.UResourceBundle.getBundleInstance(UResourceBundle.ja > >> va:124) > >> at com.ibm.icu.impl.ZoneMeta.getSystemTimeZone(ZoneMeta.java:50= 9) > >> at com.ibm.icu.util.TimeZone.getTimeZone(TimeZone.java:617) > >> at com.ibm.icu.util.TimeZone.getTimeZone(TimeZone.java:587) > >> at java.util.SimpleTimeZone$1.run(SimpleTimeZone.java:50) > >> at java.util.SimpleTimeZone$1.run(SimpleTimeZone.java:1) > >> at > >> java.security.AccessController.doPrivilegedImpl(AccessController.java > >> :171) > >> at > >> java.security.AccessController.doPrivileged(AccessController.java:53) > >> > >> at > java.util.SimpleTimeZone.getICUTimeZone(SimpleTimeZone.java:48) > >> at java.util.SimpleTimeZone.(SimpleTimeZone.java:110) > >> at java.util.TimeZone.(TimeZone.java:91) > >> at > >> org.apache.harmony.security.asn1.ASN1Time.getDecodedObject(ASN1Time.j > >> ava:51) > >> at > >> org.apache.harmony.security.asn1.ASN1UTCTime.decode(ASN1UTCTime.java: > >> 96) > >> at > >> org.apache.harmony.security.asn1.ASN1Choice.decode(ASN1Choice.java:32 > >> 0) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInput > >> Stream.java:665) > >> at > >> org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInput > >> Stream.java:125) > >> at > >> org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.jav > >> a:48) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInput > >> Stream.java:665) > >> at > >> org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInput > >> Stream.java:125) > >> at > >> org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.jav > >> a:48) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInput > >> Stream.java:665) > >> at > >> org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInput > >> Stream.java:125) > >> at > >> org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.jav > >> a:48) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.decodeValueCollection > >> (BerInputStream.java:755) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.readSetOf(BerInputStr > >> eam.java:733) > >> at > >> org.apache.harmony.security.asn1.DerInputStream.readSetOf(DerInputStr > >> eam.java:138) > >> at > >> org.apache.harmony.security.asn1.ASN1SetOf.decode(ASN1SetOf.java:48) > >> at > >> org.apache.harmony.security.asn1.ASN1Implicit.decode(ASN1Implicit.jav > >> a:140) > >> at > >> org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInput > >> Stream.java:665) > >> at > >> org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInput > >> Stream.java:125) > >> at > >> org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.jav > >> a:48) > >> at > >> org.apache.harmony.security.asn1.ASN1Type.decode(ASN1Type.java:97) > >> at > >> org.apache.harmony.security.pkcs7.ContentInfo$1.getDecodedObject(Cont > >> entInfo.java:153) > >> at > >> org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.jav > >> a:53) > >> at > >> org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.j > >> ava:73) > >> at > java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:296) > >> at > java.util.jar.JarVerifier.readCertificates(JarVerifier.java:265) > >> at java.util.jar.JarFile.getInputStream(JarFile.java:392) > >> at > >> java.net.URLClassLoader$URLJarHandler.createClass(URLClassLoader.java > >> :402) > >> at > >> java.net.URLClassLoader$URLJarHandler.findClass(URLClassLoader.java:3 > >> 71) > >> at > java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1209) > >> at java.net.URLClassLoader$4.run(URLClassLoader.java:901) > >> at java.net.URLClassLoader$4.run(URLClassLoader.java:1) > >> at > >> java.security.AccessController.doPrivilegedImpl(AccessController.java > >> :171) > >> at > >> java.security.AccessController.doPrivileged(AccessController.java:64) > >> > >> at java.net.URLClassLoader.findClass(URLClassLoader.java:903) > >> at java.lang.ClassLoader.loadClass(ClassLoader.java:488) > >> at > >> java.lang.ClassLoader$SystemClassLoader.loadClass(ClassLoader.java:87 > >> 0) > >> at java.lang.ClassLoader.loadClass(ClassLoader.java:267) > >> Caused by: java.lang.NullPointerException > >> at com.ibm.icu.util.ULocale.getName(ULocale.java:827) > >> at com.ibm.icu.util.ULocale.(ULocale.java:480) > >> at java.util.Locale.(Locale.java:228) > >> at java.util.Locale.(Locale.java:201) > >> at java.util.Locale.(Locale.java:51) > >> at com.ibm.icu.util.ULocale.(ULocale.java:109) > >> ... 54 more > >> FAILED to invoke JVM. > >> > >> > >> > >> > >> > >> > >> On Fri, Sep 24, 2010 at 11:57 AM, Tim Ellison > >> wrote: > >> > On 24/Sep/2010 06:58, Robert Muir wrote: > >> >> On Fri, Sep 24, 2010 at 1:49 AM, Tim Ellison > >> wrote: > >> >> > >> >>> System.out.println(new File("=F3.txt").hashCode()); > >> >>> System.out.println(new File("=F2.txt").hashCode()); > >> >>> > >> >>> prints out > >> >>> > >> >>> 889962580 > >> >>> 890776533 > >> >>> > >> >>> on both Harmony and the RI. > >> >>> > >> >>> > >> >> but perhaps this is just a bug in the RI? > >> >> according to the link: > >> >> > >> > http://download.oracle.com/javase/6/docs/api/java/io/File.html#hashCode%2= 8%29 > >> >> < > >> > http://download.oracle.com/javase/6/docs/api/java/io/File.html#hashCode%2= 8%29 > >> >Because > >> >> equality of abstract pathnames is inherently system-dependent, so i= s > the > >> >> computation of their hash codes. > >> >> > >> >> Is it a problem that "windows equals" is inconsistent with hashCode > >> here? I > >> >> admit these are corner cases. > >> > > >> > No, I don't think it is a problem. I was reviewing the invokers of > >> > toLowerCase() and was confused by the wording in the spec. I'm happ= y > >> > that we should simply lowercase it in a locale independent way, and > >> > don't need to do a "windows equals" implementation. > >> > > >> > Regards, > >> > Tim > >> > > >> > >> > >> > >> -- > >> Mohan > >> > > > > > > -- > Mohan > --0016e645a406139eeb049104a74c--