You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Ivanov, Alexey A" <al...@intel.com> on 2006/08/02 10:17:02 UTC

RE: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: unexpected ArrayIndexOutOfBoundsException for java.text.Bidi.getRunLimit(-1)

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=all ]
>
>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.
>> ============ test.java ===================
>> import java.text.*;
>> public class test {
>>     public static void main (String[] args) {
>>         Bidi bidi = new Bidi("text", Bidi.DIRECTION_LEFT_TO_RIGHT);
>>         try {
>>             System.out.println("getRunLimit(-1) = " +
bidi.getRunLimit(-1)
>+ "\npassed!");
>>         } catch (Exception e) {
>>             e.printStackTrace();
>>             System.out.println("failed");
>>         }
>>     }
>> }
>> ======================================
>> 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) = 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


Re: [jira] Updated: (HARMONY-649) [classlib][text]compatibility: unexpected ArrayIndexOutOfBoundsException for java.text.Bidi.getRunLimit(-1)

Posted by Alexey Petrenko <al...@gmail.com>.
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 <al...@intel.com>:
> 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=all ]
> >
> >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.
> >> ============ test.java ===================
> >> import java.text.*;
> >> public class test {
> >>     public static void main (String[] args) {
> >>         Bidi bidi = new Bidi("text", Bidi.DIRECTION_LEFT_TO_RIGHT);
> >>         try {
> >>             System.out.println("getRunLimit(-1) = " +
> bidi.getRunLimit(-1)
> >+ "\npassed!");
> >>         } catch (Exception e) {
> >>             e.printStackTrace();
> >>             System.out.println("failed");
> >>         }
> >>     }
> >> }
> >> ======================================
> >> 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) = 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