Skip to content
Permalink
Browse files
8276628: Use blessed modifier order in serviceability code
Reviewed-by: dholmes, lmesnik, cjplummer
  • Loading branch information
magicus committed Nov 5, 2021
1 parent b933136 commit 7023b3f8a120dda97bc27fdf130c05c1bd7a730b
Show file tree
Hide file tree
Showing 89 changed files with 284 additions and 284 deletions.
@@ -120,7 +120,7 @@
* @since 1.6
*/
public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
static abstract class NonNullMXBeanMapping extends MXBeanMapping {
abstract static class NonNullMXBeanMapping extends MXBeanMapping {
NonNullMXBeanMapping(Type javaType, OpenType<?> openType) {
super(javaType, openType);
}
@@ -936,7 +936,7 @@ final Object fromNonNullOpenValue(Object value)
}

/** Converts from a CompositeData to an instance of the targetClass. */
private static abstract class CompositeBuilder {
private abstract static class CompositeBuilder {
CompositeBuilder(Class<?> targetClass, String[] itemNames) {
this.targetClass = targetClass;
this.itemNames = itemNames;
@@ -66,7 +66,7 @@
* @since 1.5
*/
public class Introspector {
final public static boolean ALLOW_NONPUBLIC_MBEAN;
public static final boolean ALLOW_NONPUBLIC_MBEAN;
static {
@SuppressWarnings("removal")
String val = AccessController.doPrivileged(new GetPropertyAction("jdk.jmx.mbeans.allowNonPublic"));
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@@ -53,7 +53,7 @@
extends MBeanServerDelegate
implements DynamicMBean, MBeanRegistration {

final private static String[] attributeNames = new String[] {
private static final String[] attributeNames = new String[] {
"MBeanServerId",
"SpecificationName",
"SpecificationVersion",
@@ -106,22 +106,22 @@ public MBeanServerDelegateImpl () {
null,getNotificationInfo());
}

final public ObjectName preRegister (MBeanServer server, ObjectName name)
public final ObjectName preRegister (MBeanServer server, ObjectName name)
throws java.lang.Exception {
if (name == null) return DELEGATE_NAME;
else return name;
}

final public void postRegister (Boolean registrationDone) {
public final void postRegister (Boolean registrationDone) {
}

final public void preDeregister()
public final void preDeregister()
throws java.lang.Exception {
throw new IllegalArgumentException(
"The MBeanServerDelegate MBean cannot be unregistered");
}

final public void postDeregister() {
public final void postDeregister() {
}

/**
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2008, 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
@@ -89,7 +89,7 @@ public void visitOperation(String operationName,
}
}

private static abstract class Handler {
private abstract static class Handler {
Handler(String name, ConvertingMethod cm) {
this.name = name;
this.convertingMethod = cm;
@@ -146,22 +146,22 @@ else if (logger.traceOn())
/**
* Called to fetch notifications from a server.
*/
abstract protected NotificationResult fetchNotifs(long clientSequenceNumber,
protected abstract NotificationResult fetchNotifs(long clientSequenceNumber,
int maxNotifications,
long timeout)
throws IOException, ClassNotFoundException;

abstract protected Integer addListenerForMBeanRemovedNotif()
protected abstract Integer addListenerForMBeanRemovedNotif()
throws IOException, InstanceNotFoundException;

abstract protected void removeListenerForMBeanRemovedNotif(Integer id)
protected abstract void removeListenerForMBeanRemovedNotif(Integer id)
throws IOException, InstanceNotFoundException,
ListenerNotFoundException;

/**
* Used to send out a notification about lost notifs
*/
abstract protected void lostNotifs(String message, long number);
protected abstract void lostNotifs(String message, long number);


public synchronized void addNotificationListener(Integer listenerID,
@@ -85,7 +85,7 @@
* clear-text password file. If generated by the user, hashed passwords must
* follow the format specified above.
*/
final public class HashedPasswordManager {
public final class HashedPasswordManager {

private static final class UserCredentials {

@@ -355,7 +355,7 @@ public static MBeanServer newMBeanServer(String domain) {
* caller's permissions do not include or imply <code>{@link
* MBeanServerPermission}("findMBeanServer")</code>.
*/
public synchronized static
public static synchronized
ArrayList<MBeanServer> findMBeanServer(String agentId) {

checkPermission("findMBeanServer");
@@ -351,7 +351,7 @@ private static class PatternProperty extends Property {
/**
* a shared empty array for empty property lists
*/
static final private Property[] _Empty_property_array = new Property[0];
private static final Property[] _Empty_property_array = new Property[0];


// Class private fields <==============================
@@ -144,7 +144,7 @@

private static final JavaSecurityAccess javaSecurityAccess = SharedSecrets.getJavaSecurityAccess();
@SuppressWarnings("removal")
final private AccessControlContext acc = AccessController.getContext();
private final AccessControlContext acc = AccessController.getContext();

/*************************************/
/* constructors */
@@ -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
@@ -127,7 +127,7 @@ public class Timer extends NotificationBroadcasterSupport
* Table containing all the timer notifications of this timer,
* with the associated date, period and number of occurrences.
*/
final private Map<Integer,Object[]> timerTable =
private final Map<Integer,Object[]> timerTable =
new HashMap<>();

/**
@@ -162,7 +162,7 @@ public class Timer extends NotificationBroadcasterSupport
* The notification counter ID.
* Used to keep the max key value inserted into the timer table.
*/
volatile private int counterID = 0;
private volatile int counterID = 0;

private java.util.Timer timer;

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2008, 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
@@ -68,7 +68,7 @@ public void setVerbose(boolean value) {

setVerboseClass(value);
}
native static void setVerboseClass(boolean value);
static native void setVerboseClass(boolean value);

public ObjectName getObjectName() {
return Util.newObjectName(ManagementFactory.CLASS_LOADING_MXBEAN_NAME);
@@ -193,5 +193,5 @@ public ListenerInfo(NotificationListener listener,
*/
private List<ListenerInfo> listenerList = Collections.emptyList();

abstract public MBeanNotificationInfo[] getNotificationInfo();
public abstract MBeanNotificationInfo[] getNotificationInfo();
}
@@ -65,8 +65,8 @@ class VMManagementImpl implements VMManagement {
}
initOptionalSupportFields();
}
private native static String getVersion0();
private native static void initOptionalSupportFields();
private static native String getVersion0();
private static native void initOptionalSupportFields();

// Optional supports
public boolean isCompilationTimeMonitoringSupported() {
@@ -135,10 +135,10 @@ public void detach() throws IOException {
}

// protocol version
private final static String PROTOCOL_VERSION = "1";
private static final String PROTOCOL_VERSION = "1";

// known errors
private final static int ATTACH_ERROR_BADVERSION = 101;
private static final int ATTACH_ERROR_BADVERSION = 101;

/**
* Execute the given command in the target VM.
@@ -139,10 +139,10 @@ public void detach() throws IOException {
}

// protocol version
private final static String PROTOCOL_VERSION = "1";
private static final String PROTOCOL_VERSION = "1";

// known errors
private final static int ATTACH_ERROR_BADVERSION = 101;
private static final int ATTACH_ERROR_BADVERSION = 101;

/**
* Execute the given command in the target VM.
@@ -135,10 +135,10 @@ public void detach() throws IOException {
}

// protocol version
private final static String PROTOCOL_VERSION = "1";
private static final String PROTOCOL_VERSION = "1";

// known errors
private final static int ATTACH_ERROR_BADVERSION = 101;
private static final int ATTACH_ERROR_BADVERSION = 101;

/**
* Execute the given command in the target VM.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@@ -77,7 +77,7 @@ private static void initialize(TypeDataBase db) {
DERIVED_OOP_VALUE = db.lookupIntConstant("OopMapValue::derived_oop_value").intValue();
}

public static abstract class OopTypes {
public abstract static class OopTypes {
public static final OopTypes OOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.OOP_VALUE; }};
public static final OopTypes NARROWOOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.NARROWOOP_VALUE; }};
public static final OopTypes CALLEE_SAVED_VALUE = new OopTypes() { int getValue() { return OopMapValue.CALLEE_SAVED_VALUE; }};
@@ -92,7 +92,7 @@ private LoadObject createLoadObject(String fileName, long size,

// native methods

private native static void init0()
private static native void init0()
throws DebuggerException;
private native void attach0(int pid)
throws DebuggerException;
@@ -108,7 +108,7 @@ private native long[] getThreadIntegerRegisterSet0(long unique_thread_id)
throws DebuggerException;
private native byte[] readBytesFromProcess0(long address, long numBytes)
throws DebuggerException;
public native static int getAddressSize() ;
public static native int getAddressSize() ;

// Note on Bsd threads are really processes. When target process is
// attached by a serviceability agent thread, only that thread can do
@@ -32,7 +32,7 @@
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.debugger.cdbg.basic.*;

final public class BsdAARCH64CFrame extends BasicCFrame {
public final class BsdAARCH64CFrame extends BasicCFrame {
public BsdAARCH64CFrame(BsdDebugger dbg, Address fp, Address pc) {
super(dbg.getCDebugger());
this.fp = fp;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, 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
@@ -30,7 +30,7 @@
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.debugger.cdbg.basic.*;

final public class BsdAMD64CFrame extends BasicCFrame {
public final class BsdAMD64CFrame extends BasicCFrame {
public BsdAMD64CFrame(BsdDebugger dbg, Address rbp, Address rip) {
super(dbg.getCDebugger());
this.rbp = rbp;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, 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
@@ -30,7 +30,7 @@
import sun.jvm.hotspot.debugger.cdbg.basic.*;
import sun.jvm.hotspot.debugger.x86.*;

final public class BsdX86CFrame extends BasicCFrame {
public final class BsdX86CFrame extends BasicCFrame {
// package/class internals only
public BsdX86CFrame(BsdDebugger dbg, Address ebp, Address pc) {
super(dbg.getCDebugger());
@@ -98,7 +98,7 @@ private LoadObject createLoadObject(String fileName, long size,

// native methods

private native static void init0()
private static native void init0()
throws DebuggerException;
private native void setSAAltRoot0(String altroot);
private native void attach0(int pid)
@@ -115,7 +115,7 @@ private native long[] getThreadIntegerRegisterSet0(int lwp_id)
throws DebuggerException;
private native byte[] readBytesFromProcess0(long address, long numBytes)
throws DebuggerException;
public native static int getAddressSize() ;
public static native int getAddressSize() ;

@Override
public native String demangle(String sym);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, Red Hat Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -31,7 +31,7 @@
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.debugger.cdbg.basic.*;

final public class LinuxAARCH64CFrame extends BasicCFrame {
public final class LinuxAARCH64CFrame extends BasicCFrame {
public LinuxAARCH64CFrame(LinuxDebugger dbg, Address fp, Address pc) {
super(dbg.getCDebugger());
this.fp = fp;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, 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
@@ -30,7 +30,7 @@
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.debugger.cdbg.basic.*;

final public class LinuxAMD64CFrame extends BasicCFrame {
public final class LinuxAMD64CFrame extends BasicCFrame {

public static LinuxAMD64CFrame getTopFrame(LinuxDebugger dbg, Address rip, ThreadContext context) {
Address libptr = dbg.findLibPtrByAddress(rip);