Harmony
  1. Harmony
  2. HARMONY-539

ArrayList.addAll(0, ...) index out of bounds exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      The following code works on RI but causes an array index out of bounds exception on Harmony.

      ArrayList alist = new ArrayList();
      ArrayList blist = new ArrayList();
      alist.add("a");
      alist.add("b");
      blist.add("c");
      blist.add("d");
      blist.remove(0);
      blist.addAll(0, alist);

      java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1

      1. ArrayListTest.java
        0.7 kB
        Nathan Beyer
      2. jira_539_patch.txt
        0.6 kB
        Nathan Beyer

        Activity

        Hide
        Nathan Beyer added a comment -

        The patch should resolve this issue. The test case is a new unit test with the regression test.

        Show
        Nathan Beyer added a comment - The patch should resolve this issue. The test case is a new unit test with the regression test.
        Hide
        Nathan Beyer added a comment -

        I applied a fix at r412625. Mark can you check this out and see if it completely fixes the bug for you.

        Show
        Nathan Beyer added a comment - I applied a fix at r412625. Mark can you check this out and see if it completely fixes the bug for you.
        Hide
        Mark Hindess added a comment -

        Looks good. Thanks for the fix and commit.

        Show
        Mark Hindess added a comment - Looks good. Thanks for the fix and commit.
        Hide
        Nathan Beyer added a comment -

        Verified by Mark.

        Show
        Nathan Beyer added a comment - Verified by Mark.

          People

          • Assignee:
            Nathan Beyer
            Reporter:
            Mark Hindess
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development