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 9425d3d
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
@@ -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 @@ class KeyEntry {
};

// 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 @@ static final class CallerClassFinder extends AbstractStackWalker<Integer, Class<
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 @@ 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 @@ 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 @@ public sun.net.ftp.FtpClient setDirParser(FtpDirParser p) {
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 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 @@ private List<KeyStoreBuilderComponents> getBuilders(URI configuration,
/*
* 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 @@ 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;
}

1 comment on commit 9425d3d

@openjdk-notifier
Copy link

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.