Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26308

ListCollectionView addAllAt causes RTE on filtered collections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK 4.1 (Release)
    • Apache Flex 4.12.0
    • Collections
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Internet Explorer 8.x
      Language Found: English

    Description

      Steps to reproduce:
      1.Create an ArrayCollection with multiple items.
      2.Apply a filter function that filters all items out.
      3.Use the addAll method to add multiple items to the original collection while it's filtered.

      Actual Results:
      A RangeError saying "Index '1' specified is out of bounds."

      Expected Results:
      No error and items to all be added to the source list.

      Workaround (if any):
      Create a for each loop that uses addItem instead.

      The problem seems to lie in the ListCollectionView.addAllAt method. It loops over the addList using a for loop and attempts to addItemAt with each one, incrementing the index it adds at. addItemAt throws a RangeError if the index is greater than the length (which will be 0 if the filter applies to all items in the collection) so after the first item is added at index 0, the next item is attempted to be added at index 1 which is greater than the length of 0 and a RangeError is thrown.
      Found in the Flex SDK 4.1 release build 16076

      Attachments

        Activity

          People

            jmclean Justin Mclean
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: