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

Remove terminally deprecated constructors in java.base

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, binary
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      These explicit constructors being removed were previously default constructors which appear to have been added only by accident. They are assumed to only be called in contrived programs.
    • Interface Kind:
      Java API
    • Scope:
      SE

      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.
            *

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Chris Hegarty, Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: