Seems as though there are more problems with that method than just the one you're pointing out (may be related, though).
I have a verbatim tag that actually blows up with a ClassCastException in the doEndTag when trying to cast to a UIOutput.
Since the component type is defined to be javax.faces.Output, you'd expect that this would always succeed.
Unfortunately, in the UIComponentTag, findComponent() does:
_componentInstance = parent.findComponent(id)
which (in my case) happens to return a panel grid.
Note, I'm not specifying any IDs in any of my tags. It appears that if you want to be safely using myfaces, you'll have to be specifying IDs everywhere.
-- Jon
On Apr 22, 2005, at 8:32 AM, Rob Decker wrote:
I'm looking over the UIComponentTag.findComponent(id) method where this "problem with
duplicate ids" exception is thrown. This code doesn't even check to see if the id is a
duplicate. It simply checks if more children were added to the parent than the size of
the list of children the parent has. The component in question isn't one of the
children because just prior to (and the reason for) executing the code that throws
this exception was that the id wasn't found as a child of the component.
The issue here is that sometime earlier the code lost track of the count of siblings
and this exception only masks that bug. The comments don't give a reason for adding
this index check but there is a comment about it:
* Revision 1.16 2004/04/20 10:54:21 royalts * added index check to findComponent
Does anyone have any info on this?
-- Rob
@objectsource.org

