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.