JDK-8189232 : Add "forRemoval = true" to Applet APIs
  • Type: CSR
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17
  • Submitted: 2017-10-12
  • Updated: 2021-03-26
  • Resolved: 2021-03-26
Related Reports
CSR :  
Description
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.

Comments
Moving to Approved.
26-03-2021

Updated version looks good to me.
25-03-2021

OK - changed spec as described above.
25-03-2021

Looks like you can't use an `@deprecated` tag in the API docs for a package or the docs build fails. So you will need to make the following change (I also added this comment to the PR under review). ``` - * @deprecated. This package has been deprecated and may be removed in + * This package has been deprecated and may be removed in ``` Also, I see the following sentence from the latest PR that you should add in the Specification section above: ``` Users are advised to migrate their applications to other technologies. ```
25-03-2021

Are you asking that we provide a patch with just the @Deprecated annotation changes and none of the @SuppressWarning annotation changes they require ?
25-03-2021

Looks to me like some implementation changes slipped into the attached patch.
25-03-2021

git diff attached: 8189232.diff
17-03-2021

all changes PR: https://github.com/openjdk/jdk/pull/2920
17-03-2021

Moving back to Provisional. For when the request is Finalized, a patch showing the API changes may be helpful.
15-03-2021

Moving to Provisional.
16-11-2020

This will require addition or modification of SuppressWarnings annotations in several additional files, specification will be updated with full webrev
12-11-2020