8231334: Suppress warnings on non-serializable instance fields in client libs serializable classes

Reviewed-by: prr
This commit is contained in:
Joe Darcy 2019-09-24 18:25:54 -07:00
parent 464c8b84eb
commit dab1284a36
28 changed files with 44 additions and 3 deletions

View File

@ -544,6 +544,7 @@ public class Applet extends Panel {
/**
* The accessible context associated with this {@code Applet}.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
AccessibleContext accessibleContext = null;
/**

View File

@ -469,6 +469,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @see #getFocusTraversalKeys
* @since 1.4
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
Set<AWTKeyStroke>[] focusTraversalKeys;
private static final String[] focusTraversalKeyPropertyNames = {
@ -9293,6 +9294,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* The {@code AccessibleContext} associated with this {@code Component}.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected AccessibleContext accessibleContext = null;
/**
@ -9344,12 +9346,14 @@ public abstract class Component implements ImageObserver, MenuContainer,
* 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;
/**

View File

@ -3851,6 +3851,7 @@ public class Container extends Component {
* The handler to fire {@code PropertyChange}
* when children are added or removed
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected ContainerListener accessibleContainerHandler = null;
/**

View File

@ -455,6 +455,7 @@ public class Event implements java.io.Serializable {
* @serial
* @see java.awt.AWTEvent#getSource()
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
public Object target;
/**
@ -537,6 +538,7 @@ public class Event implements java.io.Serializable {
*
* @serial
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
public Object arg;
/**

View File

@ -125,6 +125,7 @@ public class FileDialog extends Dialog {
* @see #setFilenameFilter()
* @see FileNameFilter
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
FilenameFilter filter;
private static final String base = "filedlg";

View File

@ -185,6 +185,7 @@ public class MediaTracker implements java.io.Serializable {
* @see #addImage(Image, int)
* @see #removeImage(Image)
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
MediaEntry head;
/*
@ -922,8 +923,10 @@ abstract class MediaEntry {
}
}
@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;

View File

@ -470,7 +470,7 @@ public abstract class MenuComponent implements java.io.Serializable {
* 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;
/**

View File

@ -138,6 +138,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable {
*/
private int blockIncrement = 1;
@SuppressWarnings("serial") // Not statically typed as Serializable
private AdjustmentListener adjustmentListener;
/**

View File

@ -47,6 +47,7 @@ class SentEvent extends AWTEvent implements ActiveEvent {
boolean dispatched;
private AWTEvent nested;
@SuppressWarnings("serial") // Not statically typed as Serializable
private AppContext toNotify;
SentEvent() {

View File

@ -55,11 +55,13 @@ class SequencedEvent extends AWTEvent implements ActiveEvent {
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() {

View File

@ -371,6 +371,7 @@ public class Window extends Container implements Accessible {
* @see #setShape(Shape)
* @since 1.7
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private Shape shape = null;
private static final String base = "win";

View File

@ -47,6 +47,7 @@ public class FilesEvent extends AppEvent {
/**
* The list of files.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
final List<File> files;
/**

View File

@ -104,6 +104,7 @@ public class AdjustmentEvent extends AWTEvent {
* @serial
* @see #getAdjustable
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
Adjustable adjustable;
/**

View File

@ -85,6 +85,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
/**
* The Runnable whose run() method will be called.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected Runnable runnable;
/**
@ -94,6 +95,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
*
* @see #isDispatched
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected volatile Object notifier;
/**
@ -103,6 +105,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent {
* @see #isDispatched
* @since 1.8
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private final Runnable listener;
/**

View File

@ -95,6 +95,7 @@ public class ItemEvent extends AWTEvent {
* @serial
* @see #getItem()
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
Object item;
/**

View File

@ -130,12 +130,14 @@ public class PropertyChangeEvent extends EventObject {
* 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 @@ public class PropertyChangeEvent extends EventObject {
* @serial
* @see #getPropagationId
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private Object propagationId;
/**

View File

@ -348,6 +348,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer
* The {@code BeanContext} in which
* this {@code BeanContextChild} is nested.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
public BeanContextChild beanContextChildPeer;
/**

View File

@ -100,5 +100,6 @@ public abstract class BeanContextEvent extends EventObject {
/**
* The {@code BeanContext} from which this event was propagated
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected BeanContext propagatedFrom;
}

View File

@ -130,6 +130,7 @@ public class BeanContextMembershipEvent extends BeanContextEvent {
* The list of children affected by this
* event notification.
*/
@SuppressWarnings("rawtypes")
@SuppressWarnings({"rawtypes",
"serial"}) // Not statically typed as Serializable
protected Collection children;
}

View File

@ -616,7 +616,7 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* The service provider.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected BeanContextServiceProvider serviceProvider;
}

View File

@ -338,7 +338,9 @@ public class BeanContextSupport extends BeanContextChildSupport
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private Object child;
@SuppressWarnings("serial") // Not statically typed as Serializable
private Object proxyPeer;
private transient boolean removePending;

View File

@ -50,6 +50,7 @@ public class IIOInvalidTreeException extends IIOException {
* The {@code Node} that led to the parsing error, or
* {@code null}.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
protected Node offendingNode = null;
/**

View File

@ -43,12 +43,14 @@ class DigraphNode<E> implements Cloneable, Serializable {
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 @@ class DigraphNode<E> implements Cloneable, Serializable {
* 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) {

View File

@ -86,6 +86,7 @@ public final class AttributeSetUtilities {
/**
* The attribute set.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private AttributeSet attrset;
/**
@ -346,6 +347,7 @@ public final class AttributeSetUtilities {
/**
* The attribute set.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private AttributeSet attrset;
/**

View File

@ -44,6 +44,7 @@ public class PrintJobAttributeEvent extends PrintEvent {
/**
* The printing service attributes that changed.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private PrintJobAttributeSet attributes;
/**

View File

@ -44,6 +44,7 @@ public class PrintServiceAttributeEvent extends PrintEvent {
/**
* The printing service attributes that changed.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private PrintServiceAttributeSet attributes;
/**

View File

@ -60,6 +60,7 @@ public class LineEvent extends EventObject {
* @see #getType
* @serial
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private final Type type;
/**

View File

@ -56,6 +56,7 @@ public abstract class EmbeddedFrame extends Frame
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;