Skip to content

Make inner classes static when feasible #28433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ private Object resolvedCachedArgument(@Nullable String beanName, @Nullable Objec
/**
* Base class representing injection information.
*/
private abstract class AutowiredElement extends InjectionMetadata.InjectedElement {
private abstract static class AutowiredElement extends InjectionMetadata.InjectedElement {

protected final boolean required;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private interface Delegate {
/**
* {@link Delegate} for {@code primitive} types.
*/
private class PrimitiveDelegate implements Delegate {
private static class PrimitiveDelegate implements Delegate {

private static final Map<Character, String> CHAR_ESCAPES;

Expand Down Expand Up @@ -177,7 +177,7 @@ private String escape(char ch) {
/**
* {@link Delegate} for {@link String} types.
*/
private class StringDelegate implements Delegate {
private static class StringDelegate implements Delegate {

@Override
@Nullable
Expand All @@ -194,7 +194,7 @@ public CodeBlock generateCode(Object value, ResolvableType type) {
/**
* {@link Delegate} for {@link Enum} types.
*/
private class EnumDelegate implements Delegate {
private static class EnumDelegate implements Delegate {

@Override
@Nullable
Expand All @@ -212,7 +212,7 @@ public CodeBlock generateCode(Object value, ResolvableType type) {
/**
* {@link Delegate} for {@link Class} types.
*/
private class ClassDelegate implements Delegate {
private static class ClassDelegate implements Delegate {

@Override
@Nullable
Expand All @@ -229,7 +229,7 @@ public CodeBlock generateCode(Object value, ResolvableType type) {
/**
* {@link Delegate} for {@link ResolvableType} types.
*/
private class ResolvableTypeDelegate implements Delegate {
private static class ResolvableTypeDelegate implements Delegate {

@Override
@Nullable
Expand Down Expand Up @@ -512,7 +512,7 @@ private <K, V> CodeBlock generateLinkedHashMapCode(Map<K, V> map,
/**
* {@link Delegate} for {@link BeanReference} types.
*/
private class BeanReferenceDelegate implements Delegate {
private static class BeanReferenceDelegate implements Delegate {

@Override
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) {
}


private class AotContribution implements BeanFactoryInitializationAotContribution {
private static class AotContribution implements BeanFactoryInitializationAotContribution {

private static final String BEAN_FACTORY_VARIABLE = BeanFactoryInitializationCode.BEAN_FACTORY_VARIABLE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void handleRequest(HttpServerExchange exchange) {
}


private class HandlerResultSubscriber implements Subscriber<Void> {
private static class HandlerResultSubscriber implements Subscriber<Void> {

private final HttpServerExchange exchange;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected VersionStrategy getStrategyForPath(String requestPath) {
}


private class FileNameVersionedResource extends AbstractResource implements HttpResource {
private static class FileNameVersionedResource extends AbstractResource implements HttpResource {

private final Resource original;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler handler,
}


private class DefaultCallback implements WebSocketConnectionCallback {
private static class DefaultCallback implements WebSocketConnectionCallback {

private final HandshakeInfo handshakeInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ protected VersionStrategy getStrategyForPath(String requestPath) {
}


private class FileNameVersionedResource extends AbstractResource implements HttpResource {
private static class FileNameVersionedResource extends AbstractResource implements HttpResource {

private final Resource original;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected SockJsFrameFormat getFrameFormat(ServerHttpRequest request) {
}


private class XhrStreamingSockJsSession extends StreamingSockJsSession {
private static class XhrStreamingSockJsSession extends StreamingSockJsSession {

public XhrStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
WebSocketHandler wsHandler, Map<String, Object> attributes) {
Expand Down