Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 69315 invoked from network); 2 Aug 2006 12:21:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 12:21:06 -0000 Received: (qmail 7152 invoked by uid 500); 2 Aug 2006 12:21:03 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 7042 invoked by uid 500); 2 Aug 2006 12:21:02 -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 7031 invoked by uid 99); 2 Aug 2006 12:21:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 05:21:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.55.52.88] (HELO fmsmga101-1.fm.intel.com) (192.55.52.88) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 05:21:01 -0700 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101-1.fm.intel.com with ESMTP; 02 Aug 2006 05:20:41 -0700 Received: from fmsmsx331.fm.intel.com (HELO fmsmsx331.amr.corp.intel.com) ([132.233.42.156]) by fmsmga001.fm.intel.com with ESMTP; 02 Aug 2006 05:20:41 -0700 X-IronPort-AV: i="4.07,204,1151910000"; d="scan'208"; a="109103135:sNHT18996145" Received: from fmsmsx312.amr.corp.intel.com ([132.233.42.227]) by fmsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 2 Aug 2006 05:20:40 -0700 Received: from mssmsx411.ccr.corp.intel.com ([10.125.2.10]) by fmsmsx312.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 2 Aug 2006 05:20:40 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: unexpected ArrayIndexOutOfBoundsException for java.text.Bidi.getRunLimit(-1) Date: Wed, 2 Aug 2006 16:20:36 +0400 Message-ID: <8E389A5F2FEABA4CB1DEC35A25CB39CE1E4B2C@mssmsx411> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: unexpected ArrayIndexOutOfBoundsException for java.text.Bidi.getRunLimit(-1) Thread-Index: Aca2Dqy4mP5HBz+aR2a6Jvz+0JU01wAHS5uA From: "Ivanov, Alexey A" To: X-OriginalArrivalTime: 02 Aug 2006 12:20:40.0809 (UTC) FILETIME=[11AF4D90:01C6B62E] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Having tested the issue more thoroughly, I must agree with Sergey it's not a bug in our code. It seems that the RI performs no analysis where text doesn't require it as in the case with "text". It just constructs a "light-weight" object, thus accepting any value to getRunLimit() and similar methods. If Bidi object is initialized with RTL-text only (e.g. "\u0634\u0627"), there will be one directional run as with "text". But in the latter case getRunLimit() throws ArrayIndexOutOfBoundsException if its parameter is not between 0 and getRunCount(). Thanks to Sergey for pointing it out. So we need to close the issue without applying any patches. Regards, -- Alexey A. Ivanov Intel Middleware Product Division >-----Original Message----- >From: Alexey Petrenko [mailto:alexey.a.petrenko@gmail.com] >Sent: Wednesday, August 02, 2006 12:34 PM >To: harmony-dev@incubator.apache.org >Subject: Re: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: >unexpected ArrayIndexOutOfBoundsException for java.text.Bidi.getRunLimit(-1) > >I agree with Sergey that RI behaviour is strange in this case and >there is more logic in Harmony. > >But... We still need to be compatible with RI. So I vote for fixing this >bug. > >SY, Alexey > >2006/8/2, Ivanov, Alexey A : >> Hi all, >> >> Does it make sense to follow the RI in this situation? >> I'm asking this because one of the comments to this issue says we >> shouldn't. >> >> IMO we should. >> >> Any other thoughts? >> >> Regards, >> -- >> Alexey A. Ivanov >> Intel Middleware Product Division >> >> >> >-----Original Message----- >> >From: Alexey A. Ivanov (JIRA) [mailto:jira@apache.org] >> >Sent: Wednesday, August 02, 2006 12:06 PM >> >To: Ivanov, Alexey A >> >Subject: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: >> >unexpected ArrayIndexOutOfBoundsException for >> java.text.Bidi.getRunLimit(-1) >> > >> > [ http://issues.apache.org/jira/browse/HARMONY-649?page=3Dall ] >> > >> >Alexey A. Ivanov updated HARMONY-649: >> >------------------------------------- >> > >> > Attachment: Bidi.patch >> > >> >The original Bidi patch contains the same code in three functions, and >> so >> >this code should be moved into a separate function to eliminate >> duplication. >> >This is what I've done. >> >This patch should be applied instead of the original one. >> > >> >> [classlib][text]compatibility: unexpected >> ArrayIndexOutOfBoundsException >> >for java.text.Bidi.getRunLimit(-1) >> >> >> ------------------------------------------------------------------------ >> - >> >---------------------------------- >> >> >> >> Key: HARMONY-649 >> >> URL: http://issues.apache.org/jira/browse/HARMONY-649 >> >> Project: Harmony >> >> Issue Type: Bug >> >> Reporter: Vladimir Ivanov >> >> Attachments: Bidi.patch, Bidi.patch, BidiTest.patch >> >> >> >> >> >> The Harmony method java.text.Bidi.getRunLimit(-1) throws >> >ArrayIndexOutOfBoundsException while RI return valid value. >> >> Note, the spec says nothing about exceptions in this case. >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D test.java = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >> import java.text.*; >> >> public class test { >> >> public static void main (String[] args) { >> >> Bidi bidi =3D new Bidi("text", Bidi.DIRECTION_LEFT_TO_RIGHT); >> >> try { >> >> System.out.println("getRunLimit(-1) =3D " + >> bidi.getRunLimit(-1) >> >+ "\npassed!"); >> >> } catch (Exception e) { >> >> e.printStackTrace(); >> >> System.out.println("failed"); >> >> } >> >> } >> >> } >> >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >> C:\tmp\tmp17>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test >> >> 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) >> >> getRunLimit(-1) =3D 4 >> >> passed! >> >> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe - >> >showversion test >> >> java version 1.5 (subset) >> >> (c) Copyright 1991, 2006 The Apache Software Foundation or its >> licensors, >> >as app >> >> licable. >> >> java.lang.ArrayIndexOutOfBoundsException: Array index out of range: >> -1 >> >> at java.text.Bidi.getRunLimit(Bidi.java:349) >> >> at test.main(test.java:7) >> >> failed >> >> C:\tmp\tmp17> >> > >> >-- >> >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 >> > >> > >> >> --------------------------------------------------------------------- >> Terms of use : http://incubator.apache.org/harmony/mailing.html >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org >> >> > > >-- >Alexey A. Petrenko >Intel Middleware Products Division > >--------------------------------------------------------------------- >Terms of use : http://incubator.apache.org/harmony/mailing.html >To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org >For additional commands, e-mail: harmony-dev-help@incubator.apache.org --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org