flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Hilbert (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLEX-33913) XMLListCollection addItem(item) modifies a parent XMLList of the item
Date Tue, 19 Nov 2013 04:09:30 GMT
Stepan Hilbert created FLEX-33913:

             Summary: XMLListCollection addItem(item) modifies a parent XMLList of the item
                 Key: FLEX-33913
                 URL: https://issues.apache.org/jira/browse/FLEX-33913
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
    Affects Versions: Adobe Flex SDK 3.6 (Release), Adobe Flex SDK 4.1 (Release), Apache Flex
         Environment: Reproduced with the SDKs above in FP 11.9 on Windows IE; Likely an issue
in all OS/SDK/FP combinations.
            Reporter: Stepan Hilbert

Sample code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
			import mx.collections.XMLListCollection;
			import mx.controls.Alert;
			protected var mainXML:XML = 
					<item id="1"/>
					<item id="2"/>
					<item id="3"/>
			protected function addButton_clickHandler(event:MouseEvent):void
				trace("Length before adding: " + mainXML.item.length()); // traces '3'
				var some:XMLListCollection = new XMLListCollection();
				for each (var o:Object in mainXML.item)	{
				trace("Length After adding: " + mainXML.item.length()); // traces '5' BUT SHOULD BE STILL
	<mx:Button label="Add Items" click="addButton_clickHandler(event)" />

mainXML.item XMLList is gets modified - the 2nd and 3rd items are added to it. That shouldn't
happen and can cause very severe issues.

Do not use XMLListCollection. Array or ArrayCollection seem to be unaffected by this bug.

Related Issues:
This issue might share the same underlying cause: FLEX-21831

This message was sent by Atlassian JIRA

View raw message