Skip to content
Permalink
Browse files
8276629: Use blessed modifier order in core-libs code
Reviewed-by: dholmes, aefimov, dfuchs, mchung, iris
  • Loading branch information
magicus committed Nov 4, 2021
1 parent 7bb2173 commit 1533b8191bed9d65ab4af03945584d8b2276d828
Showing 28 changed files with 44 additions and 44 deletions.
@@ -689,7 +689,7 @@ void cleanup(Control[] reqCtls, boolean notifyParent) {
// "synchronize" might lead to deadlock so don't synchronize method
// Use streamLock instead for synchronizing update to stream

synchronized public void replaceStreams(InputStream newIn, OutputStream newOut) {
public synchronized void replaceStreams(InputStream newIn, OutputStream newOut) {
if (debug) {
System.err.println("Replacing " + inStream + " with: " + newIn);
System.err.println("Replacing " + outStream + " with: " + newOut);
@@ -712,7 +712,7 @@ synchronized public void replaceStreams(InputStream newIn, OutputStream newOut)
/*
* Replace streams and set isUpdradedToStartTls flag to the provided value
*/
synchronized public void replaceStreams(InputStream newIn, OutputStream newOut, boolean isStartTls) {
public synchronized void replaceStreams(InputStream newIn, OutputStream newOut, boolean isStartTls) {
synchronized (startTlsLock) {
replaceStreams(newIn, newOut);
isUpgradedToStartTls = isStartTls;
@@ -731,7 +731,7 @@ public boolean isUpgradedToStartTls() {
* This ensures that there is no contention between the main thread
* and the Connection thread when the main thread updates inStream.
*/
synchronized private InputStream getInputStream() {
private synchronized InputStream getInputStream() {
return inStream;
}

@@ -1043,7 +1043,7 @@ public boolean isTlsConnection() {
*/
private volatile HandshakeListener tlsHandshakeListener;

synchronized public void setHandshakeCompletedListener(SSLSocket sslSocket) {
public synchronized void setHandshakeCompletedListener(SSLSocket sslSocket) {
if (tlsHandshakeListener != null)
tlsHandshakeListener.tlsHandshakeCompleted.cancel(false);

@@ -312,7 +312,7 @@ synchronized boolean authenticateCalled() {
* @param auth The authentication mechanism
*
*/
synchronized public LdapResult ldapBind(String dn, byte[]toServer,
public synchronized LdapResult ldapBind(String dn, byte[]toServer,
Control[] bindCtls, String auth, boolean pauseAfterReceipt)
throws java.io.IOException, NamingException {

@@ -486,7 +486,7 @@ protected void finalize() {
/*
* Used by connection pooling to close physical connection.
*/
synchronized public void closeConnection() {
public synchronized void closeConnection() {
forceClose(false); // this is a pool callback so no need to clean pool
}

@@ -2648,7 +2648,7 @@ protected void finalize() {
}
}

synchronized public void close() throws NamingException {
public synchronized void close() throws NamingException {
if (debug) {
System.err.println("LdapCtx: close() called " + this);
(new Throwable()).printStackTrace();
@@ -42,7 +42,7 @@
public interface LoaderHandler {

/** package of system <code>LoaderHandler</code> implementation. */
final static String packagePrefix = "sun.rmi.server";
static final String packagePrefix = "sun.rmi.server";

/**
* Loads a class from the location specified by the
@@ -131,7 +131,7 @@ public abstract ServerSocket createServerSocket(int port)
* @see java.lang.SecurityManager#checkSetFactory()
* @since 1.1
*/
public synchronized static void setSocketFactory(RMISocketFactory fac)
public static synchronized void setSocketFactory(RMISocketFactory fac)
throws IOException
{
if (factory != null) {
@@ -153,7 +153,7 @@ public synchronized static void setSocketFactory(RMISocketFactory fac)
* @see #setSocketFactory(RMISocketFactory)
* @since 1.1
*/
public synchronized static RMISocketFactory getSocketFactory()
public static synchronized RMISocketFactory getSocketFactory()
{
return factory;
}
@@ -166,7 +166,7 @@ public synchronized static RMISocketFactory getSocketFactory()
* @return the default RMI socket factory
* @since 1.1
*/
public synchronized static RMISocketFactory getDefaultSocketFactory() {
public static synchronized RMISocketFactory getDefaultSocketFactory() {
if (defaultSocketFactory == null) {
defaultSocketFactory =
new sun.rmi.transport.tcp.TCPDirectSocketFactory();
@@ -193,7 +193,7 @@ public synchronized static RMISocketFactory getDefaultSocketFactory() {
* @see java.rmi.server.RMIFailureHandler#failure(Exception)
* @since 1.1
*/
public synchronized static void setFailureHandler(RMIFailureHandler fh)
public static synchronized void setFailureHandler(RMIFailureHandler fh)
{
@SuppressWarnings("removal")
SecurityManager security = System.getSecurityManager();
@@ -210,7 +210,7 @@ public synchronized static void setFailureHandler(RMIFailureHandler fh)
* @see #setFailureHandler(RMIFailureHandler)
* @since 1.1
*/
public synchronized static RMIFailureHandler getFailureHandler()
public static synchronized RMIFailureHandler getFailureHandler()
{
return handler;
}
@@ -45,7 +45,7 @@
public abstract class RemoteObject implements Remote, java.io.Serializable {

/** The object's remote reference. */
transient protected RemoteRef ref;
protected transient RemoteRef ref;

/** indicate compatibility with JDK 1.1.x version of class */
@java.io.Serial
@@ -53,7 +53,7 @@ public interface RemoteRef extends java.io.Externalizable {
* UnicastServerRef) are located in the package defined by the
* prefix.
*/
final static String packagePrefix = "sun.rmi.server";
static final String packagePrefix = "sun.rmi.server";

/**
* Invoke a method. This form of delegating method invocation
@@ -40,7 +40,7 @@
* for information about dynamic stub generation.
*/
@Deprecated
abstract public class RemoteStub extends RemoteObject {
public abstract class RemoteStub extends RemoteObject {

/** indicate compatibility with JDK 1.1.x version of class */
private static final long serialVersionUID = -1585587260594494182L;
@@ -78,8 +78,8 @@
*/
public class ReliableLog {

public final static int PreferredMajorVersion = 0;
public final static int PreferredMinorVersion = 2;
public static final int PreferredMajorVersion = 0;
public static final int PreferredMinorVersion = 2;

// sun.rmi.log.debug=false
private boolean Debug = false;
@@ -49,7 +49,7 @@ public final class ObjectTable {

/** maximum interval between complete garbage collections of local heap */
@SuppressWarnings("removal")
private final static long gcInterval = // default 1 hour
private static final long gcInterval = // default 1 hour
AccessController.doPrivileged((PrivilegedAction<Long>) () ->
Long.getLong("sun.rmi.dgc.server.gcInterval", 3600000));

@@ -308,7 +308,7 @@ synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)
* Remove endpoint from the reference set.
*/
@SuppressWarnings("removal")
synchronized private void refSetRemove(VMID vmid) {
private synchronized void refSetRemove(VMID vmid) {
// remove notification request
DGCImpl.getDGCImpl().unregisterTarget(vmid, this);

@@ -434,7 +434,7 @@ boolean isEmpty() {
* vmid dies. In that case, the vmid should be removed
* from the reference set.
*/
synchronized public void vmidDead(VMID vmid) {
public synchronized void vmidDead(VMID vmid) {
if (DGCImpl.dgcLog.isLoggable(Log.BRIEF)) {
DGCImpl.dgcLog.log(Log.BRIEF, "removing endpoint " +
vmid + " from reference set");
@@ -226,7 +226,7 @@ public static RowSetFactory newFactory(String factoryClassName, ClassLoader cl)
*
*/
@SuppressWarnings("removal")
static private ClassLoader getContextClassLoader() throws SecurityException {
private static ClassLoader getContextClassLoader() throws SecurityException {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {

public ClassLoader run() {
@@ -252,7 +252,7 @@ public ClassLoader run() {
* context class loader followed by the current class loader.
* @return The class which was loaded
*/
static private Class<?> getFactoryClass(String factoryClassName, ClassLoader cl,
private static Class<?> getFactoryClass(String factoryClassName, ClassLoader cl,
boolean doFallback) throws ClassNotFoundException {
Class<?> factoryClass = null;

@@ -284,7 +284,7 @@ static private Class<?> getFactoryClass(String factoryClassName, ClassLoader cl,
* Use the ServiceLoader mechanism to load the default RowSetFactory
* @return default RowSetFactory Implementation
*/
static private RowSetFactory loadViaServiceLoader() throws SQLException {
private static RowSetFactory loadViaServiceLoader() throws SQLException {
RowSetFactory theFactory = null;
try {
trace("***in loadViaServiceLoader():");
@@ -310,7 +310,7 @@ static private RowSetFactory loadViaServiceLoader() throws SQLException {
* or a {@code SecurityException} occurs.
*/
@SuppressWarnings("removal")
static private String getSystemProperty(final String propName) {
private static String getSystemProperty(final String propName) {
String property = null;
try {
property = AccessController.doPrivileged(new PrivilegedAction<String>() {
@@ -87,7 +87,7 @@ static <T> BiClassValue<T> computing(final BiFunction<Class<?>, Class<?>, T> com
* creates the association from a type Class object to its BiClassValues'.
* @param <T> the type of the values
*/
private final static class BiClassValues<T> {
private static final class BiClassValues<T> {
// These will be used for compareAndExchange on forward and reverse fields.
private static final VarHandle FORWARD;
private static final VarHandle REVERSE;
@@ -73,7 +73,7 @@ public int length() {
/**
* See JVMS, section 4.8.16.1.
*/
public static abstract class element_value {
public abstract static class element_value {
public static element_value read(ClassReader cr)
throws IOException, InvalidAnnotation {
int tag = cr.readUnsignedByte();
@@ -370,7 +370,7 @@ public void remove() {
R visitUtf8(CONSTANT_Utf8_info info, P p);
}

public static abstract class CPInfo {
public abstract static class CPInfo {
CPInfo() {
this.cp = null;
}
@@ -394,7 +394,7 @@ public int size() {
protected final ConstantPool cp;
}

public static abstract class CPRefInfo extends CPInfo {
public abstract static class CPRefInfo extends CPInfo {
protected CPRefInfo(ConstantPool cp, ClassReader cr, int tag) throws IOException {
super(cp);
this.tag = tag;
@@ -557,7 +557,7 @@ else if ((showAccess == 0) && (isPrivate))
private int showAccess;
}

static abstract class BasicDependencyFinder implements Finder {
abstract static class BasicDependencyFinder implements Finder {
private Map<String,Location> locations = new ConcurrentHashMap<>();

Location getLocation(String className) {
@@ -77,7 +77,7 @@ static int length(stack_map_frame[] entries) {
public final int number_of_entries;
public final stack_map_frame entries[];

public static abstract class stack_map_frame {
public abstract static class stack_map_frame {
static stack_map_frame read(ClassReader cr)
throws IOException, InvalidStackMap {
int frame_type = cr.readUnsignedByte();
@@ -98,7 +98,7 @@ BadArgs showUsage(boolean b) {
boolean showUsage;
}

static abstract class Option {
abstract static class Option {
Option(boolean hasArg, String... aliases) {
this.hasArg = hasArg;
this.aliases = aliases;
@@ -106,7 +106,7 @@ public boolean showUsage() {
}
}

static abstract class Option {
abstract static class Option {
Option(boolean hasArg, String... aliases) {
this.hasArg = hasArg;
this.aliases = aliases;
@@ -139,7 +139,7 @@ boolean ignoreRest() {
final String[] aliases;
}

static abstract class HiddenOption extends Option {
abstract static class HiddenOption extends Option {
HiddenOption(boolean hasArg, String... aliases) {
super(hasArg, aliases);
}
@@ -183,7 +183,7 @@ public String toString() {
return name();
}

public final static class Builder {
public static final class Builder {
final String name;
final ModuleDescriptor descriptor;
final boolean isSystem;
@@ -111,7 +111,7 @@ public static Profile getProfile(Module m) {
return null;
}

private final static Set<Module> JDK = new HashSet<>();
private static final Set<Module> JDK = new HashSet<>();
static synchronized void init(Map<String, Module> systemModules) {
Arrays.stream(Profile.values()).forEach(p ->
// this includes platform-dependent module that may not exist
@@ -87,7 +87,7 @@ List<ResourcePoolEntry> getOrderedList() {
}
}

private final static class CheckOrderResourcePoolManager extends ResourcePoolManager {
private static final class CheckOrderResourcePoolManager extends ResourcePoolManager {

private final List<ResourcePoolEntry> orderedList;
private int currentIndex;
@@ -107,7 +107,7 @@ private static class PackageNode extends Node {
* A reference to a package. Empty packages can be located inside one or
* more modules. A package with classes exist in only one module.
*/
final static class PackageReference {
static final class PackageReference {

private final String name;
private final boolean isEmpty;
@@ -90,7 +90,7 @@ public static Plugin newPlugin(Map<String, String> config, String name,
* Explicit registration of a plugin in the repository. Used by unit tests
* @param plugin The plugin to register.
*/
public synchronized static void registerPlugin(Plugin plugin) {
public static synchronized void registerPlugin(Plugin plugin) {
Objects.requireNonNull(plugin);
registeredPlugins.put(plugin.getName(), plugin);
}
@@ -101,7 +101,7 @@ public synchronized static void registerPlugin(Plugin plugin) {
*
* @param name Plugin name
*/
public synchronized static void unregisterPlugin(String name) {
public static synchronized void unregisterPlugin(String name) {
Objects.requireNonNull(name);
registeredPlugins.remove(name);
}
@@ -42,7 +42,7 @@
* Filter resource resources using path matcher.
*/
public class ResourceFilter implements Predicate<String> {
private final static List<String> EMPTY_LIST = Collections.emptyList();
private static final List<String> EMPTY_LIST = Collections.emptyList();

private final List<PathMatcher> matchers;
private final boolean include;
@@ -1041,7 +1041,7 @@ private Path moduleToPath(String name) {
* Specific subclasses should do whatever validation is required on the
* individual path elements, if any.
*/
static abstract class AbstractPathConverter implements ValueConverter<List<Path>> {
abstract static class AbstractPathConverter implements ValueConverter<List<Path>> {
@Override
public List<Path> convert(String value) {
List<Path> paths = new ArrayList<>();
@@ -989,7 +989,7 @@ public final boolean hasMoreElements() {
return hasMore();
}

abstract public T next() throws NamingException;
public abstract T next() throws NamingException;

public final T nextElement() {
try {
@@ -59,7 +59,7 @@
/**
* The type of each address in an RMI registry reference.
*/
public final static String ADDRESS_TYPE = "URL";
public static final String ADDRESS_TYPE = "URL";

public Context getInitialContext(Hashtable<?,?> env) throws NamingException {

1 comment on commit 1533b81

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 1533b81 Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.