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

Error in Javadoc for doAccessibleAction API in AccessibleJSlider class

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 17
    • client-libs
    • None
    • low
    • No significant risk
    • Java API
    • SE

      Summary

      Change the doAccessibleAction API javadoc in AccessibleJSlider class to denote that it can return true or false depending upon whether the Action was performed by the API or not.

      Problem

      The AccessibleJSlider class was changed under JDK-8264592 and few new APIs were added to it to make the class more consistent with the AccessibleJSpinner class. The doAccessibleAction is one of these APIs. The doAccessibleAction API javadoc says that the API always returns true. But the API can actually return both true or false depending upon whether the Action was performed by the API or not. The javadoc is being corrected to specify this.

      Solution

      Update the doAccessibleAction API javadoc to specify that API can return both true or false depending upon whether the Action was performed or not. This makes the API javadoc in consistent with the same API javadoc inside the AccessibleJSpinner class.

      Specification

      Following is the only change being done.

      src/java.desktop/share/classes/javax/swing/JSlider.java

                * @param i zero-based index of actions. The first action
                * (index 0) is AccessibleAction.INCREMENT and the second
                * action (index 1) is AccessibleAction.DECREMENT.
      -         * @return true.
      +         * @return true if the action was performed, otherwise false
                * @see #getAccessibleActionCount
                */
               public boolean doAccessibleAction(int i) {

            pbansal Pankaj Bansal (Inactive)
            pbansal Pankaj Bansal (Inactive)
            Jayathirth D V
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: