You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2009/11/18 21:44:39 UTC

[jira] Resolved: (MYFACES-2407) _ComponentChildrenList does not implement all List methods

     [ https://issues.apache.org/jira/browse/MYFACES-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-2407.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-alpha
         Assignee: Leonardo Uribe

The problem is solved removing first, then add and update parent. Also, correct the behavior of remove(Object).

> _ComponentChildrenList does not implement all List methods
> ----------------------------------------------------------
>
>                 Key: MYFACES-2407
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2407
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.0-alpha
>
>
> The following methods:
> set(int index, UIComponent value)
> add(int index, UIComponent value)
> addAll(int index, Collection<? extends UIComponent> c)
> are not handled correctly. Suppose the case one component is already on the list and it is added again using add(int index, UIComponent value). If the component is after the index the effect is the component is not changed from place, because _ComponentChildrenList.updateParent(UIComponent) do two things: remove from children collection and set parent.
> We need to ensure the following from _ComponentChildrenList
> - Implement all methods from List (or make sure every method works as expected).
> - Implement Serializable interface. (done)
> - If a null value is added throw NullPointerException (done in checkValue(Object))
> - If it is added a value not implementing UIComponent throws ClassCastException (done in checkValue(Object))
> In theory, before add or set we should remove, but only after this one is added we should call setParent() to trigger PostAddToViewEvent and PreRemoveFromViewEvent.
> Also, it could be good to create several junit tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.