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

Address reliance on default constructors in the JDK (umbrella)

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Other
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None

      Description

      A no-arg public constructor is generated by the compiler for a class if it does not declare an explicit constructor. While convenient, this is inappropriate for many kinds of formal classes, both because the constructor will have no javadoc and because the constructor may be unintended.

      For the JDK, classes intended to be used outside of the JDK, public classes in exported packages, should not rely on default constructors.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: