-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b96
-
generic
-
generic
-
Verified
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The javadoc says
Notes:
Like the insertNodeInto method in the DefaultTreeModel class, insertElementAt appends to the Vector when the index matches the size of the vector. So you can use insertElementAt(Integer, 0) even when the vector is empty.
To create a node changed event for the root node, specify the parent and the child indices as null.
REGRESSION. Last worked in version 7
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I have coded the following method to use in my TreeModel when I make changes to the root. It is a DefaultMutableTreeNode, and I want to be able to use " setUserObject(String) " to change the title on the root.
private void rootChanged() {
model.fireTreeNodesChanged( tree, new Object[]{root}, null, new Object[]{ root} );
tree.repaint();
}
When I call this method, I see this exception:
Caused by: java.lang.IllegalArgumentException: Last path component must be non-null
at javax.swing.tree.TreePath.<init>(TreePath.java:105)
at javax.swing.event.TreeModelEvent.<init>(TreeModelEvent.java:131)
at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:484)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The documentation says this will work.
ACTUAL -
The exception will cause problems in the application's behavior
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.lang.IllegalArgumentException: Last path component must be non-null
at javax.swing.tree.TreePath.<init>(TreePath.java:105)
at javax.swing.event.TreeModelEvent.<init>(TreeModelEvent.java:131)
at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:484)
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
The javadoc says
Notes:
Like the insertNodeInto method in the DefaultTreeModel class, insertElementAt appends to the Vector when the index matches the size of the vector. So you can use insertElementAt(Integer, 0) even when the vector is empty.
To create a node changed event for the root node, specify the parent and the child indices as null.
REGRESSION. Last worked in version 7
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I have coded the following method to use in my TreeModel when I make changes to the root. It is a DefaultMutableTreeNode, and I want to be able to use " setUserObject(String) " to change the title on the root.
private void rootChanged() {
model.fireTreeNodesChanged( tree, new Object[]{root}, null, new Object[]{ root} );
tree.repaint();
}
When I call this method, I see this exception:
Caused by: java.lang.IllegalArgumentException: Last path component must be non-null
at javax.swing.tree.TreePath.<init>(TreePath.java:105)
at javax.swing.event.TreeModelEvent.<init>(TreeModelEvent.java:131)
at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:484)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The documentation says this will work.
ACTUAL -
The exception will cause problems in the application's behavior
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.lang.IllegalArgumentException: Last path component must be non-null
at javax.swing.tree.TreePath.<init>(TreePath.java:105)
at javax.swing.event.TreeModelEvent.<init>(TreeModelEvent.java:131)
at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:484)
REPRODUCIBILITY :
This bug can be reproduced always.
- relates to
-
JDK-8023536 Some regression tests have a wrong header
-
- Resolved
-