Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281692

javadoc for getPathBounds() in TreeUI and BasicTreeUI is incorrect

    XMLWordPrintable

Details

    • CSR
    • Status: Closed
    • P4
    • Resolution: Approved
    • 19
    • client-libs
    • None
    • behavioral
    • minimal
    • No code change - doc only
    • Java API
    • SE

    Description

      Summary

      The javadoc description for javax.swing.plaf.TreeUI.getPathBounds() and javax.swing.plaf.basic.BasicTreeUI.getPathBounds() is misleading as it cites invalid conditions as valid

      Problem

      The javadoc descriptions for javax.swing.plaf.TreeUI.getPathBounds() and javax.swing.plaf.basic.BasicTreeUI.getPathBounds() stated the methods return null if any component in path is currently "valid".

      Solution

      The getPathBounds() in BasicTreeUI returns null if tree or treeState is null, so it should read "if any component in path is currently invalid"

      Specification

      src/java.desktop/share/classes/javax/swing/plaf/TreeUI.java

         /**
            * Returns the Rectangle enclosing the label portion that the
            * last item in path will be drawn into.  Will return null if
      -     * any component in path is currently valid.
      +     * any component in path is currently invalid.
      
      public abstract Rectangle getPathBounds(JTree tree, TreePath path);

      src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java

          /**
             * Returns the Rectangle enclosing the label portion that the
             * last item in path will be drawn into.  Will return null if
      -      * any component in path is currently valid.
      +      * any component in path is currently invalid.
             */
           public Rectangle getPathBounds(JTree tree, TreePath path) {

      Attachments

        Issue Links

          Activity

            People

              psadhukhan Prasanta Sadhukhan
              ssides Steve Sides
              Alexey Ivanov, Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: