Clone
Mihai Chira
committed
on 09 Jun 15
FLEX-34885 CAUSE: When an item is marked as updated, ListCollectionView.handlePropertyChangeEvents() assumes that it's just one property of … Show more
FLEX-34885 CAUSE: When an item is marked as updated, ListCollectionView.handlePropertyChangeEvents() assumes that it's just one property of the item that changed. However, an entire item could have changed (see the unit test committed on this ticket), in which case PropertyChangeEvent.property is null or empty. When this happens, the new item is added to the localIndex correctly, but the old one is not removed. Moreover, ArrayList still listens to the removed item for changes, and when one occurs, as in the unit test, the event it sends causes the item to be re-added to the localIndex via ListCollectionView.handlePropertyChangeEvents(). Moreover, ArrayList does not listen to the new object for changes, causing the sorting to be wrong in the wrapping ListCollectionView.

SOLUTION:

ListCollectionView.handlePropertyChangeEvents() now caters for the situation where a PropertyChangeEvent refers to an object that changed into another one (rather than just one of its properties). Also, ArrayList now removes the listeners to the old item and adds them to the new item.

Show less

master + 4 more