8232234: Suppress warnings on non-serializable non-transient instance fields in java.rmi

Reviewed-by: rriggs
This commit is contained in:
Joe Darcy 2019-10-15 13:25:57 -07:00
parent 6b11446797
commit b5d427b0bc
6 changed files with 18 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -107,6 +107,7 @@ public abstract class ActivationGroup
/**
* @serial the group's monitor
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private ActivationMonitor monitor;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -49,6 +49,7 @@ public class ActivationGroupID implements java.io.Serializable {
/**
* @serial The group's activation system.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private ActivationSystem system;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -189,12 +189,14 @@ public class UnicastRemoteObject extends RemoteServer {
/**
* @serial client-side socket factory (if any)
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private RMIClientSocketFactory csf = null;
/**
* @serial server-side socket factory (if any) to use when
* exporting object
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private RMIServerSocketFactory ssf = null;
/* indicate compatibility with JDK 1.1.x version of class */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,6 +38,7 @@ import sun.rmi.transport.LiveRef;
*
* @author Ann Wollrath
*/
@SuppressWarnings("serial") // Externalizable class w/o no-arg c'tor
public class ActivatableServerRef extends UnicastServerRef2 {
private static final long serialVersionUID = 2002967993223003793L;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -145,9 +145,11 @@ public class Activation implements Serializable {
private static boolean debugExec;
/** maps activation id to its respective group id */
@SuppressWarnings("serial") // Conditionally serializable
private Map<ActivationID,ActivationGroupID> idTable =
new ConcurrentHashMap<>();
/** maps group id to its GroupEntry groups */
@SuppressWarnings("serial") // Conditionally serializable
private Map<ActivationGroupID,GroupEntry> groupTable =
new ConcurrentHashMap<>();
@ -297,6 +299,7 @@ public class Activation implements Serializable {
private static final String NAME = ActivationSystem.class.getName();
private static final long serialVersionUID = 4877330021609408794L;
@SuppressWarnings("serial") // Not statically typed as Serializable
private ActivationSystem systemStub = null;
SystemRegistryImpl(int port,
@ -498,6 +501,7 @@ public class Activation implements Serializable {
* with RegistryImpl.checkAccess().
* The kind of access is retained for an exception if one is thrown.
*/
@SuppressWarnings("serial") // Externalizable class w/o no-arg c'tor
static class SameHostOnlyServerRef extends UnicastServerRef {
private static final long serialVersionUID = 1234L;
private String accessKind; // an exception message
@ -873,7 +877,9 @@ public class Activation implements Serializable {
ActivationGroupDesc desc = null;
ActivationGroupID groupID = null;
long incarnation = 0;
@SuppressWarnings("serial") // Conditionally serializable
Map<ActivationID,ObjectEntry> objects = new HashMap<>();
@SuppressWarnings("serial") // Conditionally serializable
Set<ActivationID> restartSet = new HashSet<>();
transient ActivationInstantiator group = null;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,6 +69,7 @@ public class ActivationGroupImpl extends ActivationGroup {
new Hashtable<>();
private boolean groupInactive = false;
private final ActivationGroupID groupID;
@SuppressWarnings("serial") // Conditionally serializable
private final List<ActivationID> lockedIDs = new ArrayList<>();
/**