8261880: Change nested classes in java.base to static nested classes where possible

Reviewed-by: redestad
This commit is contained in:
Sergey Tsypanov 2021-05-20 13:56:11 +00:00 committed by Claes Redestad
parent 459abd561a
commit 9425d3de83
11 changed files with 15 additions and 15 deletions
src/java.base
macosx/classes/apple/security
share/classes
windows/classes/sun/net/www/protocol/http/ntlm

@ -53,7 +53,7 @@ public final class KeychainStore extends KeyStoreSpi {
// If a key came from the keychain it has a SecKeyRef and one or more
// SecCertificateRef. When we delete the key we have to delete all of the corresponding
// native objects.
class KeyEntry {
static class KeyEntry {
Date date; // the creation date of this entry
byte[] protectedPrivKey;
char[] password;
@ -63,7 +63,7 @@ public final class KeychainStore extends KeyStoreSpi {
};
// Trusted certificates
class TrustedCertEntry {
static class TrustedCertEntry {
Date date; // the creation date of this entry
Certificate cert;
@ -883,7 +883,7 @@ public final class KeychainStore extends KeyStoreSpi {
entries.put(alias.toLowerCase(), ke);
}
private class CertKeychainItemPair {
private static class CertKeychainItemPair {
long mCertificateRef;
Certificate mCert;

@ -620,7 +620,7 @@ final class StackStreamFactory {
super(walker, FILL_CLASS_REFS_ONLY|GET_CALLER_CLASS);
}
final class ClassBuffer extends FrameBuffer<Class<?>> {
static final class ClassBuffer extends FrameBuffer<Class<?>> {
Class<?>[] classes; // caller class for fast path
ClassBuffer(int batchSize) {
super(batchSize);

@ -176,7 +176,7 @@ public final
class Inet6Address extends InetAddress {
static final int INADDRSZ = 16;
private class Inet6AddressHolder {
private static class Inet6AddressHolder {
private Inet6AddressHolder() {
ipaddress = new byte[INADDRSZ];

@ -566,6 +566,6 @@ public class ProtectionDomain {
/**
* Used for storing ProtectionDomains as keys in a Map.
*/
final class Key {}
static final class Key {}
}

@ -48,7 +48,7 @@ public final class ServicesCatalog {
/**
* Represents a service provider in the services catalog.
*/
public final class ServiceProvider {
public static final class ServiceProvider {
private final Module module;
private final String providerName;

@ -578,7 +578,7 @@ public class XMLStreamWriterImpl implements XMLStreamWriter {
* Start of Internal classes.
*
*/
protected class Element {
protected static class Element {
/**
* the parent element

@ -289,7 +289,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
}
}
private class MLSxParser implements FtpDirParser {
private static class MLSxParser implements FtpDirParser {
public FtpDirEntry parseLine(String line) {
String name = null;
int i = line.lastIndexOf(';');
@ -1762,7 +1762,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
return this;
}
private class FtpFileIterator implements Iterator<FtpDirEntry>, Closeable {
private static class FtpFileIterator implements Iterator<FtpDirEntry>, Closeable {
private BufferedReader in = null;
private FtpDirEntry nextFile = null;

@ -121,7 +121,7 @@ public class FtpURLConnection extends URLConnection {
* - The command socket (FtpClient).
* Since that's the only class that needs to see that, it is an inner class.
*/
protected class FtpInputStream extends FilterInputStream {
protected static class FtpInputStream extends FilterInputStream {
FtpClient ftp;
FtpInputStream(FtpClient cl, InputStream fd) {
super(new BufferedInputStream(fd));
@ -144,7 +144,7 @@ public class FtpURLConnection extends URLConnection {
* - The command socket (FtpClient).
* Since that's the only class that needs to see that, it is an inner class.
*/
protected class FtpOutputStream extends FilterOutputStream {
protected static class FtpOutputStream extends FilterOutputStream {
FtpClient ftp;
FtpOutputStream(FtpClient cl, OutputStream fd) {
super(fd);

@ -884,7 +884,7 @@ abstract class DomainKeyStore extends KeyStoreSpi {
/*
* Utility class that holds the components used to construct a KeyStore.Builder
*/
class KeyStoreBuilderComponents {
static class KeyStoreBuilderComponents {
String name;
String type;
Provider provider;

@ -777,7 +777,7 @@ public abstract class IntegerPolynomial implements IntegerFieldModuloP {
}
class Limb implements SmallValue {
static class Limb implements SmallValue {
int value;
Limb(int value) {

@ -50,7 +50,7 @@ public class NTLMAuthSequence {
// Used by native code to indicate when a particular protocol sequence is completed
// and must not be re-used.
class Status {
static class Status {
boolean sequenceComplete;
}