JDK-8235548 : Remove terminally deprecated constructors in java.base
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2019-12-08
  • Updated: 2019-12-10
  • Resolved: 2019-12-10
Related Reports
CSR :  
Description
Summary
-------

Remove terminally deprecated constructors in `java.lang.reflect.Modifier` and `java.lang.invoke.ConstantBootstraps`.

Problem
-------

The constructors that were previously marked as deprecated are in need of removal.

Solution
--------

Remove the constructors in question. Note as raised in the core-libs review thread, at least one non-public constructor needs to be added to preserve the effect of removing these public constructors. The implementation will use no-arg private constructors.

Specification
-------------

    --- a/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java	Sat Dec 07 09:40:28 2019 +0800
    +++ b/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java	Sun Dec 08 10:49:48 2019 -0800
    @@ -40,12 +40,6 @@
      * @since 11
      */
     public final class ConstantBootstraps {
    -    /**
    -     * Do not call.
    -     */
    -    @Deprecated(forRemoval=true, since="14")
    -    public ConstantBootstraps() {}
    -
         // implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant:
         /*non-public*/
         static Object makeConstant(MethodHandle bootstrapMethod,
    diff -r 31882abe1494 src/java.base/share/classes/java/lang/reflect/Modifier.java
    --- a/src/java.base/share/classes/java/lang/reflect/Modifier.java	Sat Dec 07 09:40:28 2019 +0800
    +++ b/src/java.base/share/classes/java/lang/reflect/Modifier.java	Sun Dec 08 10:49:48 2019 -0800
    @@ -44,13 +44,6 @@
      */
     public class Modifier {
         /**
    -     * Do not call.
    -     */
    -    @Deprecated(forRemoval=true, since="14")
    -    public Modifier() {}
    -
    -
    -    /**
          * Return {@code true} if the integer argument includes the
          * {@code public} modifier, {@code false} otherwise.
          *


Comments
Moving to Approved.
10-12-2019