From harmony-dev-return-4321-apmail-incubator-harmony-dev-archive=incubator.apache.org@incubator.apache.org Fri Feb 17 17:35:22 2006 Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 31411 invoked from network); 17 Feb 2006 17:35:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Feb 2006 17:35:20 -0000 Received: (qmail 69831 invoked by uid 500); 17 Feb 2006 17:35:09 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 69750 invoked by uid 500); 17 Feb 2006 17:35:09 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 69728 invoked by uid 99); 17 Feb 2006 17:35:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2006 09:35:09 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 217.158.94.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [217.158.94.220] (HELO cirrus.purplecloud.com) (217.158.94.220) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2006 09:35:06 -0800 Received: (qmail 6612 invoked from network); 17 Feb 2006 17:34:45 +0000 Received: from blueice1n1.uk.ibm.com (HELO ?9.20.183.163?) (195.212.29.67) by smtp.purplecloud.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 17 Feb 2006 17:34:45 +0000 Message-ID: <43F60932.3020509@gmail.com> Date: Fri, 17 Feb 2006 17:34:42 +0000 From: Tim Ellison User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [jira] Commented: (HARMONY-64) java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if valid name starts with "x-" References: <2487439.1140185424869.JavaMail.jira@ajax.apache.org> <43F5F4C9.7070908@gmail.com> In-Reply-To: <43F5F4C9.7070908@gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N BTW: I see there is an ICU4J 3.4.2 available now -- we may want to grab that. Regards, Tim Richard Liang wrote: > Hello Tim, > > Sorry for my carelessness :-) The "icu4jni's latest code" is the CVS > HEAD checked out on Feb. 16, 2006. There is no new icu4jni release since > version 3.4. > > Richard Liang > China Software Development Lab, IBM > > > > Tim Ellison (JIRA) wrote: >> [ >> http://issues.apache.org/jira/browse/HARMONY-64?page=comments#action_12366796 >> ] >> Tim Ellison commented on HARMONY-64: >> ------------------------------------ >> >> Richard, >> >> When you say "icu4jni's latest code" can you be more specific? Was >> this HEAD or a release ... ? >> We need to know exactly what it contains before deciding whether to >> use it. >> >> Thanks, >> Tim >> >> >>> java.nio.charset.Charset.forName(String name) does not throw >>> UnsupportedCharsetException if valid name starts with "x-" >>> ----------------------------------------------------------------------------------------------------------------------- >>> >>> >>> Key: HARMONY-64 >>> URL: http://issues.apache.org/jira/browse/HARMONY-64 >>> Project: Harmony >>> Type: Bug >>> Components: Classlib >>> Reporter: Svetlana Samoilenko >>> Assignee: Tim Ellison >>> Attachments: ICUInterface34.dll, libICUInterface34.so >>> >>> According to j2se 1.4.2 specification for Charset forName(String >>> charsetName) the method must throw UnsupportedCharsetException "if >>> no support for the named charset is available in this instance of the >>> Java virtual machine". The method does not throw exception if a >>> unsupported name started with "x-". For example, the method throws an >>> exception for not supported name "xyz", but does not for "x-yz". >>> Code to reproduce: import java.nio.charset.*; public class test2 { >>> public static void main (String[] args) { >>> try{ >>> Charset ch=Charset.forName("x-yz"); >>> System.out.println("***BAD. UnsupportedCharsetException >>> must be thrown instead of creating "+ch); } catch >>> (UnsupportedCharsetException e) { >>> System.out.println("***OK. Expected UnsupportedCharsetException " + >>> e); } >>> } } >>> Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se >>> subset as described in README.txt. 2. Compile test2.java using BEA >>> 1.4 javac >>>> javac -d . test2.java >>> 3. Run java using compatible VM (J9) >>>> java -showversion test2 >>> Output: C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion >>> test2 java version "1.4.2_04" Java(TM) 2 Runtime Environment, >>> Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) >>> 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, >>> GC strategy: parallel) ***OK. Expected UnsupportedCharsetException >>> java.nio.charset.UnsupportedCharsetException: x-yz >>> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) >>> Copyright 1991, 2005 The Apache Software Foundation or its licensors, >>> as applicable. ***BAD. UnsupportedCharsetException must be thrown >>> instead of creating Charset[x-yz] >>> Suggested junit test case: >>> ------------------------ CharsetTest.java >>> ------------------------------------------------- import >>> java.nio.charset.*; import junit.framework.*; public class >>> CharsetTest extends TestCase { public static void main(String[] >>> args) { junit.textui.TestRunner.run(CharsetTest.class); } >>> public void test_forName() { try { >>> Charset ch=Charset.forName("x-yz"); >>> fail("Assert 0: UnsupportedCharsetException must be >>> thrown instead of creating: " + ch); } catch >>> (UnsupportedCharsetException e) { >>> } >>> } } >>> >> >> > -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.