You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/04/20 02:49:15 UTC
[jira] [Commented] (FLEX-28766) ObjectUtil.clone() causes
StackOverflow for cyclic objects graphs
[ https://issues.apache.org/jira/browse/FLEX-28766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13637056#comment-13637056 ]
Justin Mclean commented on FLEX-28766:
--------------------------------------
Confirmed still an issue in Apache Flex 4.9.1
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
protected function testObjectCopy():void
{
var child:Object = {uid:"child1", test:123};
var parent:Object = {uid:"parent1", test:456};
parent.child = child;
child.parent = parent;
var clone:Object = ObjectUtil.clone(parent);
}
]]>
</fx:Script>
<s:Button label="Test It!" click="testObjectCopy()" />
</s:Application>
> ObjectUtil.clone() causes StackOverflow for cyclic objects graphs
> -----------------------------------------------------------------
>
> Key: FLEX-28766
> URL: https://issues.apache.org/jira/browse/FLEX-28766
> Project: Apache Flex
> Issue Type: Bug
> Components: .Unspecified - Framework
> Affects Versions: Adobe Flex SDK 4.1 (Release)
> Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
> Reporter: Adobe JIRA
>
> ObjectUtil.clone() causes StackOverflow for cyclic objects graphs.
> The ObjectUtil.cloneInternal() doesn't have stop condition when entering the same object for the second time which leads to infinite recursion.
> See the code sample attached.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira