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

ArrayList dispatches a CollectionEvent with an invalid "items" array after removeAll()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • Apache Flex 4.13.0
    • Apache Flex 4.15.0
    • Collections
    • Mac OS X 10.9; very likely to affect other operating systems as well

    Description

      Invoking removeAll() on an ArrayList dispatches a CollectionEvent with kind = CollectionEvent.RESET. According to the documentation of the items property of CollectionEvent,

      When the kind is CollectionEventKind.REFRESH or CollectionEventKind.RESET, this array has zero length.

      The event dispatched from the ArrayList contains a single null item instead, which contradicts the documentation.

      The issue can easily be fixed by updating ArrayList#internalDispatchEvent() to treat RESET and REFRESH events specially so the items array of the event is never updated in these cases.

      Attachments

        Activity

          People

            chrsmrtn Chris Martin
            ntamas Tamás Nepusz
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: