8231334: Suppress warnings on non-serializable instance fields in client libs serializable classes
authordarcy
Tue, 24 Sep 2019 18:25:54 -0700
changeset 58309 c6f8b2c3dc66
parent 58308 b7192797f434
child 58310 81134def991d
8231334: Suppress warnings on non-serializable instance fields in client libs serializable classes Reviewed-by: prr
src/java.desktop/share/classes/java/applet/Applet.java
src/java.desktop/share/classes/java/awt/Component.java
src/java.desktop/share/classes/java/awt/Container.java
src/java.desktop/share/classes/java/awt/Event.java
src/java.desktop/share/classes/java/awt/FileDialog.java
src/java.desktop/share/classes/java/awt/MediaTracker.java
src/java.desktop/share/classes/java/awt/MenuComponent.java
src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java
src/java.desktop/share/classes/java/awt/SentEvent.java
src/java.desktop/share/classes/java/awt/SequencedEvent.java
src/java.desktop/share/classes/java/awt/Window.java
src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java
src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java
src/java.desktop/share/classes/java/awt/event/InvocationEvent.java
src/java.desktop/share/classes/java/awt/event/ItemEvent.java
src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java
src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java
src/java.desktop/share/classes/java/beans/beancontext/BeanContextEvent.java
src/java.desktop/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java
src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java
src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java
src/java.desktop/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java
src/java.desktop/share/classes/javax/imageio/spi/DigraphNode.java
src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java
src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java
src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java
src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java
src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java
--- a/src/java.desktop/share/classes/java/applet/Applet.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/applet/Applet.java	Tue Sep 24 18:25:54 2019 -0700
@@ -544,6 +544,7 @@
     /**
      * The accessible context associated with this {@code Applet}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     AccessibleContext accessibleContext = null;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/Component.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/Component.java	Tue Sep 24 18:25:54 2019 -0700
@@ -469,6 +469,7 @@
      * @see #getFocusTraversalKeys
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Set<AWTKeyStroke>[] focusTraversalKeys;
 
     private static final String[] focusTraversalKeyPropertyNames = {
@@ -9293,6 +9294,7 @@
     /**
      * The {@code AccessibleContext} associated with this {@code Component}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected AccessibleContext accessibleContext = null;
 
     /**
@@ -9344,12 +9346,14 @@
          * A component listener to track show/hide/resize events
          * and convert them to PropertyChange events.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected ComponentListener accessibleAWTComponentHandler = null;
 
         /**
          * A listener to track focus events
          * and convert them to PropertyChange events.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected FocusListener accessibleAWTFocusHandler = null;
 
         /**
--- a/src/java.desktop/share/classes/java/awt/Container.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/Container.java	Tue Sep 24 18:25:54 2019 -0700
@@ -3851,6 +3851,7 @@
          * The handler to fire {@code PropertyChange}
          * when children are added or removed
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected ContainerListener accessibleContainerHandler = null;
 
         /**
--- a/src/java.desktop/share/classes/java/awt/Event.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/Event.java	Tue Sep 24 18:25:54 2019 -0700
@@ -455,6 +455,7 @@
      * @serial
      * @see java.awt.AWTEvent#getSource()
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public Object target;
 
     /**
@@ -537,6 +538,7 @@
      *
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public Object arg;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/FileDialog.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/FileDialog.java	Tue Sep 24 18:25:54 2019 -0700
@@ -125,6 +125,7 @@
      * @see #setFilenameFilter()
      * @see FileNameFilter
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     FilenameFilter filter;
 
     private static final String base = "filedlg";
--- a/src/java.desktop/share/classes/java/awt/MediaTracker.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/MediaTracker.java	Tue Sep 24 18:25:54 2019 -0700
@@ -185,6 +185,7 @@
      * @see #addImage(Image, int)
      * @see #removeImage(Image)
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     MediaEntry head;
 
     /*
@@ -922,8 +923,10 @@
     }
 }
 
+@SuppressWarnings("serial") // MediaEntry does not have a no-arg ctor
 class ImageMediaEntry extends MediaEntry implements ImageObserver,
 java.io.Serializable {
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Image image;
     int width;
     int height;
--- a/src/java.desktop/share/classes/java/awt/MenuComponent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/MenuComponent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -470,7 +470,7 @@
      *  though it won't actually implement the interface - that will be up
      *  to the individual objects which extend MenuComponent.
      */
-
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     AccessibleContext accessibleContext = null;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java	Tue Sep 24 18:25:54 2019 -0700
@@ -138,6 +138,7 @@
      */
     private int blockIncrement = 1;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AdjustmentListener adjustmentListener;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/SentEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/SentEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -47,6 +47,7 @@
 
     boolean dispatched;
     private AWTEvent nested;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AppContext toNotify;
 
     SentEvent() {
--- a/src/java.desktop/share/classes/java/awt/SequencedEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/SequencedEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -55,11 +55,13 @@
     private static final LinkedList<SequencedEvent> list = new LinkedList<>();
 
     private final AWTEvent nested;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AppContext appContext;
     private boolean disposed;
     private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>();
 
     private static boolean fxAppThreadIsDispatchThread;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Thread fxCheckSequenceThread;
     static {
         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
--- a/src/java.desktop/share/classes/java/awt/Window.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/Window.java	Tue Sep 24 18:25:54 2019 -0700
@@ -371,6 +371,7 @@
      * @see #setShape(Shape)
      * @since 1.7
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Shape shape = null;
 
     private static final String base = "win";
--- a/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -47,6 +47,7 @@
     /**
      * The list of files.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     final List<File> files;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -104,6 +104,7 @@
      * @serial
      * @see #getAdjustable
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Adjustable adjustable;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/event/InvocationEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/event/InvocationEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -85,6 +85,7 @@
     /**
      * The Runnable whose run() method will be called.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Runnable runnable;
 
     /**
@@ -94,6 +95,7 @@
      *
      * @see #isDispatched
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected volatile Object notifier;
 
     /**
@@ -103,6 +105,7 @@
      * @see #isDispatched
      * @since 1.8
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Runnable listener;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/event/ItemEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/event/ItemEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -95,6 +95,7 @@
      * @serial
      * @see #getItem()
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Object item;
 
     /**
--- a/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -130,12 +130,14 @@
      * New value for property.  May be null if not known.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object newValue;
 
     /**
      * Previous value for property.  May be null if not known.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object oldValue;
 
     /**
@@ -143,6 +145,7 @@
      * @serial
      * @see #getPropagationId
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object propagationId;
 
     /**
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Tue Sep 24 18:25:54 2019 -0700
@@ -348,6 +348,7 @@
      * The {@code BeanContext} in which
      * this {@code BeanContextChild} is nested.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public    BeanContextChild      beanContextChildPeer;
 
    /**
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -100,5 +100,6 @@
     /**
      * The {@code BeanContext} from which this event was propagated
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected BeanContext propagatedFrom;
 }
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -130,6 +130,7 @@
     * The list of children affected by this
     * event notification.
     */
-    @SuppressWarnings("rawtypes")
+    @SuppressWarnings({"rawtypes",
+                       "serial"}) // Not statically typed as Serializable
     protected Collection children;
 }
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Tue Sep 24 18:25:54 2019 -0700
@@ -616,7 +616,7 @@
             /**
              * The service provider.
              */
-
+            @SuppressWarnings("serial") // Not statically typed as Serializable
             protected BeanContextServiceProvider serviceProvider;
         }
 
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java	Tue Sep 24 18:25:54 2019 -0700
@@ -338,7 +338,9 @@
          */
 
 
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private           Object   child;
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private           Object   proxyPeer;
 
         private transient boolean  removePending;
--- a/src/java.desktop/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java	Tue Sep 24 18:25:54 2019 -0700
@@ -50,6 +50,7 @@
      * The {@code Node} that led to the parsing error, or
      * {@code null}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Node offendingNode = null;
 
     /**
--- a/src/java.desktop/share/classes/javax/imageio/spi/DigraphNode.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/spi/DigraphNode.java	Tue Sep 24 18:25:54 2019 -0700
@@ -43,12 +43,14 @@
     private static final long serialVersionUID = 5308261378582246841L;
 
     /** The data associated with this node. */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected E data;
 
     /**
      * A {@code Set} of neighboring nodes pointed to by this
      * node.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Set<DigraphNode<E>> outNodes = new HashSet<>();
 
     /** The in-degree of the node. */
@@ -58,6 +60,7 @@
      * A {@code Set} of neighboring nodes that point to this
      * node.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Set<DigraphNode<E>> inNodes = new HashSet<>();
 
     public DigraphNode(E data) {
--- a/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java	Tue Sep 24 18:25:54 2019 -0700
@@ -86,6 +86,7 @@
         /**
          * The attribute set.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private AttributeSet attrset;
 
         /**
@@ -346,6 +347,7 @@
         /**
          * The attribute set.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private AttributeSet attrset;
 
         /**
--- a/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -44,6 +44,7 @@
     /**
      * The printing service attributes that changed.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private PrintJobAttributeSet attributes;
 
     /**
--- a/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -44,6 +44,7 @@
     /**
      * The printing service attributes that changed.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private PrintServiceAttributeSet attributes;
 
     /**
--- a/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java	Tue Sep 24 18:25:54 2019 -0700
@@ -60,6 +60,7 @@
      * @see #getType
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Type type;
 
     /**
--- a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Tue Sep 24 22:57:28 2019 +0100
+++ b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Tue Sep 24 18:25:54 2019 -0700
@@ -56,6 +56,7 @@
 
     private boolean isCursorAllowed = true;
     private boolean supportsXEmbed = false;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private KeyboardFocusManager appletKFM;
     // JDK 1.1 compatibility
     private static final long serialVersionUID = 2967042741780317130L;