[
https://issues.apache.org/jira/browse/FLEX-15159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15011947#comment-15011947
]
ASF GitHub Bot commented on FLEX-15159:
---------------------------------------
Github user Harbs commented on the pull request:
https://github.com/apache/flex-sdk/pull/18#issuecomment-157861022
Using Proxy as a base class for ArrayList will likely have a significant
performance hit. It seems questionable as to whether the benefits of using for
each loops outweigh the performance hit.
http://blogs.adobe.com/aharui/2007/10/actionscript_readwrite_perform_1.html
It might be a good idea to get some performance metrics on ArrayList with
and without Proxy.
Another approach might be to instead of modifying ArrayList itself to be a
subclass of Proxy, to create a new IList to complement it with these changes.
That way clients can decide whether they care about performance of for each
loops.
> For each loop is unable to iterate through ArrayList
> ----------------------------------------------------
>
> Key: FLEX-15159
> URL: https://issues.apache.org/jira/browse/FLEX-15159
> Project: Apache Flex
> Issue Type: Bug
> Components: Collections
> Affects Versions: Adobe Flex SDK 3.0 (Release)
> Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Language Found: English
> Reporter: Adobe JIRA
>
> 1. Make sure your imports are correct:
> import mx.controls.Alert;
> import mx.collections.IList;
> import mx.collections.ArrayList;
> 2. Create a function which looks like:
> private function foo() : void
> {
> var aList : IList = new ArrayList();
> aList.addItem("foo");
>
> for each (var s : String in aList)
> {
> Alert.show(s);
> }
> }
> 3. Call the function
>
> Actual Results: No message box is shown
>
>
> Expected Results: A message box with the text "foo"
>
> This becomes a problem when you don't know what implementation an IList
> variable will be bound to, ref: http://bugs.adobe.com/jira/browse/SDK-14837
> Workaround (if any): use the for loop instead
> for (var i : int = 0; i < aList.length; i++)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)