Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-411

Exception in ListOrderedMap.putAll()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-alpha1, 4.0
    • None
    • None
    • java 1.6.0_24
      Ubuntu 11.10

    Description

      Hi,

      I am encountering an IndexOutOfBoundsException in
      ListOrderedMap.putAll(int index, Map<? extends K, ? extends V> map).
      It appears in revision 1351903 (20 June 2012). I have attached a test
      that exposes this problem.

      To run the test, just do:

      $ java Test

      The output is:

      ......................................................................
      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 5, Size: 4
      at java.util.ArrayList.add(ArrayList.java:367)
      at org.apache.commons.collections.map.ListOrderedMap.put(ListOrderedMap.java:437)
      at org.apache.commons.collections.map.ListOrderedMap.putAll(ListOrderedMap.java:245)
      at Test.main(Test.java:19)
      ......................................................................

      The documentation does not specify anything like this. Is this a bug,
      or should the documentation just be updated? If the former, is there
      a patch for it?

      Thanks,

      Adrian

      Attachments

        1. Test.java
          0.5 kB
          Adrian Nistor

        Activity

          People

            Unassigned Unassigned
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: