JDK-8013820 : JavaDoc for JSpinner contains errors
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-03-20
  • Updated: 2015-09-29
  • Resolved: 2015-05-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b68Fixed
Description
A DESCRIPTION OF THE PROBLEM :
There are three typos in the example given at the top.
1. Remove the second left brace in the  " catch ... "  line.
2. Terminate  " JComponent editor = spinner.getEditor() "  with a semicolon.
3. A closing parenthesis is missing before the semicolon in
 " ((DefaultEditor)editor).getTextField().setValue(spinner.getValue(); " 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
try {
       spinner.commitEdit();
   }
   catch (ParseException pe) {
       // Edited value is invalid, spinner.getValue() will return
       // the last valid value, you could revert the spinner to show that:
       JComponent editor = spinner.getEditor();
       if (editor instanceof DefaultEditor) {
           ((DefaultEditor)editor).getTextField().setValue(spinner.getValue());
       }
       // reset the value to some known value:
       spinner.setValue(fallbackValue);
       // or treat the last valid value as the current, in which
       // case you don't need to do anything.
   }
   return spinner.getValue();
ACTUAL -
See above.

URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/
Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014