Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2407

_ComponentChildrenList does not implement all List methods

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-alpha
    • JSR-314
    • None

    Description

      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.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: