JDK-8249644 : remove no-arg constructor from ToolProvider
  • Type: CSR
  • Component: tools
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 16
  • Submitted: 2020-07-17
  • Updated: 2020-09-30
  • Resolved: 2020-07-17
Related Reports
CSR :  
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


Comments
Moving to Approved.
17-07-2020

Add [~jjg] as a reviewer per https://mail.openjdk.java.net/pipermail/compiler-dev/2020-July/014752.html
17-07-2020