flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gareth Daniel Smith (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-15159) For each loop is unable to iterate through ArrayList
Date Sat, 09 May 2015 17:38:59 GMT

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

Gareth Daniel Smith commented on FLEX-15159:
--------------------------------------------

Hi Alex,

I have created a patch for mx.collections.ArrayList, with some tests.

I now find myself confused by the existence of another ArrayList class, at org.apache.flex.collections!
Why are there two ArrayList classes? Which one should my changes go into?

Thanks

> 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)

Mime
View raw message