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

SpinnerValueFactory has an implicit no-arg constructor

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40, openjfx11, openjfx15
    • Fix Version/s: openjfx15
    • Component/s: javafx
    • Labels:

      Description

      The SpinnerValueFactory has an implicit no-arg constructor, which as a result shows up in the API docs without any documentation associated with it.

      If there are no explicitly defined constructors in a Java class, the javac compiler will generate a public, no-arg constructor for you. This is an anti-pattern for classes that are part of a library's public API. It can lead to unexpected results, such as a public constructor mistakenly being exposed, or if it was intended, it can disappear if you add another constructor without explicitly defining the public no-arg constructor at the same time.

      Additionally, the implicit constructor will have no API docs associated with it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aghaisas Ajit Ghaisas
                Reporter:
                kcr Kevin Rushforth
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: