8189198: Add "forRemoval = true" to Applet API deprecations

Reviewed-by: iris, almatvee, kcr, prr
This commit is contained in:
Andy Herrick 2021-03-26 14:48:00 +00:00
parent b8122d6e3b
commit 57115fa23d
22 changed files with 73 additions and 59 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -431,7 +431,7 @@ public class AquaInternalFrameUI extends BasicInternalFrameUI implements SwingCo
}
@Override
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void mouseReleased(final MouseEvent e) {
if (didForwardEvent(e)) return;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,7 +88,7 @@ public class SwingUtilities3 {
* or {@code Applet}
* @param isRequested the value to set vsyncRequested state to
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static void setVsyncRequested(Container rootContainer,
boolean isRequested) {
assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
@ -105,7 +105,7 @@ public class SwingUtilities3 {
* @param rootContainer topmost container. Should be either Window or Applet
* @return {@code true} if vsync painting is requested for {@code rootContainer}
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static boolean isVsyncRequested(Container rootContainer) {
assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
return Boolean.TRUE == vsyncedMap.get(rootContainer);

View File

@ -57,7 +57,7 @@ import javax.sound.sampled.UnsupportedAudioFileException;
* @author Arthur van Hoff, Kara Kytle, Jan Borgersen
* @author Florian Bomers
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener {
private long lastPlayCall = 0;

View File

@ -60,7 +60,8 @@ import com.sun.media.sound.JavaSoundAudioClip;
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public class Applet extends Panel {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,8 @@ import java.util.Iterator;
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public interface AppletContext {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,8 @@ import java.net.URL;
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public interface AppletStub {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,7 @@ package java.applet;
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
public interface AudioClip {
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,7 +36,11 @@
* running applets. For example, the applet context could be a Web browser or an
* applet development environment.
* <p>
* The APIs in this package are all deprecated without replacement.
* 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.
*
* @since 1.0
*/

View File

@ -4047,7 +4047,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* {@code true}.
* @see #createBuffers(int, BufferCapabilities)
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
{
@ -8179,7 +8179,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
return res;
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
final Component getNextFocusCandidate() {
Container rootAncestor = getTraversalRoot();
Component comp = this;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ import java.beans.beancontext.BeanContext;
* <a href="../applet/package-summary.html"> java.applet package
* documentation</a> for further information.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
public interface AppletInitializer {
/**
@ -73,6 +73,7 @@ public interface AppletInitializer {
* @param bCtxt The BeanContext intended for this Applet, or
* null.
*/
@SuppressWarnings("removal")
void initialize(Applet newAppletBean, BeanContext bCtxt);
/**
@ -84,5 +85,6 @@ public interface AppletInitializer {
*
* @param newApplet The newly instantiated JavaBean
*/
@SuppressWarnings("removal")
void activate(Applet newApplet);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -167,7 +167,8 @@ public class Beans {
* <a href="../../java/applet/package-summary.html"> java.applet package
* documentation</a> for further information.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public static Object instantiate(ClassLoader cls, String beanName,
BeanContext beanContext,
AppletInitializer initializer)
@ -516,7 +517,8 @@ class ObjectInputStreamWithLoader extends ObjectInputStream
* Package private support class. This provides a default AppletContext
* for beans which are applets.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
class BeansAppletContext implements AppletContext {
Applet target;
Hashtable<URL,Object> imageCache = new Hashtable<>();
@ -601,7 +603,8 @@ class BeansAppletContext implements AppletContext {
* Package private support class. This provides an AppletStub
* for beans which are applets.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
class BeansAppletStub implements AppletStub {
transient boolean active;
transient Applet target;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -96,10 +96,10 @@ import javax.accessibility.AccessibleContext;
*
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@JavaBean(defaultProperty = "JMenuBar", description = "Swing's Applet subclass.")
@SwingContainer(delegate = "getContentPane")
@SuppressWarnings("serial") // Same-version serialization only
@SuppressWarnings({"serial", "removal"}) // Same-version serialization only
public class JApplet extends Applet implements Accessible,
RootPaneContainer,
TransferHandler.HasGetTransferHandler

View File

@ -599,7 +599,7 @@ public abstract class JComponent extends Container implements Serializable,
* @see #setComponentPopupMenu
* @since 1.5
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public JPopupMenu getComponentPopupMenu() {
if(!getInheritsPopupMenu()) {
@ -2934,7 +2934,7 @@ public abstract class JComponent extends Container implements Serializable,
*
* @since 1.3
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
int condition, boolean pressed) {
InputMap map = getInputMap(condition, false);
@ -2963,7 +2963,7 @@ public abstract class JComponent extends Container implements Serializable,
* @param pressed true if the key is pressed
* @return true if there is a key binding for <code>e</code>
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
boolean processKeyBindings(KeyEvent e, boolean pressed) {
if (!SwingUtilities.isValidKeyEventForKeyBindings(e)) {
return false;
@ -4521,7 +4521,7 @@ public abstract class JComponent extends Container implements Serializable,
* return value for this method
* @see #getVisibleRect
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
static final void computeVisibleRect(Component c, Rectangle visibleRect) {
Container p = c.getParent();
Rectangle bounds = c.getBounds();
@ -4690,7 +4690,7 @@ public abstract class JComponent extends Container implements Serializable,
* or <code>null</code> if not in any container
*/
@BeanProperty(bound = false)
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public Container getTopLevelAncestor() {
for(Container p = this; p != null; p = p.getParent()) {
if(p instanceof Window || p instanceof Applet) {
@ -5098,7 +5098,7 @@ public abstract class JComponent extends Container implements Serializable,
this.paintingChild = paintingChild;
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
void _paintImmediately(int x, int y, int w, int h) {
Graphics g;
Container c;

View File

@ -6087,7 +6087,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
this.focusManager = fm;
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void propertyChange(PropertyChangeEvent ev) {
if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
return;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -137,7 +137,7 @@ class KeyboardManager {
/**
* Find the top focusable Window, Applet, or InternalFrame
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private static Container getTopAncestor(JComponent c) {
for(Container p = c.getParent(); p != null; p = p.getParent()) {
if (p instanceof Window && ((Window)p).isFocusableWindow() ||

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -275,7 +275,7 @@ public class PopupFactory {
* Obtains the appropriate <code>Popup</code> based on
* <code>popupType</code>.
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private Popup getPopup(Component owner, Component contents,
int ownerX, int ownerY, int popupType) {
if (GraphicsEnvironment.isHeadless()) {
@ -630,7 +630,7 @@ public class PopupFactory {
* Returns true if popup can fit the screen and the owner's top parent.
* It determines can popup be lightweight or mediumweight.
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
boolean fitsOnScreen() {
boolean result = false;
Component component = getComponent();
@ -801,7 +801,7 @@ public class PopupFactory {
recycleLightWeightPopup(this);
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void show() {
Container parent = null;
@ -956,7 +956,7 @@ public class PopupFactory {
recycleMediumWeightPopup(this);
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void show() {
Component component = getComponent();
Container parent = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -420,7 +420,7 @@ public class RepaintManager
*
* @see JComponent#repaint
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
/* Special cases we don't have to bother with.
*/
@ -538,12 +538,13 @@ public class RepaintManager
* <a href="../../java/applet/package-summary.html"> java.applet package
* documentation</a> for further information.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public void addDirtyRegion(Applet applet, int x, int y, int w, int h) {
addDirtyRegion0(applet, x, y, w, h);
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
void scheduleHeavyWeightPaints() {
Map<Container,Rectangle> hws;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -421,7 +421,7 @@ public class SwingUtilities implements SwingConstants
* @param p a Point object (converted to the new coordinate system)
* @param c a Component object
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static void convertPointToScreen(Point p,Component c) {
Rectangle b;
int x,y;
@ -461,7 +461,7 @@ public class SwingUtilities implements SwingConstants
* @param p a Point object (converted to the new coordinate system)
* @param c a Component object
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static void convertPointFromScreen(Point p,Component c) {
Rectangle b;
int x,y;
@ -1662,7 +1662,7 @@ public class SwingUtilities implements SwingConstants
* @param c the component
* @return the first ancestor of c that's a Window or the last Applet ancestor
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static Component getRoot(Component c) {
Component applet = null;
for(Component p = c; p != null; p = p.getParent()) {
@ -1703,7 +1703,7 @@ public class SwingUtilities implements SwingConstants
* @return true if a binding has found and processed
* @since 1.4
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public static boolean processKeyBindings(KeyEvent event) {
if (event != null) {
if (event.isConsumed()) {
@ -2218,7 +2218,7 @@ public class SwingUtilities implements SwingConstants
* @see java.awt.Component#isVisible()
* @since 1.7
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
static Container getValidateRoot(Container c, boolean visibleOnly) {
Container root = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -784,7 +784,7 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
// Returns: 0 no adjust
// -1 can't fit
// >0 adjust value by amount returned
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private int getPopupFitWidth(Rectangle popupRectInScreen, Component invoker){
if (invoker != null){
Container parent;
@ -810,7 +810,7 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
// Returns: 0 no adjust
// >0 adjust by value return
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker){
if (invoker != null){
Container parent;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -932,7 +932,7 @@ public class BasicPopupMenuUI extends PopupMenuUI {
}
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
boolean isInPopup(Component src) {
for (Component c=src; c!=null; c=c.getParent()) {
if (c instanceof Applet || c instanceof Window) {
@ -1150,7 +1150,7 @@ public class BasicPopupMenuUI extends PopupMenuUI {
}
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void stateChanged(ChangeEvent ev) {
if (!(UIManager.getLookAndFeel() instanceof BasicLookAndFeel)) {
uninstall();

View File

@ -522,7 +522,8 @@ public abstract class EmbeddedFrame extends Frame
* <a href="../../java/applet/package-summary.html"> java.applet package
* documentation</a> for further information.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public static Applet getAppletIfAncestorOf(Component comp) {
Container parent = comp.getParent();
Applet applet = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1082,6 +1082,6 @@ public interface Context {
*
* @since 1.3
*/
@Deprecated
@Deprecated(since = "9", forRemoval = true)
String APPLET = "java.naming.applet";
};