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)
======================================================================