JDK-4832328 : TreeModel.getIndexOfChild() documentation, solution for bug 4412870 not enough
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_98
  • CPU: x86
  • Submitted: 2003-03-13
  • Updated: 2017-05-16
  • Resolved: 2003-09-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Description

Name: jk109818			Date: 03/13/2003


FULL PRODUCT VERSION :
JDK 1.4.1

A DESCRIPTION OF THE PROBLEM :
Even after closing of bug 4412870, the description of TreeModell.getIndexOfChild is not specific enough for the case that either parent or child do not belong to the tree anymore or did never belong to it.

The remark in the doc only specifies to return -1 if either parent or child is null. It does not specify the case that parent and child are non-null but still not part of the tree.

The actual behaviour of DefaultTreeModel and the only way I got my implementation of TreeModel to work together with JTree was to also return -1 in case parent or child are non-null but not belonging to the tree.

So I expect that the TreeModel is indeed meant to react like this. But then it should be documented like this.


REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 182378) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b22
14-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION Name: dk30142 Date: 03/13/2003 ====================================================================== Reviewed by sky. Approved by CCC. Fixed for tiger. ###@###.### 2003-09-15
15-09-2003