JDK-8256145 : JEP 398: Deprecate the Applet API for Removal
  • Type: JEP
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Fix Versions: 17
  • Submitted: 2020-11-10
  • Updated: 2021-08-09
  • Resolved: 2021-04-20
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8265676 :  
Description
Summary
-------

Deprecate the Applet API for removal.  It is essentially irrelevant since all web-browser vendors have either removed support for Java browser plug-ins or announced plans to do so.

History
-------

The Applet API was previously deprecated, though not for removal, by [JEP 289](https://openjdk.java.net/jeps/289) in Java 9.

Description
-----------

Deprecate, for removal, these classes and interfaces of the standard Java API:

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

Deprecate, for removal, any API elements that reference the above classes and interfaces, including methods and fields in:

 - `java.beans.Beans`
 - `javax.swing.RepaintManager`
 - `javax.naming.Context`

Testing
-------

Hundreds of tests need to be either modified or removed before the Applet API is removed, but this JEP is solely about deprecation-for-removal.  We will review these tests to determine if further `@SuppressWarnings` annotations are required.

Risks and Assumptions
---------------------

In case remaining uses of these APIs do exist, developers can suppress compiler warnings via the  `@SuppressWarnings("removal")` annotation or the `-Xlint:-removal` command-line option of the `javac` compiler.

Comments
This looks fine to me.
04-03-2021

I���ve tightened this up and added a little more information about how to suppress the new warnings. Let me know if this looks okay to you and I���ll move it to Candidate.
03-03-2021

Right. The JEP and eventual CSR should focus on public classes being deprecated for removal along with any impact on applications (not much impact, since this is just a deprecation JEP). The internal classes that are impacted are just part of the implementation of the JEP.
10-11-2020

I don't see the need to mention internal classes in this JEP.
10-11-2020

Yes - in EmbeddedFrame.java and Beans.java only selected methods (and in the Beans case two inner-classes) will be deprecated for removal.
10-11-2020

Ok so that method may be removed, but not the class.
10-11-2020

EmbeddedFrame contains the public methods: public static Applet getAppletIfAncestorOf(Component comp) This method was deprecated when Applet was deprecated and I assumed it would be deprecated for removal when Applet is.
10-11-2020

The following additional filesthat had @SuppressWarnings("deprecation") annotations need to be modified to SuppressWarning("removal"): src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java src/java.desktop/share/classes/java/awt/Component.java src/java.desktop/share/classes/javax/swing/JComponent.java src/java.desktop/share/classes/javax/swing/JTable.java src/java.desktop/share/classes/javax/swing/KeyboardManager.java src/java.desktop/share/classes/javax/swing/PopupFactory.java src/java.desktop/share/classes/javax/swing/RepaintManager.java src/java.desktop/share/classes/javax/swing/SwingUtilities.java src/java.desktop/share/classes/javax/swing/ToolTipManager.java src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
10-11-2020