[jsr-314-open-mirror] [jsr-314-open] UIViewRoot.getComponentResources() documentation does not match with the implementation

Leonardo Uribe lu4242 at gmail.com
Mon May 3 18:17:53 EDT 2010


Hi

Doing some tests I notice the implementation in mojarra of
UIViewRoot.getComponentResources() does not match with the spec javadoc.
This javadoc says this:

*"...Return an unmodifiable List of UIComponents for the provided target
agrument. Each component in the List is assumed to represent a resource
instance.

The default implementation must use an algorithm equivalent to the the
following.

    * Locate the facet for the component by calling getFacet() using target
as the argument.
    * If the facet is not found, create the facet by calling
context.getApplication().createComponent() using javax.faces.Panel as the
argument
          o Set the id of the facet to be target
          o Add the facet to the facets Map using target as the key
    * return the children of the facet...."*

The javadoc says cleary that the returning facet is created using
javax.faces.Panel as argument. But mojarra uses
"javax.faces.ComponentResourceContainer" as argument. The effect can be seen
when you try to use myfaces on glassfish v3 and you set the classloader
delegate to true (I know that configuration is wrong, but the exception
caught my attention).

Looking on google I saw this issue:

https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1427

I also saw that the line:

"*Set the id of the facet to be target"

*is to respected too. Tomahawk has an example
(myfaces-example-simple20/calendar.jsf) that has this code

        <h:panelGroup id="body">

It works with mojarra (2.0.3-SNAPSHOT) but do not with myfaces. The reason
is myfaces is doing what spec says, but mojarra set the id to
"javax_faces_location_body". That's not fair. On JSF 2.0 Rev A Change Log
there is no issue related to this one.

I have to say it, my personal opinion is that spec changes should not be
done without document them on javadoc or add them to JSF 2.0 Rev A Change
Log. Do things like that, only makes things more difficult to track, even
worst, important details that needs to be on the spec just will be missing.

Could anyone include this detail on:

http://wiki.jcp.org/wiki/index.php?page=JSF+2.0+Rev+A+Change+Log

and correct the spec javadoc?

regards,

Leonardo Uribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100503/af2b4873/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list