Skip to content

Commit 9425d3d

Browse files
stsypanovcl4es
authored andcommitted
8261880: Change nested classes in java.base to static nested classes where possible
Reviewed-by: redestad
1 parent 459abd5 commit 9425d3d

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

src/java.base/macosx/classes/apple/security/KeychainStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class KeychainStore extends KeyStoreSpi {
5353
// If a key came from the keychain it has a SecKeyRef and one or more
5454
// SecCertificateRef. When we delete the key we have to delete all of the corresponding
5555
// native objects.
56-
class KeyEntry {
56+
static class KeyEntry {
5757
Date date; // the creation date of this entry
5858
byte[] protectedPrivKey;
5959
char[] password;
@@ -63,7 +63,7 @@ class KeyEntry {
6363
};
6464

6565
// Trusted certificates
66-
class TrustedCertEntry {
66+
static class TrustedCertEntry {
6767
Date date; // the creation date of this entry
6868

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

886-
private class CertKeychainItemPair {
886+
private static class CertKeychainItemPair {
887887
long mCertificateRef;
888888
Certificate mCert;
889889

src/java.base/share/classes/java/lang/StackStreamFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static final class CallerClassFinder extends AbstractStackWalker<Integer, Class<
620620
super(walker, FILL_CLASS_REFS_ONLY|GET_CALLER_CLASS);
621621
}
622622

623-
final class ClassBuffer extends FrameBuffer<Class<?>> {
623+
static final class ClassBuffer extends FrameBuffer<Class<?>> {
624624
Class<?>[] classes; // caller class for fast path
625625
ClassBuffer(int batchSize) {
626626
super(batchSize);

src/java.base/share/classes/java/net/Inet6Address.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
class Inet6Address extends InetAddress {
177177
static final int INADDRSZ = 16;
178178

179-
private class Inet6AddressHolder {
179+
private static class Inet6AddressHolder {
180180

181181
private Inet6AddressHolder() {
182182
ipaddress = new byte[INADDRSZ];

src/java.base/share/classes/java/security/ProtectionDomain.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,6 @@ public PermissionCollection run() {
566566
/**
567567
* Used for storing ProtectionDomains as keys in a Map.
568568
*/
569-
final class Key {}
569+
static final class Key {}
570570

571571
}

src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public final class ServicesCatalog {
4848
/**
4949
* Represents a service provider in the services catalog.
5050
*/
51-
public final class ServiceProvider {
51+
public static final class ServiceProvider {
5252
private final Module module;
5353
private final String providerName;
5454

src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ private Charset checkCharset(Charset charset) throws UnsupportedEncodingExceptio
578578
* Start of Internal classes.
579579
*
580580
*/
581-
protected class Element {
581+
protected static class Element {
582582

583583
/**
584584
* the parent element

src/java.base/share/classes/sun/net/ftp/impl/FtpClient.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public FtpDirEntry parseLine(String line) {
289289
}
290290
}
291291

292-
private class MLSxParser implements FtpDirParser {
292+
private static class MLSxParser implements FtpDirParser {
293293
public FtpDirEntry parseLine(String line) {
294294
String name = null;
295295
int i = line.lastIndexOf(';');
@@ -1762,7 +1762,7 @@ public sun.net.ftp.FtpClient setDirParser(FtpDirParser p) {
17621762
return this;
17631763
}
17641764

1765-
private class FtpFileIterator implements Iterator<FtpDirEntry>, Closeable {
1765+
private static class FtpFileIterator implements Iterator<FtpDirEntry>, Closeable {
17661766

17671767
private BufferedReader in = null;
17681768
private FtpDirEntry nextFile = null;

src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public class FtpURLConnection extends URLConnection {
121121
* - The command socket (FtpClient).
122122
* Since that's the only class that needs to see that, it is an inner class.
123123
*/
124-
protected class FtpInputStream extends FilterInputStream {
124+
protected static class FtpInputStream extends FilterInputStream {
125125
FtpClient ftp;
126126
FtpInputStream(FtpClient cl, InputStream fd) {
127127
super(new BufferedInputStream(fd));
@@ -144,7 +144,7 @@ public void close() throws IOException {
144144
* - The command socket (FtpClient).
145145
* Since that's the only class that needs to see that, it is an inner class.
146146
*/
147-
protected class FtpOutputStream extends FilterOutputStream {
147+
protected static class FtpOutputStream extends FilterOutputStream {
148148
FtpClient ftp;
149149
FtpOutputStream(FtpClient cl, OutputStream fd) {
150150
super(fd);

src/java.base/share/classes/sun/security/provider/DomainKeyStore.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ private List<KeyStoreBuilderComponents> getBuilders(URI configuration,
884884
/*
885885
* Utility class that holds the components used to construct a KeyStore.Builder
886886
*/
887-
class KeyStoreBuilderComponents {
887+
static class KeyStoreBuilderComponents {
888888
String name;
889889
String type;
890890
Provider provider;

src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ public ImmutableElement fixed() {
777777

778778
}
779779

780-
class Limb implements SmallValue {
780+
static class Limb implements SmallValue {
781781
int value;
782782

783783
Limb(int value) {

src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class NTLMAuthSequence {
5050
// Used by native code to indicate when a particular protocol sequence is completed
5151
// and must not be re-used.
5252

53-
class Status {
53+
static class Status {
5454
boolean sequenceComplete;
5555
}
5656

0 commit comments

Comments
 (0)