Details

      Description

      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/

        Attachments

          Activity

            People

            • Assignee:
              vdyakov Victor Dyakov
              Reporter:
              mduigou Michael Duigou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: