You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Ivanov (JIRA)" <ji...@apache.org> on 2006/06/23 14:39:29 UTC

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

[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
        Type: Bug

    Reporter: Vladimir Ivanov
 Attachments: 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


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

Posted by "Vladimir Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-649?page=all ]

Vladimir Ivanov updated HARMONY-649:
------------------------------------

    Attachment: Bidi.patch

patch

> [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
>         Type: Bug

>     Reporter: Vladimir Ivanov
>  Attachments: 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


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

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12425249 ] 
            
Alexey A. Ivanov commented on HARMONY-649:
------------------------------------------

I guess Sergey is right. For more details, see http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200608.mbox/%3c8E389A5F2FEABA4CB1DEC35A25CB39CE1E4B2C@mssmsx411%3e

> [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

        

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

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-649?page=all ]

Stepan Mishura closed HARMONY-649.
----------------------------------

    Resolution: Duplicate

Closing as it was fixed in HARMONY-650. Verified by Vladimir.

> [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

        

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

Posted by "Sergey Soldatov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12425203 ] 
            
Sergey Soldatov commented on HARMONY-649:
-----------------------------------------

Alexey, this patch will not work with my example. I'm sure that this issue is not a bug and just exceptional behavior of RI.

> [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

        

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

Posted by "Vladimir Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-649?page=all ]

Vladimir Ivanov updated HARMONY-649:
------------------------------------

    Attachment: BidiTest.patch

unit test

> [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
>         Type: Bug

>     Reporter: Vladimir Ivanov
>  Attachments: 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


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

Posted by "Oleg Khaschansky (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12431906 ] 
            
Oleg Khaschansky commented on HARMONY-649:
------------------------------------------

I suggest to verify and close this issue. Patch for http://issues.apache.org/jira/browse/HARMONY-650 fixes it.

> [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

        

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

Posted by "Sergey Soldatov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12421621 ] 
            
Sergey Soldatov commented on HARMONY-649:
-----------------------------------------

I don't think this patch is applicable since using a negative parameter is wrong, according to the documentation:
Parameters:
run - the index of the run, between 0 and getRunCount()

Moreover, RI behaves in the say way if you use the real text with runs. Here is the same test case with small modification.
//=================================== test.java =============================
import java.text.*;

public class test {
    public static void main (String[] args) {
        String text = "This text has \u0634\u0627\u062f\u062c\u0645\u0647\u0648\u0631 123,456 \u0645\u0646 (Arabic)";
        Bidi bidi = new Bidi(text, Bidi.DIRECTION_LEFT_TO_RIGHT);
        System.out.println("Bidi is " + bidi);
        try {
            System.out.println("getRunLimit(-1) = " + bidi.getRunLimit(-1) + "\npassed!");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("failed");
        }
    }
}
//=================================== test.java =============================

I think we need to close this issue as not a bug.


> [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, 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

        

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

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12425700 ] 
            
Stepan Mishura commented on HARMONY-649:
----------------------------------------

Vladimir(as reporter), are you agree with comments above?

> [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

        

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

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ 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

        

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

Posted by "Vladimir Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-649?page=comments#action_12432026 ] 
            
Vladimir Ivanov commented on HARMONY-649:
-----------------------------------------

verified, thanks

> [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