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

Add "forRemoval = true" to Applet APIs

XMLWordPrintable

    • source
    • low
    • Hide
      This CSR applies only to the deprecation of these APIs.
      Java code using the Applet API's, compiled with XLint:removal and without @SuppressWarnings("removal") will fail to compile.
      Show
      This CSR applies only to the deprecation of these APIs. Java code using the Applet API's, compiled with XLint:removal and without @SuppressWarnings("removal") will fail to compile.
    • Java API
    • SE

      Summary

      Add "forRemoval = true" argument to the deprecation annotations in each of the Applet API classes. to the subclasses in java.beans.Beans (BeansAppletContext and BeansAppletStub) that use them, and to the instance of the method Beans.instantiate() that takes a java.beans.AppletInitializer argument.

      Problem

      As part of JDK-8149502, Applet APIs were deprecated in JDK9 with "forRemoval = false" (default). We now plan to remove them in a future release, so have filed JEP JDK-8256145 to first deprecate them for removal.

      Solution

      Change @Deprecated(since="9") to @Deprecated(since="9", forRemoval=true) in the annotations of the following classes:

      • java.applet.AppletStub
      • java.applet.Applet
      • java.applet.AudioClip
      • java.applet.AppletContext
      • javax.swing.JApplet
      • java.beans.AppletInitializer

      Public fields, sub-classes, and methods in the following classes which reference the above classes will have their deprecation annotation modified to include "forRemoval".

      • java.beans.Beans
      • javax.swing.RepaintManager
      • java.naming.Context

      Specification

      The existing annotation covering the entire class, '@Deprecated(since = "9")', will be changed '@Deprecated(since="9", forRemoval=true)' in the following classes:

      • java.applet.AppletStub
      • java.applet.Applet
      • java.applet.AudioClip
      • java.applet.AppletContext
      • javax.swing.JApplet
      • java.beans.AppletInitializer

      In the java.beans.Beans class, the method

      public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer)

      will have it's existing deprecation annotation changed to include "forRemoval=true".

      In the java.beans.Beans class, the two sub-classes

      class BeansAppletContext implements AppletContext

      class BeansAppletStub implements AppletStub

      will have their existing deprecation annotation changed to include "forRemoval=true".

      In the javax.swing.RepaintManager class, the method

      public void addDirtyRegion(Applet applet, int x, int y, int w, int h)

      will have it's existing deprecation annotation changed to include "forRemoval=true".

      In the javax.naming.Context interface, the field APPLET

      String APPLET = "java.naming.applet";

      will have it's existing deprecation annotation changed to include "forRemoval=true".

      Modify the javadoc comment for the java.applet package:

      The APIs in this package are all deprecated without replacement.

      to say:

      This package has been deprecated and may be removed in a future version of the Java Platform. There is no replacement. All of the classes and interfaces in this package have been terminally deprecated.

      Users are advised to migrate their applications to other technologies.

            herrick Andy Herrick (Inactive)
            almatvee Alexander Matveev
            Iris Clark, Kevin Rushforth, Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: