8168316: Suppress deprecation warnings for Applet classes in java.desktop
authorprr
Fri, 04 Nov 2016 15:59:59 -0700
changeset 42198 6ff366cc096b
parent 42197 3fa9da09d5b6
child 42199 8c0e8e13d4d8
8168316: Suppress deprecation warnings for Applet classes in java.desktop Reviewed-by: serb, psadhukhan
jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
jdk/src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java
jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java
jdk/src/java.desktop/share/classes/java/awt/Component.java
jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java
jdk/src/java.desktop/share/classes/java/beans/Beans.java
jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
jdk/src/java.desktop/share/classes/javax/swing/JTable.java
jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java
jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java
jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java
jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java
jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
jdk/src/java.desktop/share/classes/sun/applet/AppletAudioClip.java
jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java
jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java
jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Fri Nov 04 15:59:59 2016 -0700
@@ -431,6 +431,7 @@
         }
 
         @Override
+        @SuppressWarnings("deprecation")
         public void mouseReleased(final MouseEvent e) {
             if (didForwardEvent(e)) return;
 
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/SwingUtilities3.java	Fri Nov 04 15:59:59 2016 -0700
@@ -88,6 +88,7 @@
      *  or {@code Applet}
      * @param isRequested the value to set vsyncRequested state to
      */
+    @SuppressWarnings("deprecation")
     public static void setVsyncRequested(Container rootContainer,
                                          boolean isRequested) {
         assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
@@ -104,6 +105,7 @@
      * @param rootContainer topmost container. Should be either Window or Applet
      * @return {@code true} if vsync painting is requested for {@code rootContainer}
      */
+    @SuppressWarnings("deprecation")
     public static boolean isVsyncRequested(Container rootContainer) {
         assert (rootContainer instanceof Applet) || (rootContainer instanceof Window);
         return Boolean.TRUE == vsyncedMap.get(rootContainer);
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Fri Nov 04 15:59:59 2016 -0700
@@ -55,6 +55,7 @@
  * @author Arthur van Hoff, Kara Kytle, Jan Borgersen
  * @author Florian Bomers
  */
+@SuppressWarnings("deprecation")
 public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener {
 
     private static final boolean DEBUG = false;
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java	Fri Nov 04 15:59:59 2016 -0700
@@ -4016,6 +4016,7 @@
          * {@code true}.
          * @see #createBuffers(int, BufferCapabilities)
          */
+        @SuppressWarnings("deprecation")
         protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
             throws AWTException
         {
@@ -8133,6 +8134,7 @@
         return res;
     }
 
+    @SuppressWarnings("deprecation")
     final Component getNextFocusCandidate() {
         Container rootAncestor = getTraversalRoot();
         Component comp = this;
--- a/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/AppletInitializer.java	Fri Nov 04 15:59:59 2016 -0700
@@ -44,6 +44,7 @@
  */
 
 
+@SuppressWarnings("deprecation")
 public interface AppletInitializer {
 
     /**
--- a/jdk/src/java.desktop/share/classes/java/beans/Beans.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/java/beans/Beans.java	Fri Nov 04 15:59:59 2016 -0700
@@ -154,7 +154,7 @@
      * @exception IOException if an I/O error occurs.
      * @since 1.2
      */
-
+    @SuppressWarnings("deprecation")
     public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer)
                         throws IOException, ClassNotFoundException {
 
@@ -501,7 +501,7 @@
  * Package private support class.  This provides a default AppletContext
  * for beans which are applets.
  */
-
+@SuppressWarnings("deprecation")
 class BeansAppletContext implements AppletContext {
     Applet target;
     Hashtable<URL,Object> imageCache = new Hashtable<>();
@@ -586,6 +586,7 @@
  * Package private support class.  This provides an AppletStub
  * for beans which are applets.
  */
+@SuppressWarnings("deprecation")
 class BeansAppletStub implements AppletStub {
     transient boolean active;
     transient Applet target;
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java	Fri Nov 04 15:59:59 2016 -0700
@@ -555,6 +555,7 @@
      * @see #setComponentPopupMenu
      * @since 1.5
      */
+    @SuppressWarnings("deprecation")
     public JPopupMenu getComponentPopupMenu() {
 
         if(!getInheritsPopupMenu()) {
@@ -2913,6 +2914,7 @@
      * @param pressed true if the key is pressed
      * @return true if there is a key binding for <code>e</code>
      */
+    @SuppressWarnings("deprecation")
     boolean processKeyBindings(KeyEvent e, boolean pressed) {
       if (!SwingUtilities.isValidKeyEventForKeyBindings(e)) {
           return false;
@@ -4457,6 +4459,7 @@
      *          return value for this method
      * @see #getVisibleRect
      */
+    @SuppressWarnings("deprecation")
     static final void computeVisibleRect(Component c, Rectangle visibleRect) {
         Container p = c.getParent();
         Rectangle bounds = c.getBounds();
@@ -4625,6 +4628,7 @@
      *          or <code>null</code> if not in any container
      */
     @BeanProperty(bound = false)
+    @SuppressWarnings("deprecation")
     public Container getTopLevelAncestor() {
         for(Container p = this; p != null; p = p.getParent()) {
             if(p instanceof Window || p instanceof Applet) {
@@ -5032,6 +5036,7 @@
         this.paintingChild = paintingChild;
     }
 
+    @SuppressWarnings("deprecation")
     void _paintImmediately(int x, int y, int w, int h) {
         Graphics g;
         Container c;
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java	Fri Nov 04 15:59:59 2016 -0700
@@ -6043,6 +6043,7 @@
             this.focusManager = fm;
         }
 
+        @SuppressWarnings("deprecation")
         public void propertyChange(PropertyChangeEvent ev) {
             if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) {
                 return;
--- a/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java	Fri Nov 04 15:59:59 2016 -0700
@@ -137,6 +137,7 @@
      /**
        * Find the top focusable Window, Applet, or InternalFrame
        */
+     @SuppressWarnings("deprecation")
      private static Container getTopAncestor(JComponent c) {
         for(Container p = c.getParent(); p != null; p = p.getParent()) {
             if (p instanceof Window && ((Window)p).isFocusableWindow() ||
--- a/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/PopupFactory.java	Fri Nov 04 15:59:59 2016 -0700
@@ -614,6 +614,7 @@
          * Returns true if popup can fit the screen and the owner's top parent.
          * It determines can popup be lightweight or mediumweight.
          */
+        @SuppressWarnings("deprecation")
         boolean fitsOnScreen() {
             boolean result = false;
             Component component = getComponent();
@@ -783,6 +784,8 @@
             component.removeAll();
             recycleLightWeightPopup(this);
         }
+
+        @SuppressWarnings("deprecation")
         public void show() {
             Container parent = null;
 
@@ -938,6 +941,8 @@
             rootPane.getContentPane().removeAll();
             recycleMediumWeightPopup(this);
         }
+
+        @SuppressWarnings("deprecation")
         public void show() {
             Component component = getComponent();
             Container parent = null;
--- a/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Fri Nov 04 15:59:59 2016 -0700
@@ -408,6 +408,7 @@
      *
      * @see JComponent#repaint
      */
+    @SuppressWarnings("deprecation")
     private void addDirtyRegion0(Container c, int x, int y, int w, int h) {
         /* Special cases we don't have to bother with.
          */
@@ -521,10 +522,12 @@
      * @see JApplet#repaint
      * @since 1.6
      */
+    @SuppressWarnings("deprecation")
     public void addDirtyRegion(Applet applet, int x, int y, int w, int h) {
         addDirtyRegion0(applet, x, y, w, h);
     }
 
+    @SuppressWarnings("deprecation")
     void scheduleHeavyWeightPaints() {
         Map<Container,Rectangle> hws;
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java	Fri Nov 04 15:59:59 2016 -0700
@@ -416,6 +416,7 @@
      * @param p  a Point object (converted to the new coordinate system)
      * @param c  a Component object
      */
+    @SuppressWarnings("deprecation")
     public static void convertPointToScreen(Point p,Component c) {
             Rectangle b;
             int x,y;
@@ -455,6 +456,7 @@
      * @param p  a Point object (converted to the new coordinate system)
      * @param c  a Component object
      */
+    @SuppressWarnings("deprecation")
     public static void convertPointFromScreen(Point p,Component c) {
         Rectangle b;
         int x,y;
@@ -1655,6 +1657,7 @@
      * @param c the component
      * @return the first ancestor of c that's a Window or the last Applet ancestor
      */
+    @SuppressWarnings("deprecation")
     public static Component getRoot(Component c) {
         Component applet = null;
         for(Component p = c; p != null; p = p.getParent()) {
@@ -1695,6 +1698,7 @@
      * @return true if a binding has found and processed
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public static boolean processKeyBindings(KeyEvent event) {
         if (event != null) {
             if (event.isConsumed()) {
@@ -2209,6 +2213,7 @@
      * @see java.awt.Component#isVisible()
      * @since 1.7
      */
+    @SuppressWarnings("deprecation")
     static Container getValidateRoot(Container c, boolean visibleOnly) {
         Container root = null;
 
--- a/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java	Fri Nov 04 15:59:59 2016 -0700
@@ -753,6 +753,7 @@
   // Returns: 0 no adjust
   //         -1 can't fit
   //         >0 adjust value by amount returned
+ @SuppressWarnings("deprecation")
   private int getPopupFitWidth(Rectangle popupRectInScreen, Component invoker){
     if (invoker != null){
       Container parent;
@@ -778,6 +779,7 @@
 
   // Returns:  0 no adjust
   //          >0 adjust by value return
+  @SuppressWarnings("deprecation")
   private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker){
     if (invoker != null){
       Container parent;
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java	Fri Nov 04 15:59:59 2016 -0700
@@ -926,6 +926,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         boolean isInPopup(Component src) {
             for (Component c=src; c!=null; c=c.getParent()) {
                 if (c instanceof Applet || c instanceof Window) {
@@ -1143,6 +1144,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         public void stateChanged(ChangeEvent ev) {
             if (!(UIManager.getLookAndFeel() instanceof BasicLookAndFeel)) {
                 uninstall();
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletAudioClip.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletAudioClip.java	Fri Nov 04 15:59:59 2016 -0700
@@ -41,6 +41,7 @@
  * @author Arthur van Hoff, Kara Kytle
  */
 
+@SuppressWarnings("deprecation")
 public class AppletAudioClip implements AudioClip {
 
     // url that this AudioClip is based on
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java	Fri Nov 04 15:59:59 2016 -0700
@@ -54,7 +54,7 @@
  *
  * @author      Arthur van Hoff
  */
-@SuppressWarnings("serial") // JDK implementation class
+@SuppressWarnings({"serial", "deprecation"}) // JDK implementation class
 public
 abstract class AppletPanel extends Panel implements AppletStub, Runnable {
 
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java	Fri Nov 04 15:59:59 2016 -0700
@@ -117,7 +117,7 @@
  * (The document named appletviewertags.html in the JDK's docs/tooldocs directory,
  *  once the JDK docs have been installed.)
  */
-@SuppressWarnings("serial") // JDK implementation class
+@SuppressWarnings({"serial", "deprecation"}) // JDK-implementation class
 public class AppletViewer extends Frame implements AppletContext, Printable {
 
     /**
@@ -157,7 +157,6 @@
     /**
      * Create the applet viewer.
      */
-    @SuppressWarnings("deprecation")
     public AppletViewer(int x, int y, URL doc, Hashtable<String, String> atts,
                         PrintStream statusMsgStream, AppletViewerFactory factory) {
         this.factory = factory;
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewerPanel.java	Fri Nov 04 15:59:59 2016 -0700
@@ -197,6 +197,7 @@
      * Get the applet context. For now this is
      * also implemented by the AppletPanel class.
      */
+    @SuppressWarnings("deprecation")
     public AppletContext getAppletContext() {
         return (AppletContext)getParent();
     }
--- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Fri Nov 04 15:31:38 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Fri Nov 04 15:59:59 2016 -0700
@@ -499,6 +499,7 @@
      * @return the parent applet or {@ null}
      * @since 1.6
      */
+    @SuppressWarnings("deprecation")
     public static Applet getAppletIfAncestorOf(Component comp) {
         Container parent = comp.getParent();
         Applet applet = null;