Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-539

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: