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

example in JFormattedTextField API docs instantiates abstract class

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b52
    • CPU:
      x86
    • OS:
      linux

      Backports

        Description

        A DESCRIPTION OF THE PROBLEM :
        The API docs use the following code as example:
        ----------
        JFormattedTextField tf = new JFormattedTextField();
        tf.setValue(new Number(100));
        ----------
        This is a bad example because it creates an instance of Number which is an abstract class. This code will never compile.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        I expected working example code, e.g.
        ----------
        JFormattedTextField tf = new JFormattedTextField();
        tf.setValue(new Integer(100));
        ----------

        ACTUAL -
        JFormattedTextField tf = new JFormattedTextField();
        tf.setValue(new Number(100));


        URL OF FAULTY DOCUMENTATION :
        http://java.sun.com/javase/6/docs/api/javax/swing/JFormattedTextField.html

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                serb Sergey Bylokhov
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: