JDK 15 RFR of JDK-8230771: Remove terminally deprecated constructors in java.base

Mandy Chung mandy.chung at oracle.com
Mon Dec 9 17:29:06 UTC 2019


Good catch!  Daniel also pointed that out.  I overlooked it.  It needs 
to add back a private no-arg constructor.

Mandy

On 12/9/19 9:18 AM, Victor Williams Stafusa da Silva wrote:
> If you remove the deprecated constructor, the compiler will add a 
> default one. Wouldn't it be a better idea to make the deprecated 
> constructor private and throwing an exception?
>
> Em seg., 9 de dez. de 2019 às 14:13, Mandy Chung 
> <mandy.chung at oracle.com <mailto:mandy.chung at oracle.com>> escreveu:
>
>     Looks good.
>
>     Mandy
>
>     On 12/8/19 10:58 AM, Joe Darcy wrote:
>     > Hello,
>     >
>     > Please review this small API changes for JDK 15:
>     >
>     >     JDK-8230771: Remove terminally deprecated constructors in
>     java.base
>     >     CSR: https://bugs.openjdk.java.net/browse/JDK-8235548
>     >     webrev: http://cr.openjdk.java.net/~darcy/8230771.0/
>     >
>     > Patch below.
>     >
>     > Thanks,
>     >
>     > -Joe
>     >
>     > ---
>     >
>     old/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java
>
>     > 2019-12-08 10:56:14.223168685 -0800
>     > +++
>     >
>     new/src/java.base/share/classes/java/lang/invoke/ConstantBootstraps.java
>
>     > 2019-12-08 10:56:13.999168685 -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,
>     > --- old/src/java.base/share/classes/java/lang/reflect/Modifier.java
>     > 2019-12-08 10:56:14.775168685 -0800
>     > +++ new/src/java.base/share/classes/java/lang/reflect/Modifier.java
>     > 2019-12-08 10:56:14.555168685 -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.
>     >       *
>     >
>



More information about the core-libs-dev mailing list