Skip to content

Commit

Permalink
8189198: Add "forRemoval = true" to Applet API deprecations
Browse files Browse the repository at this point in the history
Reviewed-by: iris, almatvee, kcr, prr
  • Loading branch information
Andy Herrick committed Mar 26, 2021
1 parent b8122d6 commit 57115fa
Show file tree
Hide file tree
Showing 22 changed files with 73 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -431,7 +431,7 @@ public void repaintButtons() {
}

@Override
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void mouseReleased(final MouseEvent e) {
if (didForwardEvent(e)) return;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -88,7 +88,7 @@ public static void setDelegateRepaintManager(JComponent component,
* 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);
Expand All @@ -105,7 +105,7 @@ public static void setVsyncRequested(Container rootContainer,
* @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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @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;
Expand Down
3 changes: 2 additions & 1 deletion src/java.desktop/share/classes/java/applet/Applet.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
* @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 {

/**
Expand Down
5 changes: 3 additions & 2 deletions src/java.desktop/share/classes/java/applet/AppletContext.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,7 +43,8 @@
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public interface AppletContext {

/**
Expand Down
5 changes: 3 additions & 2 deletions src/java.desktop/share/classes/java/applet/AppletStub.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,7 +38,8 @@
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public interface AppletStub {

/**
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/java/applet/AudioClip.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,7 +34,7 @@
* @since 1.0
* @deprecated The Applet API is deprecated, no replacement.
*/
@Deprecated(since = "9")
@Deprecated(since = "9", forRemoval = true)
public interface AudioClip {

/**
Expand Down
8 changes: 6 additions & 2 deletions src/java.desktop/share/classes/java/applet/package-info.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/java/awt/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -4047,7 +4047,7 @@ protected class FlipBufferStrategy extends BufferStrategy {
* {@code true}.
* @see #createBuffers(int, BufferCapabilities)
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
{
Expand Down Expand Up @@ -8179,7 +8179,7 @@ boolean transferFocus(boolean clearOnFailure) {
return res;
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
final Component getNextFocusCandidate() {
Container rootAncestor = getTraversalRoot();
Component comp = this;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,7 +43,7 @@
* <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 {

/**
Expand Down Expand Up @@ -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);

/**
Expand All @@ -84,5 +85,6 @@ public interface AppletInitializer {
*
* @param newApplet The newly instantiated JavaBean
*/
@SuppressWarnings("removal")
void activate(Applet newApplet);
}
11 changes: 7 additions & 4 deletions src/java.desktop/share/classes/java/beans/Beans.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -167,7 +167,8 @@ public static Object instantiate(ClassLoader cls, String beanName,
* <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)
Expand Down Expand Up @@ -516,7 +517,8 @@ protected Class resolveClass(ObjectStreamClass classDesc)
* 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<>();
Expand Down Expand Up @@ -601,7 +603,8 @@ public Iterator<String> getStreamKeys(){
* 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;
Expand Down
6 changes: 3 additions & 3 deletions src/java.desktop/share/classes/javax/swing/JApplet.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -96,10 +96,10 @@
*
* @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
Expand Down
12 changes: 6 additions & 6 deletions src/java.desktop/share/classes/javax/swing/JComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ public void setComponentPopupMenu(JPopupMenu popup) {
* @see #setComponentPopupMenu
* @since 1.5
*/
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public JPopupMenu getComponentPopupMenu() {

if(!getInheritsPopupMenu()) {
Expand Down Expand Up @@ -2934,7 +2934,7 @@ protected void processKeyEvent(KeyEvent e) {
*
* @since 1.3
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
int condition, boolean pressed) {
InputMap map = getInputMap(condition, false);
Expand Down Expand Up @@ -2963,7 +2963,7 @@ protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
* @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;
Expand Down Expand Up @@ -4521,7 +4521,7 @@ boolean rectangleIsObscured(int x,int y,int width,int height)
* 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();
Expand Down Expand Up @@ -4690,7 +4690,7 @@ public synchronized VetoableChangeListener[] getVetoableChangeListeners() {
* 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) {
Expand Down Expand Up @@ -5098,7 +5098,7 @@ void setPaintingChild(Component paintingChild) {
this.paintingChild = paintingChild;
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
void _paintImmediately(int x, int y, int w, int h) {
Graphics g;
Container c;
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/share/classes/javax/swing/JTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -6087,7 +6087,7 @@ public CellEditorRemover(KeyboardFocusManager fm) {
this.focusManager = fm;
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void propertyChange(PropertyChangeEvent ev) {
if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -137,7 +137,7 @@ public void registerKeyStroke(KeyStroke k, JComponent c) {
/**
* 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() ||
Expand Down
10 changes: 5 additions & 5 deletions src/java.desktop/share/classes/javax/swing/PopupFactory.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -275,7 +275,7 @@ else if (popupType == LIGHT_WEIGHT_POPUP &&
* 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()) {
Expand Down Expand Up @@ -630,7 +630,7 @@ boolean overlappedByOwnedWindow() {
* 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();
Expand Down Expand Up @@ -801,7 +801,7 @@ public void hide() {
recycleLightWeightPopup(this);
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void show() {
Container parent = null;

Expand Down Expand Up @@ -956,7 +956,7 @@ public void hide() {
recycleMediumWeightPopup(this);
}

@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
public void show() {
Component component = getComponent();
Container parent = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -420,7 +420,7 @@ public synchronized void removeInvalidComponent(JComponent component) {
*
* @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.
*/
Expand Down Expand Up @@ -538,12 +538,13 @@ public void addDirtyRegion(Window window, int x, int y, int w, int h) {
* <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;

Expand Down
Loading

1 comment on commit 57115fa

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.