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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: