-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b10
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
In the API under javax.swing.tree.TreePath there is a code example whose last assignment gives an error at compile time: "incompatible types" as getUserObject() returns an Object.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
DefaultMutableTreeNode selectedNode =
(DefaultMutableTreeNode)selectedPath.getLastPathComponent();
Object myObject= selectedNode.getUserObject();
ACTUAL -
DefaultMutableTreeNode selectedNode =
((DefaultMutableTreeNode)selectedPath.getLastPathComponent()).
getUserObject();
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/
In the API under javax.swing.tree.TreePath there is a code example whose last assignment gives an error at compile time: "incompatible types" as getUserObject() returns an Object.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
DefaultMutableTreeNode selectedNode =
(DefaultMutableTreeNode)selectedPath.getLastPathComponent();
Object myObject= selectedNode.getUserObject();
ACTUAL -
DefaultMutableTreeNode selectedNode =
((DefaultMutableTreeNode)selectedPath.getLastPathComponent()).
getUserObject();
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/