# 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; HashtablePopup
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