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

remove no-arg constructor from ToolProvider

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
      None
    • Compatibility Kind:
      source, binary, behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Little expected usage of this constructor.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      An explicit constructor in ToolProvider, deprecated for removal, replaced a default constructor. The time has come to "remove" the constructor by making it private and thus on longer part of the external API of the class.

      Problem

      A deprecated-for-removal constructor is not yet removed from the API.

      Solution

      Remove the no-arg constructor by making it private.

      Specification

       --- old/src/java.compiler/share/classes/javax/tools/ToolProvider.java  2020-07-17 10:26:50.446004000 -0700
      +++ new/src/java.compiler/share/classes/javax/tools/ToolProvider.java   2020-07-17 10:26:49.794004000 -0700
      @@ -44,11 +44,7 @@
           private static final String systemJavaCompilerModule = "jdk.compiler";
           private static final String systemJavaCompilerName   = "com.sun.tools.javac.api.JavacTool";
      
      -    /**
      -     * Do not call.
      -     */
      -    @Deprecated(forRemoval=true, since="14")
      -    public ToolProvider() {}
      +    private ToolProvider() {}
      
           /**
            * Returns the Java programming language compiler provided

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              smarks Stuart Marks
              Reviewed By:
              Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: