dev@javaserverfaces.java.net

Re: [jsf 2.0] inconsistent javadoc between UIViewRoot.getComponentResources and UIViewRoot.addComponentResource

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 04 May 2009 07:48:35 -0700

On 5/3/09 9:29 PM, Leonardo Uribe wrote:
Hello Leonardo,

Spec feedback is best sent to jsr-314-comments_at_jcp.org.

I'll forward this on.
> Hi
>
> Checking the latest javadoc (jsf-spec-2.0-20090327) for jsf 2.0, there
> is something wrong with the description of
> UIViewRoot.getComponentResources and UIViewRoot.addComponentResource.
>
> The description on UIViewRoot.getComponentResources(FacesContext
> context, String target) says this:
>
> ".........Return an unmodifiable List of UIComponents for the provided
> target agrument........"
>
> but the description of UIViewRoot.addComponentResource(FacesContext
> context, UIComponent componentResource, String target) says this:
>
> "..... ...................
> # Call getComponentResources(javax.faces.context.FacesContext,
> java.lang.String) to obtain the child list for the given target.
> # If the component ID of componentResource matches the the ID of a
> resource that has allready been added, remove the old resource.
> # Add the component resource to the list.
> .............."
>
> The inconsistency is that if getComponentResources return an
> unmodifiable List, you can't remove and add components to that list,
> but the remaining javadoc comments suggests this. Obviously, the code
> don't do what javadoc says.
>
> It is possible that someone correct the javadoc and publish the
> correct behavior?.
>
> regards
>
> Leonardo Uribe
>
>