Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8276628: Use blessed modifier order in serviceability code #6249

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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"));
Expand Down
@@ -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
Expand Down Expand Up @@ -53,7 +53,7 @@ final class MBeanServerDelegateImpl
extends MBeanServerDelegate
implements DynamicMBean, MBeanRegistration {

final private static String[] attributeNames = new String[] {
private static final String[] attributeNames = new String[] {
"MBeanServerId",
"SpecificationName",
"SpecificationVersion",
Expand Down Expand Up @@ -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() {
}

/**
Expand Down
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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,
Expand Down
Expand Up @@ -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 {

Expand Down
Expand Up @@ -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");
Expand Down
Expand Up @@ -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 <==============================
Expand Down
Expand Up @@ -144,7 +144,7 @@ public class RequiredModelMBean

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

/*************************************/
/* constructors */
Expand Down
@@ -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
Expand Down Expand Up @@ -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<>();

/**
Expand Down Expand Up @@ -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;

Expand Down
@@ -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
Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -193,5 +193,5 @@ public ListenerInfo(NotificationListener listener,
*/
private List<ListenerInfo> listenerList = Collections.emptyList();

abstract public MBeanNotificationInfo[] getNotificationInfo();
public abstract MBeanNotificationInfo[] getNotificationInfo();
}
Expand Up @@ -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() {
Expand Down
Expand Up @@ -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.
Expand Down
Expand Up @@ -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.
Expand Down
Expand Up @@ -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.
Expand Down
@@ -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
Expand Down Expand Up @@ -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; }};
Expand Down
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Expand Up @@ -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;
Expand Down
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
@@ -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
Expand Down Expand Up @@ -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());
Expand Down
Expand Up @@ -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)
Expand All @@ -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);
Expand Down
@@ -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.
*
Expand Down Expand Up @@ -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;
Expand Down
@@ -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
Expand Down Expand Up @@ -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);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 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
Expand Down Expand Up @@ -30,7 +30,7 @@
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.debugger.cdbg.basic.*;

final public class LinuxPPC64CFrame extends BasicCFrame {
public final class LinuxPPC64CFrame extends BasicCFrame {
// package/class internals only

public LinuxPPC64CFrame(LinuxDebugger dbg, Address sp, Address pc, int address_size) {
Expand Down