You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ryan Holmes (JIRA)" <ta...@jakarta.apache.org> on 2006/08/14 23:48:14 UTC
[jira] Commented: (TAPESTRY-1065) TreeDataView.renderComponent()
and TreeTableDataView.generateNodeList() cause ClassCastException in
ITreeDataModel.getUniqueKey()
[ http://issues.apache.org/jira/browse/TAPESTRY-1065?page=comments#action_12427972 ]
Ryan Holmes commented on TAPESTRY-1065:
---------------------------------------
This bug only appears when showRootNode is set to false.
> TreeDataView.renderComponent() and TreeTableDataView.generateNodeList() cause ClassCastException in ITreeDataModel.getUniqueKey()
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-1065
> URL: http://issues.apache.org/jira/browse/TAPESTRY-1065
> Project: Tapestry
> Issue Type: Bug
> Components: Contrib
> Affects Versions: 4.0.2
> Environment: Tapestry 4.0.2
> Java 1.5
> Windows XP
> Reporter: Ryan Holmes
>
> TreeDataView.renderComponent() calls ITreeDataModel.getUniqueKey() with a root node object when it should be passing in a rootUID object (line 86 in TreeDataView.java):
> Object objChildUID = objTreeModel.getTreeDataModel()
> .getUniqueKey(objChild, objRoot);
> Instead of objRoot, objRootUID should be used, which has already been fetched on line 62:
> Object objRoot = objTreeDataModel.getRoot();
> Object objRootUID = objTreeDataModel.getUniqueKey(objRoot, null);
> This causes a ClassCastException on line 80 of SimpleTreeDataModel.getUniqueKey():
> TreePath objPath = (TreePath)objParentUniqueKey;
> SimpleTreeDataModel implements ITreeDataModel correctly (which specifies that a parent UID is to be passed into getUniqueKey() rather than a parent node), and other callers to ITreeDataModel.getUniqueKey() pass in a parent UID, so I believe this is a straightforward bug in TreeDataView and TreeTableDataView.
> The same bug exists in TreeTableDataView.generateNodeList() on line 117:
> Object objChildUID = objTreeModel.getTreeDataModel().getUniqueKey(
> objChild,
> objRoot);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org