Harmony
  1. Harmony
  2. HARMONY-1366

[classlib][text] Bidi(AttributedCharacterIterator) throws ArrayIndexOutOfBoundsException on RI and works OK on Harmony

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      The method java.text.Bidi(AttributedCharacterIterator) throws ArrayIndexOutOfBoundsException on RI and works OK on Harmony. Seems, it is RI bug and this issue is 'non-bug diff'.

      ===================== test.java =========================
      import java.text.*;
      import java.util.*;

      public class test {
      public static void main(String[] args)

      { System.out.println("res = " + new Bidi(new testAttributedCharacterIterator())); }

      }
      class testAttributedCharacterIterator implements AttributedCharacterIterator {
      public Set getAllAttributeKeys()

      { return null; }
      public Object getAttribute(AttributedCharacterIterator.Attribute p) { return null; }

      public Map getAttributes()

      { return null; }
      public int getRunLimit(Set p) { return 0; }
      public int getRunLimit(AttributedCharacterIterator.Attribute p) { return 0; }
      public int getRunLimit() { return 0; }
      public int getRunStart(Set p) { return 0; }
      public int getRunStart(AttributedCharacterIterator.Attribute p) { return 0; }
      public int getRunStart() { return 0; }
      public Object clone() { return null; }

      public int getIndex()

      { return 0; }
      public int getEndIndex() { return 0; }

      public int getBeginIndex()

      { return 0; }

      public char setIndex(int p)

      { return 'a'; }
      public char previous() { return 'a'; }

      public char next()

      { return 'a'; }
      public char current() { return 'a'; }

      public char last()

      { return 'a'; }
      public char first() { return 'a'; }

      }
      ======================================================

      Output:
      C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
      at java.text.Bidi.<init>(Bidi.java:139)
      at test.main(test.java:6)

      C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))

      java.lang.ArrayIndexOutOfBoundsException
      at java.text.Bidi.<init>(Bidi.java:139)
      at test.main(test.java:6)

      C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
      java version 1.5 (subset)

      (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
      res = java.text.Bidi@56845684[direction: 0 baselevel: 0 length: 0 runs: null]

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Vladimir Ivanov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development