VerifyError:错误#1023:addItem to ArrayCollection发生堆栈溢出

时间:2013-10-07 22:29:47

标签: actionscript-3 flex stack-overflow

当选择ColorDataGrid中的某个“开发人员行”框时,会发生此错误,该框又调用ExtractProjectPopup.mxml中的updateDeveloper()方法,如下所示。

public function updateDeveloper():void
{
    developerIndexArray:ArrayCollection = new ArrayCollection();
    var devObject:Object = new Object();
    var ObjectString:String = developerIndexArray.toString();
    if(developerGrid.selectedIndex >= 0)
    {
        var developer:ExtractPopUpDeveloperRow = this.developerRows.getItemAt(developerGrid.selectedIndex) as ExtractPopUpDeveloperRow;
        developer.isPartOfProject = ! developer.isPartOfProject;
        if(developer.isPartOfProject)
        {   
        devObject.index = developerGrid.selectedIndex;
        viewResumeButton.visible = true;
        developerIndexArray.addItem(devObject);     
        }
    }
}

我目前正在使用Flex SDK 3.6,并且我知道已知的bug,其解决方法(添加跟踪语句)在这种情况下并没有真正帮助。我怀疑当我添加对象添加到ArrayCollection时发生溢出但我真的不知道为什么。

必须有某种递归会导致溢出,我错过了什么?

这是导致溢出的堆栈跟踪:

[mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I]  mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]]   {mpt.project::ExtractProjectPopUp~[O]} (mx.collections::ArrayCollection[O] int[I])
60:callproperty getItemAt 1
                   [mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I]  mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]]  {mpt.project::ExtractProjectPopUp~[O]} (Object[A])
64:getlex 7044
                   [mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I] mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]] {mpt.project::ExtractProjectPopUp~[O]} (Object[A] mpt.vo.extraction::ExtractPopUpDeveloperRow$[O])
67:astypelate
                   [mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I] mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]] {mpt.project::ExtractProjectPopUp~[O]} (mpt.vo.extraction::ExtractPopUpDeveloperRow[O])
68:coerce mpt.vo.extraction::ExtractPopUpDeveloperRow
                   [mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I] mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]] {mpt.project::ExtractProjectPopUp~[O]} (mpt.vo.extraction::ExtractPopUpDeveloperRow[O])
71:dup
                   [mpt.project::ExtractProjectPopUp~[O] Object~[A] int[I] int[I] mpt.vo.extraction::ExtractPopUpDeveloperRow[O] String[S] int[I]] {mpt.project::ExtractProjectPopUp~[O]} (mpt.vo.extraction::ExtractPopUpDeveloperRow[O] mpt.vo.extraction::ExtractPopUpDeveloperRow[O])
72:dup

Warning: Failed to parse corrupt data.
VerifyError: Error #1023: Stack overflow occurred.

at mpt.project::ExtractProjectPopUp/__developerGrid_click()

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

奇怪的是,通过在语句

之后添加一个空的trace语句来解决问题
var developer:ExtractPopUpDeveloperRow = this.developerRows.getItemAt(developerGrid.selectedIndex) as ExtractPopUpDeveloperRow;

这不是解决方案,只是一种解决方法。