Skip to content
Permalink
Browse files
8261880: Change nested classes in java.base to static nested classes …
…where possible

Reviewed-by: redestad
  • Loading branch information
stsypanov authored and cl4es committed May 20, 2021
1 parent 459abd5 commit 9425d3de83fe8f4caddef03ffa3f4dd4de58f236
@@ -53,7 +53,7 @@
// 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 @@
};

// Trusted certificates
class TrustedCertEntry {
static class TrustedCertEntry {
Date date; // the creation date of this entry

Certificate cert;
@@ -883,7 +883,7 @@ private void createKeyEntry(String alias, long creationDate, long secKeyRef,
entries.put(alias.toLowerCase(), ke);
}

private class CertKeychainItemPair {
private static class CertKeychainItemPair {
long mCertificateRef;
Certificate mCert;

@@ -620,7 +620,7 @@ public boolean tryAdvance(Consumer<? super StackFrame> action) {
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 @@
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 PermissionCollection run() {
/**
* Used for storing ProtectionDomains as keys in a Map.
*/
final class Key {}
static final class Key {}

}
@@ -48,7 +48,7 @@
/**
* 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 @@ private Charset checkCharset(Charset charset) throws UnsupportedEncodingExceptio
* Start of Internal classes.
*
*/
protected class Element {
protected static class Element {

/**
* the parent element
@@ -289,7 +289,7 @@ public FtpDirEntry parseLine(String line) {
}
}

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 @@ private static Date parseRfc3659TimeValue(String s) {
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 @@
* - 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 void close() throws IOException {
* - 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 @@ public void engineLoad(KeyStore.LoadStoreParameter param)
/*
* 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 ImmutableElement fixed() {

}

class Limb implements SmallValue {
static class Limb implements SmallValue {
int value;

Limb(int value) {
@@ -50,7 +50,7 @@
// 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;
}

1 comment on commit 9425d3d

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 9425d3d May 20, 2021

Please sign in to comment.