# HG changeset patch # User serb # Date 1482419398 -10800 # Node ID 1d242b27f9e2146c1d5cba2217ac6d1f4747663f # Parent 785bbcd9812a1c1c2a495b3600d9316b0534ed89 8169900: The code which use Applets should be deprecated Reviewed-by: prr diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java --- a/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java Thu Dec 22 18:09:58 2016 +0300 @@ -30,21 +30,20 @@ import java.beans.beancontext.BeanContext; /** - *

* This interface is designed to work in collusion with java.beans.Beans.instantiate. * The interface is intended to provide mechanism to allow the proper * initialization of JavaBeans that are also Applets, during their * instantiation by java.beans.Beans.instantiate(). - *

* * @see java.beans.Beans#instantiate * * @since 1.2 * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - - -@SuppressWarnings("deprecation") +@Deprecated(since = "9") public interface AppletInitializer { /** @@ -74,7 +73,6 @@ * @param bCtxt The BeanContext intended for this Applet, or * null. */ - void initialize(Applet newAppletBean, BeanContext bCtxt); /** @@ -86,6 +84,5 @@ * * @param newApplet The newly instantiated JavaBean */ - void activate(Applet newApplet); } diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/java/beans/Beans.java --- a/jdk/src/java.desktop/share/classes/java/beans/Beans.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/java/beans/Beans.java Thu Dec 22 18:09:58 2016 +0300 @@ -97,8 +97,10 @@ * @exception IOException if an I/O error occurs. * @since 1.2 */ - - public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws IOException, ClassNotFoundException { + @SuppressWarnings("deprecation") + public static Object instantiate(ClassLoader cls, String beanName, + BeanContext beanContext) + throws IOException, ClassNotFoundException { return Beans.instantiate(cls, beanName, beanContext, null); } @@ -153,10 +155,18 @@ * object could not be found. * @exception IOException if an I/O error occurs. * @since 1.2 + * + * @deprecated It is recommended to use + * {@link #instantiate(ClassLoader, String, BeanContext)}, + * because the Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - @SuppressWarnings("deprecation") - public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer) - throws IOException, ClassNotFoundException { + @Deprecated(since = "9") + public static Object instantiate(ClassLoader cls, String beanName, + BeanContext beanContext, + AppletInitializer initializer) + throws IOException, ClassNotFoundException { InputStream ins; ObjectInputStream oins = null; @@ -501,7 +511,7 @@ * Package private support class. This provides a default AppletContext * for beans which are applets. */ -@SuppressWarnings("deprecation") +@Deprecated(since = "9") class BeansAppletContext implements AppletContext { Applet target; Hashtable imageCache = new Hashtable<>(); @@ -586,7 +596,7 @@ * Package private support class. This provides an AppletStub * for beans which are applets. */ -@SuppressWarnings("deprecation") +@Deprecated(since = "9") class BeansAppletStub implements AppletStub { transient boolean active; transient Applet target; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java --- a/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java Thu Dec 22 18:09:58 2016 +0300 @@ -260,6 +260,7 @@ * Obtains the appropriate Popup based on * popupType. */ + @SuppressWarnings("deprecation") private Popup getPopup(Component owner, Component contents, int ownerX, int ownerY, int popupType) { if (GraphicsEnvironment.isHeadless()) { diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java --- a/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java Thu Dec 22 18:09:58 2016 +0300 @@ -525,8 +525,12 @@ * @param h Height of the region to repaint * @see JApplet#repaint * @since 1.6 + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - @SuppressWarnings("deprecation") + @Deprecated(since = "9") public void addDirtyRegion(Applet applet, int x, int y, int w, int h) { addDirtyRegion0(applet, x, y, w, h); } diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletEvent.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletEvent.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletEvent.java Thu Dec 22 18:09:58 2016 +0300 @@ -32,8 +32,13 @@ * AppletEvent class. * * @author Sunita Mani + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ @SuppressWarnings("serial") // JDK-implementation class +@Deprecated(since = "9") public class AppletEvent extends EventObject { private Object arg; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletEventMulticaster.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletEventMulticaster.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletEventMulticaster.java Thu Dec 22 18:09:58 2016 +0300 @@ -36,7 +36,12 @@ * responsible for dispatching events to them. * * @author Sunita Mani + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ +@Deprecated(since = "9") public class AppletEventMulticaster implements AppletListener { private final AppletListener a, b; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletIOException.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletIOException.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletIOException.java Thu Dec 22 18:09:58 2016 +0300 @@ -31,10 +31,14 @@ * An applet IO exception. * * @author Koji Uno + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ @SuppressWarnings("serial") // JDK implementation class -public -class AppletIOException extends IOException { +@Deprecated(since = "9") +public class AppletIOException extends IOException { private String key = null; private Object msgobj = null; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletIllegalArgumentException.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletIllegalArgumentException.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletIllegalArgumentException.java Thu Dec 22 18:09:58 2016 +0300 @@ -29,10 +29,14 @@ * An applet security exception. * * @author Arthur van Hoff + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ @SuppressWarnings("serial") // JDK implementation class -public -class AppletIllegalArgumentException extends IllegalArgumentException { +@Deprecated(since = "9") +public class AppletIllegalArgumentException extends IllegalArgumentException { private String key = null; public AppletIllegalArgumentException(String key) { diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletImageRef.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletImageRef.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletImageRef.java Thu Dec 22 18:09:58 2016 +0300 @@ -31,6 +31,7 @@ import sun.awt.image.URLImageSource; import java.net.URL; +@Deprecated(since = "9") class AppletImageRef { private SoftReference soft = null; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletListener.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletListener.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletListener.java Thu Dec 22 18:09:58 2016 +0300 @@ -32,8 +32,12 @@ * by objects interested in AppletEvents. * * @author Sunita Mani + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - +@Deprecated(since = "9") public interface AppletListener extends EventListener { public void appletStateChanged(AppletEvent e); } diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletObjectInputStream.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletObjectInputStream.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletObjectInputStream.java Thu Dec 22 18:09:58 2016 +0300 @@ -34,8 +34,12 @@ /** * This subclass of ObjectInputStream delegates loading of classes to * an existing ClassLoader. + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - +@Deprecated(since = "9") class AppletObjectInputStream extends ObjectInputStream { private AppletClassLoader loader; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java Thu Dec 22 18:09:58 2016 +0300 @@ -52,9 +52,14 @@ * thread group to call the applet's init(), start(), stop(), and * destroy() methods. * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. + * * @author Arthur van Hoff */ -@SuppressWarnings({"serial", "deprecation"}) // JDK implementation class +@SuppressWarnings({"serial"}) // JDK implementation class +@Deprecated(since = "9") public abstract class AppletPanel extends Panel implements AppletStub, Runnable { diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java Thu Dec 22 18:09:58 2016 +0300 @@ -36,6 +36,7 @@ import sun.security.action.*; @SuppressWarnings("serial") // JDK implementation class +@Deprecated(since = "9") class AppletProps extends Frame { TextField proxyHost; @@ -197,6 +198,7 @@ /* 4066432 */ /* Dialog class to display property-related errors to user */ @SuppressWarnings("serial") // JDK implementation class +@Deprecated(since = "9") class AppletPropsErrorDialog extends Dialog { @SuppressWarnings("deprecation") public AppletPropsErrorDialog(Frame parent, String title, String message, diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java Thu Dec 22 18:09:58 2016 +0300 @@ -43,6 +43,7 @@ * A frame to show the applet tag in. */ @SuppressWarnings("serial") // JDK-implementation class +@Deprecated(since = "9") final class TextFrame extends Frame { /** @@ -91,6 +92,7 @@ /** * Lets us construct one using unix-style one shot behaviors. */ +@Deprecated(since = "9") final class StdAppletViewerFactory implements AppletViewerFactory { @Override @@ -116,8 +118,13 @@ * AppletViewer Tags. * (The document named appletviewertags.html in the JDK's docs/tooldocs directory, * once the JDK docs have been installed.) + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ -@SuppressWarnings({"serial", "deprecation"}) // JDK-implementation class +@SuppressWarnings({"serial"}) // JDK-implementation class +@Deprecated(since = "9") public class AppletViewer extends Frame implements AppletContext, Printable { /** @@ -146,7 +153,7 @@ */ AppletViewerFactory factory; - + @Deprecated(since = "9") private final class UserActionListener implements ActionListener { @Override public void actionPerformed(ActionEvent evt) { @@ -219,6 +226,7 @@ } }; + @Deprecated(since = "9") class AppletEventListener implements AppletListener { final Frame frame; diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletViewerFactory.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerFactory.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerFactory.java Thu Dec 22 18:09:58 2016 +0300 @@ -33,8 +33,8 @@ import java.net.URL; import java.awt.MenuBar; -public -interface AppletViewerFactory { +@Deprecated(since = "9") +public interface AppletViewerFactory { public AppletViewer createAppletViewer(int x, int y, URL doc, Hashtable atts); public MenuBar getBaseMenuBar(); diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java Thu Dec 22 18:09:58 2016 +0300 @@ -40,7 +40,12 @@ * destroy() methods. * * @author Arthur van Hoff + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ +@Deprecated(since = "9") class AppletViewerPanel extends AppletPanel { /* Are we debugging? */ diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/applet/Main.java --- a/jdk/src/java.desktop/share/classes/sun/applet/Main.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/applet/Main.java Thu Dec 22 18:09:58 2016 +0300 @@ -39,7 +39,12 @@ /** * The main entry point into AppletViewer. + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ +@Deprecated(since = "9") public class Main { /** * The file which contains all of the AppletViewer specific properties. diff -r 785bbcd9812a -r 1d242b27f9e2 jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java --- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java Thu Dec 22 18:30:27 2016 +0530 +++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java Thu Dec 22 18:09:58 2016 +0300 @@ -496,10 +496,14 @@ * Checks if the component is in an EmbeddedFrame. If so, * returns the applet found in the hierarchy or null if * not found. - * @return the parent applet or {@ null} + * @return the parent applet or {@code null} * @since 1.6 + * + * @deprecated The Applet API is deprecated. See the + * java.applet package + * documentation for further information. */ - @SuppressWarnings("deprecation") + @Deprecated(since = "9") public static Applet getAppletIfAncestorOf(Component comp) { Container parent = comp.getParent(); Applet applet = null;