flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tamás Nepusz (JIRA) <j...@apache.org>
Subject [jira] [Commented] (FLEX-34727) ArrayList dispatches a CollectionEvent with an invalid "items" array after removeAll()
Date Sat, 13 Jun 2015 23:50:00 GMT

    [ https://issues.apache.org/jira/browse/FLEX-34727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584884#comment-14584884
] 

Tamás Nepusz commented on FLEX-34727:
-------------------------------------

Won't this cause a problem when the user adds a null item to the ArrayList or removes a null
item from the ArrayList? In both cases, internalDispatchEvent() will be called with null as
its second argument, which is "by chance" equal to the default value but nevertheless it should
still be added to the items array.

> ArrayList dispatches a CollectionEvent with an invalid "items" array after removeAll()
> --------------------------------------------------------------------------------------
>
>                 Key: FLEX-34727
>                 URL: https://issues.apache.org/jira/browse/FLEX-34727
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Collections
>    Affects Versions: Apache Flex 4.13.0
>         Environment: Mac OS X 10.9; very likely to affect other operating systems as
well
>            Reporter: Tamás Nepusz
>            Assignee: Chris Martin
>            Priority: Trivial
>              Labels: easyfix, easytest
>             Fix For: Apache Flex 4.15.0
>
>
> Invoking {{removeAll()}} on an {{ArrayList}} dispatches a {{CollectionEvent}} with kind
= {{CollectionEvent.RESET}}. According to the documentation of the {{items}} property of {{CollectionEvent}},
> {quote}
> When the kind is CollectionEventKind.REFRESH or CollectionEventKind.RESET, this array
has zero length.
> {quote}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message