myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josu? Burgos (JIRA)" <>
Subject [jira] Created: (TOMAHAWK-206) Process an event of a node changed after removing the node cause an Exception
Date Tue, 21 Mar 2006 09:59:06 GMT
Process an event of a node changed after removing the node cause an Exception

         Key: TOMAHAWK-206
     Project: MyFaces Tomahawk
        Type: Bug
  Components: Tree Table  
    Versions: 1.1.1    
    Reporter: Josué Burgos
    Priority: Minor

I think this is a bug but I'm not sure. When processing a node changed event after removing
the node in the tree model cause this exception:
java.lang.ArrayIndexOutOfBoundsException: -1
        at java.util.ArrayList.get(
        at javax.faces.component._ComponentChildrenList.get(
        at org.apache.myfaces.custom.tree.HtmlTree.findNode(
        at org.apache.myfaces.custom.tree.HtmlTree.treeNodesChanged(
        at org.apache.myfaces.custom.tree.HtmlTree$Event.process(
        at org.apache.myfaces.custom.tree.HtmlTree.processModelEvents(
        at org.apache.myfaces.custom.tree.HtmlTree.encodeBegin(
        at org.apache.myfaces.renderkit.RendererUtils.renderChild(

It doesn't find the node because it is removed before processing the event. Perhaps I have
to force processign the events before removing the node but I don't think so.

A fix to the problem could be:

  549          int index = translatedPath[i];
  550          if (index == -1) return null;
  551          node = (HtmlTreeNode) node.getChildren().get(index);

instead of:
  549          int index = translatedPath[i];
  550          node = (HtmlTreeNode) node.getChildren().get(index);

or capture the IndexOutOfBoundException and return null.


This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message