8274398: Suppress more warnings on non-serializable non-transient instance fields in management libs

Reviewed-by: sspitsyn
This commit is contained in:
Joe Darcy 2021-09-30 16:58:53 +00:00
parent 9573022978
commit 8215b2eb61
8 changed files with 17 additions and 5 deletions

View File

@ -184,6 +184,7 @@ public class MLet extends java.net.URLClassLoader
* The reference to the MBean server.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private MBeanServer server = null;
@ -192,6 +193,7 @@ public class MLet extends java.net.URLClassLoader
* class found at the specified URL.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private List<MLetContent> mletList = new ArrayList<MLetContent>();
@ -228,6 +230,7 @@ public class MLet extends java.net.URLClassLoader
/**
* objects maps from primitive classes to primitive object classes.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private Map<String,Class<?>> primitiveClasses =
new HashMap<String,Class<?>>(8) ;
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, 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
@ -398,6 +398,7 @@ abstract class ConnectorImpl implements Connector {
class SelectedArgumentImpl extends ConnectorImpl.ArgumentImpl
implements Connector.SelectedArgument {
private static final long serialVersionUID = -5689584530908382517L;
@SuppressWarnings("serial") // Type of field is not Serializable
private final List<String> choices;
SelectedArgumentImpl(String name, String label, String description,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, 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
@ -85,7 +85,9 @@ enum EventDestination {UNKNOWN_EVENT, INTERNAL_EVENT, CLIENT_EVENT};
*/
public class EventSetImpl extends ArrayList<Event> implements EventSet {
private static final long serialVersionUID = -4857338819787924570L;
@SuppressWarnings("serial") // Type of field is not Serializable
private VirtualMachineImpl vm; // we implement Mirror
@SuppressWarnings("serial") // Type of field is not Serializable
private Packet pkt;
private byte suspendPolicy;
private EventSetImpl internalEventSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, 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
@ -43,6 +43,7 @@ class VMAction extends EventObject {
static final int VM_NOT_SUSPENDED = 2;
int id;
@SuppressWarnings("serial") // Type of field is not Serializable
ThreadReference resumingThread;
VMAction(VirtualMachine vm, int id) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -103,6 +103,7 @@ public class SingleEntryRegistry extends RegistryImpl {
}
private final String name;
@SuppressWarnings("serial") // Type of field is not Serializable
private final Remote object;
private static final long serialVersionUID = -4897238949499730950L;

View File

@ -47,6 +47,7 @@ import sun.management.Util;
* construction of a CompositeData use in the local case.
*/
public class GarbageCollectionNotifInfoCompositeData extends LazyCompositeData {
@SuppressWarnings("serial") // Type of field is not Serializable
private final GarbageCollectionNotificationInfo gcNotifInfo;
public GarbageCollectionNotifInfoCompositeData(GarbageCollectionNotificationInfo info) {

View File

@ -51,7 +51,9 @@ import sun.management.Util;
* construction of a CompositeData use in the local case.
*/
public class GcInfoCompositeData extends LazyCompositeData {
@SuppressWarnings("serial") // Type of field is not Serializable
private final GcInfo info;
@SuppressWarnings("serial") // Type of field is not Serializable
private final GcInfoBuilder builder;
private final Object[] gcExtItemValues;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, 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
@ -40,6 +40,7 @@ import sun.management.MappedMXBeanType;
* construction of a CompositeData use in the local case.
*/
public class VMOptionCompositeData extends LazyCompositeData {
@SuppressWarnings("serial") // Type of field is not Serializable
private final VMOption option;
private VMOptionCompositeData(VMOption option) {