diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index f339411593d09..c9722ea23e742 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -561,7 +561,7 @@ final class Config { /** * Lock object for filter and filter factory. */ - private final static Object serialFilterLock = new Object(); + private static final Object serialFilterLock = new Object(); /** * The property name for the filter. @@ -906,7 +906,7 @@ static ObjectInputFilter createFilter2(String pattern) { * used for all ObjectInputStreams that do not set their own filters. * */ - final static class Global implements ObjectInputFilter { + static final class Global implements ObjectInputFilter { /** * The pattern used to create the filter. */ diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java index 82ba054f61f59..ff8a934a887da 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamClass.java +++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java @@ -2515,7 +2515,7 @@ synchronized MethodHandle putIfAbsentAndGet(ObjectStreamField[] fields, MethodHa } // a key composed of ObjectStreamField[] names and types - static abstract class Key { + abstract static class Key { abstract int length(); abstract String fieldName(int i); abstract Class fieldType(int i); diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java index d0ad7d43cd9e3..b8085b230afb0 100644 --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -278,7 +278,7 @@ public String toString() { *
  • By executing the body of a {@code synchronized} statement * that synchronizes on the object. *
  • For objects of type {@code Class,} by executing a - * synchronized static method of that class. + * static synchronized method of that class. * *

    * Only one thread at a time can own an object's monitor. diff --git a/src/java.base/share/classes/java/lang/Process.java b/src/java.base/share/classes/java/lang/Process.java index 5fad1b889d559..88e3e473e768f 100644 --- a/src/java.base/share/classes/java/lang/Process.java +++ b/src/java.base/share/classes/java/lang/Process.java @@ -845,7 +845,7 @@ public long skip(long n) throws IOException { * A nested class to delay looking up the Charset for the native encoding. */ private static class CharsetHolder { - private final static Charset nativeCharset; + private static final Charset nativeCharset; static { Charset cs; try { diff --git a/src/java.base/share/classes/java/lang/StackStreamFactory.java b/src/java.base/share/classes/java/lang/StackStreamFactory.java index 328154dc04ebf..22cbb2e170a9f 100644 --- a/src/java.base/share/classes/java/lang/StackStreamFactory.java +++ b/src/java.base/share/classes/java/lang/StackStreamFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -118,7 +118,7 @@ enum WalkerState { * For example, StackFrameInfo for StackWalker::walk or * Class for StackWalker::getCallerClass */ - static abstract class AbstractStackWalker { + abstract static class AbstractStackWalker { protected final StackWalker walker; protected final Thread thread; protected final int maxDepth; @@ -783,7 +783,7 @@ protected void initFrameBuffer() { * * Each specialized AbstractStackWalker subclass may subclass the FrameBuffer. */ - static abstract class FrameBuffer { + abstract static class FrameBuffer { static final int START_POS = 2; // 0th and 1st elements are reserved // buffers for VM to fill stack frame info diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index fac6716243572..6d4137c7aa463 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -331,7 +331,7 @@ private static void checkIO() { private static class CallersHolder { // Remember callers of setSecurityManager() here so that warning // is only printed once for each different caller - final static Map, Boolean> callers + static final Map, Boolean> callers = Collections.synchronizedMap(new WeakHashMap<>()); } @@ -1595,7 +1595,7 @@ public void log(Level level, ResourceBundle bundle, String format, * * @since 9 */ - public static abstract class LoggerFinder { + public abstract static class LoggerFinder { /** * The {@code RuntimePermission("loggerFinder")} is * necessary to subclass and instantiate the {@code LoggerFinder} class, diff --git a/src/java.base/share/classes/java/lang/WeakPairMap.java b/src/java.base/share/classes/java/lang/WeakPairMap.java index 0e521dc901ad0..f274461a5dbac 100644 --- a/src/java.base/share/classes/java/lang/WeakPairMap.java +++ b/src/java.base/share/classes/java/lang/WeakPairMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -340,7 +340,7 @@ public boolean equals(Object obj) { /** * Common abstract supertype of a pair of WeakReference peers. */ - private static abstract class WeakRefPeer extends WeakReference { + private abstract static class WeakRefPeer extends WeakReference { WeakRefPeer(K k, ReferenceQueue queue) { super(Objects.requireNonNull(k), queue); diff --git a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java index b61875762a4fa..5c0f2ec7944ed 100644 --- a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java +++ b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -244,7 +244,7 @@ public Iterator iterator() { } } - static abstract + abstract static class WithCache extends AbstractConstantGroup { @Stable final Object[] cache; diff --git a/src/java.base/share/classes/java/lang/invoke/CallSite.java b/src/java.base/share/classes/java/lang/invoke/CallSite.java index d6011851d9d58..e159e235f30a3 100644 --- a/src/java.base/share/classes/java/lang/invoke/CallSite.java +++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -84,8 +84,8 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam * @author John Rose, JSR 292 EG * @since 1.7 */ -abstract -public class CallSite { +public +abstract class CallSite { // The actual payload of this call site. // Can be modified using {@link MethodHandleNatives#setCallSiteTargetNormal} or {@link MethodHandleNatives#setCallSiteTargetVolatile}. diff --git a/src/java.base/share/classes/java/net/InetAddress.java b/src/java.base/share/classes/java/net/InetAddress.java index b43c88e4f0e62..38e7fc629216a 100644 --- a/src/java.base/share/classes/java/net/InetAddress.java +++ b/src/java.base/share/classes/java/net/InetAddress.java @@ -215,7 +215,7 @@ public class InetAddress implements java.io.Serializable { @Native static final int IPv6 = 2; /* Specify address family preference */ - static transient final int preferIPv6Address; + static final transient int preferIPv6Address; static class InetAddressHolder { /** diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java index ca8c96c3e04f7..11c8eb29ca70e 100644 --- a/src/java.base/share/classes/java/security/Provider.java +++ b/src/java.base/share/classes/java/security/Provider.java @@ -820,7 +820,7 @@ private void check(String directive) { // legacy properties changed since last call to any services method? private transient boolean legacyChanged; // serviceMap changed since last call to getServices() - private volatile transient boolean servicesChanged; + private transient volatile boolean servicesChanged; // Map used to keep track of legacy registration private transient Map legacyStrings; diff --git a/src/java.base/share/classes/java/util/ImmutableCollections.java b/src/java.base/share/classes/java/util/ImmutableCollections.java index 52a83552f1479..c207e4f1427d6 100644 --- a/src/java.base/share/classes/java/util/ImmutableCollections.java +++ b/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -142,7 +142,7 @@ private ImmutableCollections() { } static UnsupportedOperationException uoe() { return new UnsupportedOperationException(); } @jdk.internal.ValueBased - static abstract class AbstractImmutableCollection extends AbstractCollection { + abstract static class AbstractImmutableCollection extends AbstractCollection { // all mutating methods throw UnsupportedOperationException @Override public boolean add(E e) { throw uoe(); } @Override public boolean addAll(Collection c) { throw uoe(); } @@ -249,7 +249,7 @@ static List listFromTrustedArrayNullsAllowed(Object... input) { // ---------- List Implementations ---------- @jdk.internal.ValueBased - static abstract class AbstractImmutableList extends AbstractImmutableCollection + abstract static class AbstractImmutableList extends AbstractImmutableCollection implements List, RandomAccess { // all mutating methods throw UnsupportedOperationException @@ -742,7 +742,7 @@ public int lastIndexOf(Object o) { // ---------- Set Implementations ---------- @jdk.internal.ValueBased - static abstract class AbstractImmutableSet extends AbstractImmutableCollection + abstract static class AbstractImmutableSet extends AbstractImmutableCollection implements Set { @Override diff --git a/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java b/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java index 74dae2089a064..1738696f75ab2 100644 --- a/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java +++ b/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -624,7 +624,7 @@ public final int toBinary(OutputStream os) { static final int NO_INDEX3_NULL_OFFSET = 0x7fff; static final int NO_DATA_NULL_OFFSET = 0xfffff; - private static abstract class Data { + private abstract static class Data { abstract ValueWidth getValueWidth(); abstract int getDataLength(); abstract int getFromIndex(int index); @@ -768,7 +768,7 @@ private final int internalSmallIndex(Type type, int c) { * * @stable ICU 63 */ - public static abstract class Fast extends CodePointTrie { + public abstract static class Fast extends CodePointTrie { private Fast(char[] index, Data data, int highStart, int index3NullOffset, int dataNullOffset) { super(index, data, highStart, index3NullOffset, dataNullOffset); @@ -906,7 +906,7 @@ public boolean previous() { * * @stable ICU 63 */ - public static abstract class Small extends CodePointTrie { + public abstract static class Small extends CodePointTrie { private Small(char[] index, Data data, int highStart, int index3NullOffset, int dataNullOffset) { super(index, data, highStart, index3NullOffset, dataNullOffset); diff --git a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java index 75cf8780bd130..7796512a71592 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java +++ b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java @@ -61,11 +61,11 @@ public Boolean run() { }); } - static private final boolean IS_64_BIT = + private static final boolean IS_64_BIT = isSystemProperty("sun.arch.data.model", "64", "32"); - static private final boolean USE_JVM_MAP = + private static final boolean USE_JVM_MAP = isSystemProperty("jdk.image.use.jvm.map", "true", "true"); - static private final boolean MAP_ALL = + private static final boolean MAP_ALL = isSystemProperty("jdk.image.map.all", "true", IS_64_BIT ? "true" : "false"); private final Path imagePath; diff --git a/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java b/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java index cb22cbf4a03fa..8d228c050c605 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java +++ b/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java @@ -45,5 +45,5 @@ public Void run() { }); } - native static ByteBuffer getNativeMap(String imagePath); + static native ByteBuffer getNativeMap(String imagePath); } diff --git a/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java b/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java index 769e8d2a1b658..317e475d1a8d4 100644 --- a/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java +++ b/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java @@ -437,7 +437,7 @@ static final class Formatting { getSimpleFormat(DEFAULT_FORMAT_PROP_KEY, null); // Make it easier to wrap Logger... - static private final String[] skips; + private static final String[] skips; static { String additionalPkgs = GetPropertyAction.privilegedGetProperty("jdk.logger.packages"); diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java index 7edc326bde263..346838b47d995 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java @@ -121,7 +121,7 @@ static ModuleReference newExplodedModule(ModuleInfo.Attributes attrs, * A base module reader that encapsulates machinery required to close the * module reader safely. */ - static abstract class SafeCloseModuleReader implements ModuleReader { + abstract static class SafeCloseModuleReader implements ModuleReader { // RW lock to support safe close private final ReadWriteLock lock = new ReentrantReadWriteLock(); diff --git a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index a59206d030915..ec0bc767eb7a4 100644 --- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -888,7 +888,7 @@ private int writeInternal(ByteBuffer src, long position) throws IOException { // -- Memory-mapped buffers -- - private static abstract class Unmapper + private abstract static class Unmapper implements Runnable, UnmapperProxy { // may be required to close file diff --git a/src/java.base/share/classes/sun/security/jca/ProviderList.java b/src/java.base/share/classes/sun/security/jca/ProviderList.java index 90bb29e17f760..cf0bd736f9d17 100644 --- a/src/java.base/share/classes/sun/security/jca/ProviderList.java +++ b/src/java.base/share/classes/sun/security/jca/ProviderList.java @@ -71,7 +71,7 @@ public final class ProviderList { static final ProviderList EMPTY = new ProviderList(PC0, true); // list of all jdk.security.provider.preferred entries - static private PreferredList preferredPropList = null; + private static PreferredList preferredPropList = null; // dummy provider object to use during initialization // used to avoid explicit null checks in various places diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java index 699a5db636752..efb3258a149be 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java @@ -60,12 +60,12 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey { private final BigInteger n; // modulus private final BigInteger d; // private exponent - private transient final KeyType type; + private final transient KeyType type; // optional parameters associated with this RSA key // specified in the encoding of its AlgorithmId. // must be null for "RSA" keys. - private transient final AlgorithmParameterSpec keyParams; + private final transient AlgorithmParameterSpec keyParams; /** * Construct a key from its components. Used by the diff --git a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java index db68eb2b7d4e3..16481f800711e 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -550,7 +550,7 @@ static final void kickstart(HandshakeContext context) throws IOException { /** * A (transparent) specification of handshake message. */ - static abstract class HandshakeMessage { + abstract static class HandshakeMessage { final HandshakeContext handshakeContext; HandshakeMessage(HandshakeContext handshakeContext) {