RFR: 8359053: Implement JEP 504 - Remove the Applet API

Alexey Ivanov aivanov at openjdk.org
Mon Jun 9 20:29:36 UTC 2025


On Mon, 9 Jun 2025 18:11:13 GMT, Phil Race <prr at openjdk.org> wrote:

> This is the implementation of JEP 504 - Remove the Applet API.
> API changes are
> - Remove the entire java.applet package
> - Remove the javax/swing/JApplet class
> - Remove applet related APIs in java.beans
> - Update javadoc referring to applets, including one gif image - now changed to an svg image
> - 
> Other changes are
> - Remove references to the removed classes
> - Remove obsolete tests
> - Update obsolete code comments
> 
> sun.awt.AppContext is even more obsolete now than it was before, but eliminating uses of that will be is not required,
> and will be follow-on internal clean up, at a later date, under unrelated bug ids, and likely not completed in the same
> release as this JEP is integrated.
> 
> I have extensively tested this - running all the automated tests used by CI tiers 1 to 8.

Changes requested by aivanov (Reviewer).

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java line 437:

> 435:             styleBits = SET(styleBits, TEXTURED, false);
> 436:             styleBits = SET(styleBits, NONACTIVATING, true);
> 437:             styleBits = SET(styleBits, IS_POPUP, true);

Is the code below the comment still required? It looks it was relevant to applets only.

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java line 716:

> 714:                 execute(ptr -> {
> 715:                     if (isPopup) {
> 716:                         CWrapper.NSWindow.orderFrontRegardless(ptr);

Is this still relevant without applets?

src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java line 108:

> 106:      * Checks if vsync painting is requested for {@code rootContainer}
> 107:      *
> 108:      * @param rootContainer topmost container. Should be Window

Suggestion:

     * @param rootContainer topmost container. Should be {@code Window}

src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 116:

> 114:     }
> 115: 
> 116:     public static JavaSoundAudioClip create(final URL url) {

Does this method need to be removed?

src/java.desktop/share/classes/java/awt/Component.java line 3938:

> 3936:     /**
> 3937:      * Inner class for flipping buffers on a component.  That component must
> 3938:      * be a {@code Canvas} or {@code Window}

Suggestion:

     * be a {@code Canvas} or {@code Window}.

It ended with a full stop, and the full stop should be preserved.

src/java.desktop/share/classes/java/awt/Component.java line 3988:

> 3986:         /**
> 3987:          * Creates a new flipping buffer strategy for this component.
> 3988:          * The component must be a {@code Canvas} or {@code Window}

Suggestion:

         * The component must be a {@code Canvas} or {@code Window}.

src/java.desktop/share/classes/java/awt/Container.java line 1561:

> 1559:      * <p>
> 1560:      * The {@code Window} class is the validate root in AWT.
> 1561:      *  Swing introduces more validate roots.

Suggestion:

     * Swing introduces more validate roots.

src/java.desktop/share/classes/java/awt/Dialog.java line 174:

> 172:          * from the same toolkit except those from its own child hierarchy.
> 173:          */
> 174:         TOOLKIT_MODAL

Should we add a note that `APPLICATION_MODAL` and `TOOLKIT_MODAL` mean the same thing in the absence of applets or even remove one of them?

src/java.desktop/share/classes/java/awt/Toolkit.java line 1353:

> 1351: 
> 1352:     /**
> 1353:      * {@return the EventQueue for this application}

Suggestion:

     * {@return the {@code EventQueue} for this application}

src/java.desktop/share/classes/java/awt/Toolkit.java line 1360:

> 1358: 
> 1359:     /**
> 1360:      * A method used by toolkit subclasses to get the EventQueue.

Suggestion:

     * A method used by toolkit subclasses to get the {@code EventQueue}.

src/java.desktop/share/classes/java/awt/Toolkit.java line 1362:

> 1360:      * A method used by toolkit subclasses to get the EventQueue.
> 1361:      * This may be more direct or more efficient than calling
> 1362:      * {@code getSystemEventQueue()}

Suggestion:

     * {@code getSystemEventQueue()}.

src/java.desktop/share/classes/javax/swing/JComponent.java line 4684:

> 4682: 
> 4683:     /**
> 4684:      * Returns the top-level ancestor of this component (either the

Suggestion:

     * Returns the top-level ancestor of this component (the

There's only one option left in the parentheses.

src/java.desktop/share/classes/javax/swing/JRootPane.java line 51:

> 49:  * component on the host system) are shown with a heavier box. AWT components in red,
> 50:  * Swing heavyweights in blue.
> 51:  * The three heavyweight JFC/Swing containers ({@code JFrame}, {@code JDialog}, and

Shall we drop _“JFC”_?

src/java.desktop/share/classes/javax/swing/KeyboardManager.java line 135:

> 133: 
> 134:      /**
> 135:        * Find the top focusable Window, or InternalFrame

Suggestion:

       * Find the top focusable Window, or JInternalFrame

Update to the real type used in the condition?

src/java.desktop/share/classes/javax/swing/RepaintManager.java line 55:

> 53:  * As of 1.6 <code>RepaintManager</code> handles repaint requests
> 54:  * for Swing's top level components (
> 55:  * <code>JWindow</code>, <code>JFrame</code> and <code>JDialog</code>).

Suggestion:

 * for Swing's top level components
 * (<code>JWindow</code>, <code>JFrame</code> and <code>JDialog</code>).

Avoid a space after the opening parenthesis.

src/java.desktop/share/classes/javax/swing/SwingUtilities.java line 2196:

> 2194:      * <p>
> 2195:      * The component hierarchy must be displayable up to the toplevel component
> 2196:      * (a {@code Frame}) Otherwise this method returns {@code null}.

Suggestion:

     * (a {@code Frame}). Otherwise this method returns {@code null}.

src/java.desktop/share/classes/javax/swing/UIManager.java line 1457:

> 1455:      * This method is called before any code that depends on the
> 1456:      * <code>AppContext</code> specific LAFState object runs.
> 1457:       In some AppContext cases it's possible for this method

Suggestion:

     * <code>AppContext</code> specific LAFState object runs.
     * In some AppContext cases, it's possible for this method

src/java.desktop/share/classes/sun/awt/AppContext.java line 110:

> 108:  * wants to peek all of the key events on the EventQueue to listen for
> 109:  * passwords; if separate EventQueues are used for each ThreadGroup
> 110:  * using AppContexts, the only key events that code will be able to

Suggestion:

 * using AppContexts, the only key events that the code will be able to

Definite article?

src/java.desktop/share/classes/sun/awt/AppContext.java line 114:

> 112:  * change the Swing default look-and-feel; with that default stored in
> 113:  * an AppContext, the look-and-feel will change without
> 114:  * disrupting other contexts.<p>

Suggestion:

 * disrupting other contexts.

The empty paragraph can be dropped.

src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java line 51:

> 49: 
> 50: /**
> 51:  * A generic container used for embedding Java components,

Suggestion:

 * A generic container used for embedding Java components.

src/java.desktop/share/classes/sun/font/SunFontManager.java line 2484:

> 2482:      * that code is already written to be able to perform properly if called
> 2483:      * to duplicate work. The main difference is that if we detect we are
> 2484:      * An AppContext environment these new fonts

Suggestion:

     * in an AppContext environment these new fonts

-------------

PR Review: https://git.openjdk.org/jdk/pull/25698#pullrequestreview-2910990216
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136277388
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136278266
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136281766
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136284478
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136289738
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136290785
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136295472
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136313003
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136343274
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136344490
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136346033
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136365994
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136376363
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136380810
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136390053
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136399517
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136406164
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136419051
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136421035
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136425427
PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2136436524


More information about the client-libs-dev mailing list