History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-14898
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: None None
Assignee: Kristen Sindac
Reporter: Yhen Cheng
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Flex SDK

compile error caused by mx.core.container addChildAt() called by addChild() when child to be added is already a child --> index out of bound

Created: 03/07/08 09:10 AM   Updated: 09/08/08 01:37 PM
Component/s: Coding Practices
Security Level: Public (All JIRA Users )

File Attachments: 1. File main.mxml (0.7 kb)


Severity: Non Functioning
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Milestone: SDK Flex 3.2.0
Affected OS(s): Windows - All Windows
Steps to Reproduce:
Steps to reproduce:
1. create any app that does the following: mx.core.container addChildAt() called by addChild() when child to be added is already a child
2.
3.
 
 Actual Results: compile error - index out of bound
 
 
 Expected Results: no error
 
 
 Workaround (if any): Change the code so that if child to be added is already a child do nothing.
 
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: Yes
QA Owner: Kristen Sindac
Resolved by: Corey Lucier
Confirmed Version: SDK Gumbo Iteration 7 - Next Build
Participants: Corey Lucier, Deepa Subramaniam, Jason Szeto, Kristen Sindac, Matt Chotin, Steve Breinberg and Yhen Cheng
Browser: Firefox 2.x
JDK: Sun 1.6.x

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 All   Comments      Sort Order:
Matt Chotin - [07/18/08 01:17 PM ]
Consider for 3.2. 3.1 is locked.

Kristen Sindac - [07/24/08 04:38 PM ]
attaching a bugfile to show the runtime error thrown.
To reproduce:
- click on the 'Add child' button


Kristen Sindac - [07/24/08 04:41 PM ]
resetting this to be an mxml component issue (container issue, more specifically) rather than Compiler API issue.

Kristen Sindac - [07/24/08 04:51 PM ]
In flex 2.0.1, when you add the same child into the container, the index out of bounds RTE is not thrown. That's why I set this as a regression. However, the behavior in 2.0.1 looks incorrect too. In 2.0.1, a different component gets added instead of just not doing anything.

Deepa Subramaniam - [08/13/08 04:20 PM ]
To Jason, for 3.2.

Jason Szeto - [08/26/08 03:20 PM ]
This is a bug in UIComponent.addChild. It assumes that the child is not already a child.

    override public function addChild(child:DisplayObject):DisplayObject
    {
        return addChildAt(child, numChildren);
    }


Deepa Subramaniam - [09/03/08 04:35 PM ]
To Corey, hopefully a nice respite from performance :)

Corey Lucier - [09/04/08 03:27 PM ]
Fixed in 3.0.x revision 3104.

Kristen Sindac - [09/08/08 01:37 PM ]
confirmed in latest 3.0.x and trunk branch