[ 
http://issues.apache.org/jira/browse/MYFACES-1364?page=comments#action_12420817 
] 

Alex Mateescu commented on MYFACES-1364:
----------------------------------------

More specific, in 
javax.faces.component.UIComponentBase#processRestoreState(FacesContext, 
Object), when iterating over the list returned by getChildren(), there are 
twice the amount of children in that list. But the list of saved states only 
has the normal amount. Therefore, the line:
                  Object childState = childrenList.get(idx++);
will produce the said exception when trying to read past the number of saved 
children states.

> ArrayIndexOutOfBounds exception when restoring state on a custom component
> --------------------------------------------------------------------------
>
>          Key: MYFACES-1364
>          URL: http://issues.apache.org/jira/browse/MYFACES-1364
>      Project: MyFaces Core
>         Type: Bug

>   Components: General
>     Versions: 1.1.3
>  Environment: ANY
>     Reporter: Alex Mateescu

>
> If I have a custom component (e.g. extends HtmlPanelGrid) and I attach to 
> this another component (e.g. a HtmlCommandLink) in the constructor, I get an 
> ArrayIndexOutOfBounds exception in the restore state phase.
> What happens is that in the save state phase it will save one child, but in 
> the restore state phase it will try to restore two: a new child (that gets 
> added when the component is recreated) AND the old child.
> Therefore, I cannot define a (usable) custom composite component (I can, 
> actually, but with some nasty workarounds).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to