mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Make inner classes in tests static where feasible
Closes gh-36939 Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
@@ -687,7 +687,7 @@ class BeanWrapperGenericsTests {
|
||||
}
|
||||
|
||||
|
||||
public class Bar implements Foo {
|
||||
public static class Bar implements Foo {
|
||||
|
||||
private double version;
|
||||
|
||||
@@ -710,7 +710,7 @@ class BeanWrapperGenericsTests {
|
||||
}
|
||||
|
||||
|
||||
public class Promotion implements ObjectWithId<Long> {
|
||||
public static class Promotion implements ObjectWithId<Long> {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
@@ -934,7 +934,7 @@ class ExtendedBeanInfoTests {
|
||||
}
|
||||
|
||||
|
||||
abstract class Library {
|
||||
abstract static class Library {
|
||||
|
||||
public Book getBook() {
|
||||
return null;
|
||||
@@ -945,7 +945,7 @@ class ExtendedBeanInfoTests {
|
||||
}
|
||||
|
||||
|
||||
class LawLibrary extends Library implements TextBookOperations {
|
||||
static class LawLibrary extends Library implements TextBookOperations {
|
||||
|
||||
@Override
|
||||
public LawBook getBook() {
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ class AutowireUtilsTests {
|
||||
public interface MyInterfaceType<T> {
|
||||
}
|
||||
|
||||
public class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
public static class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
}
|
||||
|
||||
public static class MyTypeWithMethods<T> {
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ class ScheduledTaskTests {
|
||||
assertThat(scheduledTask.nextExecution()).isNull();
|
||||
}
|
||||
|
||||
class CountingRunnable implements Runnable {
|
||||
static class CountingRunnable implements Runnable {
|
||||
|
||||
int executionCount;
|
||||
|
||||
|
||||
+2
-2
@@ -525,7 +525,7 @@ class SpringValidatorAdapterTests {
|
||||
}
|
||||
|
||||
|
||||
public class BeanWithListElementConstraint {
|
||||
public static class BeanWithListElementConstraint {
|
||||
|
||||
@Valid
|
||||
private List<@NotNull String> property;
|
||||
@@ -540,7 +540,7 @@ class SpringValidatorAdapterTests {
|
||||
}
|
||||
|
||||
|
||||
public class BeanWithMapEntryConstraint {
|
||||
public static class BeanWithMapEntryConstraint {
|
||||
|
||||
@Valid
|
||||
private Map<@NotNull String, @NotNull String> property;
|
||||
|
||||
+5
-5
@@ -89,23 +89,23 @@ class ExceptionDepthComparatorTests {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class HighestDepthException extends Throwable {
|
||||
public static class HighestDepthException extends Throwable {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class LowestDepthException extends HighestDepthException {
|
||||
public static class LowestDepthException extends HighestDepthException {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class TargetException extends LowestDepthException {
|
||||
public static class TargetException extends LowestDepthException {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SameDepthException extends LowestDepthException {
|
||||
public static class SameDepthException extends LowestDepthException {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class NoDepthException extends TargetException {
|
||||
public static class NoDepthException extends TargetException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -260,25 +260,25 @@ class GenericTypeResolverTests {
|
||||
public interface MyInterfaceType<T> {
|
||||
}
|
||||
|
||||
public class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
public static class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
}
|
||||
|
||||
public class MyCollectionInterfaceType implements MyInterfaceType<Collection<String>> {
|
||||
public static class MyCollectionInterfaceType implements MyInterfaceType<Collection<String>> {
|
||||
}
|
||||
|
||||
public abstract class MyAbstractType<T> implements MyInterfaceType<T> {
|
||||
public abstract static class MyAbstractType<T> implements MyInterfaceType<T> {
|
||||
}
|
||||
|
||||
public class MyConcreteType extends MyAbstractType<Character> {
|
||||
public static class MyConcreteType extends MyAbstractType<Character> {
|
||||
}
|
||||
|
||||
public abstract class MySuperclassType<T> {
|
||||
public abstract static class MySuperclassType<T> {
|
||||
}
|
||||
|
||||
public class MySimpleSuperclassType extends MySuperclassType<String> {
|
||||
public static class MySimpleSuperclassType extends MySuperclassType<String> {
|
||||
}
|
||||
|
||||
public class MyCollectionSuperclassType extends MySuperclassType<Collection<String>> {
|
||||
public static class MyCollectionSuperclassType extends MySuperclassType<Collection<String>> {
|
||||
}
|
||||
|
||||
public static class MyTypeWithMethods<T> {
|
||||
@@ -380,19 +380,19 @@ class GenericTypeResolverTests {
|
||||
static class GenericClass<T> {
|
||||
}
|
||||
|
||||
class A {}
|
||||
static class A {}
|
||||
|
||||
class B<T> {}
|
||||
static class B<T> {}
|
||||
|
||||
class C extends A {}
|
||||
static class C extends A {}
|
||||
|
||||
class D extends B<Long> {}
|
||||
static class D extends B<Long> {}
|
||||
|
||||
class E extends C {}
|
||||
static class E extends C {}
|
||||
|
||||
class TestIfc<T> {}
|
||||
static class TestIfc<T> {}
|
||||
|
||||
class TestImpl<I extends A, T extends B<I>> extends TestIfc<T> {
|
||||
static class TestImpl<I extends A, T extends B<I>> extends TestIfc<T> {
|
||||
}
|
||||
|
||||
abstract static class BiGenericClass<T extends B<?>, V extends A> {}
|
||||
|
||||
@@ -1773,7 +1773,7 @@ class ResolvableTypeTests {
|
||||
public interface MyInterfaceType<T> {
|
||||
}
|
||||
|
||||
public class MyGenericInterfaceType<T> implements MyInterfaceType<T>, ResolvableTypeProvider {
|
||||
public static class MyGenericInterfaceType<T> implements MyInterfaceType<T>, ResolvableTypeProvider {
|
||||
|
||||
private final Class<T> type;
|
||||
|
||||
@@ -1790,26 +1790,26 @@ class ResolvableTypeTests {
|
||||
}
|
||||
}
|
||||
|
||||
public class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
public static class MySimpleInterfaceType implements MyInterfaceType<String> {
|
||||
}
|
||||
|
||||
public abstract class MySimpleInterfaceTypeWithImplementsRaw implements MyInterfaceType<String>, List {
|
||||
public abstract static class MySimpleInterfaceTypeWithImplementsRaw implements MyInterfaceType<String>, List {
|
||||
}
|
||||
|
||||
public abstract class ExtendsMySimpleInterfaceTypeWithImplementsRaw extends MySimpleInterfaceTypeWithImplementsRaw {
|
||||
public abstract static class ExtendsMySimpleInterfaceTypeWithImplementsRaw extends MySimpleInterfaceTypeWithImplementsRaw {
|
||||
}
|
||||
|
||||
public class MyCollectionInterfaceType implements MyInterfaceType<Collection<String>> {
|
||||
public static class MyCollectionInterfaceType implements MyInterfaceType<Collection<String>> {
|
||||
}
|
||||
|
||||
|
||||
public abstract class MySuperclassType<T> {
|
||||
public abstract static class MySuperclassType<T> {
|
||||
}
|
||||
|
||||
public class MySimpleSuperclassType extends MySuperclassType<String> {
|
||||
public static class MySimpleSuperclassType extends MySuperclassType<String> {
|
||||
}
|
||||
|
||||
public class MyCollectionSuperclassType extends MySuperclassType<Collection<String>> {
|
||||
public static class MyCollectionSuperclassType extends MySuperclassType<Collection<String>> {
|
||||
}
|
||||
|
||||
|
||||
@@ -1819,22 +1819,22 @@ class ResolvableTypeTests {
|
||||
private static class SubConsumer<N extends Number> implements Consumer<N> {
|
||||
}
|
||||
|
||||
public class Wildcard<T extends CharSequence> {
|
||||
public static class Wildcard<T extends CharSequence> {
|
||||
}
|
||||
|
||||
public class WildcardFixed extends Wildcard<String> {
|
||||
public static class WildcardFixed extends Wildcard<String> {
|
||||
}
|
||||
|
||||
public class WildcardConsumer<T extends CharSequence & Serializable> implements Consumer<Wildcard<T>> {
|
||||
public static class WildcardConsumer<T extends CharSequence & Serializable> implements Consumer<Wildcard<T>> {
|
||||
}
|
||||
|
||||
public class DoubleWildcard<T extends CharSequence & Serializable> {
|
||||
public static class DoubleWildcard<T extends CharSequence & Serializable> {
|
||||
}
|
||||
|
||||
public class DoubleWildcardFixed extends DoubleWildcard<String> {
|
||||
public static class DoubleWildcardFixed extends DoubleWildcard<String> {
|
||||
}
|
||||
|
||||
public class DoubleWildcardConsumer<T extends CharSequence & Serializable> implements Consumer<DoubleWildcard<T>> {
|
||||
public static class DoubleWildcardConsumer<T extends CharSequence & Serializable> implements Consumer<DoubleWildcard<T>> {
|
||||
}
|
||||
|
||||
|
||||
@@ -1853,10 +1853,10 @@ class ResolvableTypeTests {
|
||||
}
|
||||
|
||||
|
||||
class Foo<T extends Foo<T>> {
|
||||
static class Foo<T extends Foo<T>> {
|
||||
}
|
||||
|
||||
class Bar extends Foo<Bar> {
|
||||
static class Bar extends Foo<Bar> {
|
||||
}
|
||||
|
||||
|
||||
@@ -1888,19 +1888,19 @@ class ResolvableTypeTests {
|
||||
public interface IBase<BT extends IBase<BT>> {
|
||||
}
|
||||
|
||||
public abstract class AbstractBase<BT extends IBase<BT>> implements IBase<BT> {
|
||||
public abstract static class AbstractBase<BT extends IBase<BT>> implements IBase<BT> {
|
||||
}
|
||||
|
||||
public class BaseImplementation extends AbstractBase<BaseImplementation> {
|
||||
public static class BaseImplementation extends AbstractBase<BaseImplementation> {
|
||||
}
|
||||
|
||||
public class BaseProvider<BT extends IBase<BT>> implements IProvider<IBase<BT>> {
|
||||
public static class BaseProvider<BT extends IBase<BT>> implements IProvider<IBase<BT>> {
|
||||
|
||||
public Collection<IBase<BT>> stuff;
|
||||
}
|
||||
|
||||
|
||||
public abstract class UnresolvedWithGenerics {
|
||||
public abstract static class UnresolvedWithGenerics {
|
||||
|
||||
Set<Integer> set;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1519,7 +1519,7 @@ class AnnotatedElementUtilsTests {
|
||||
@Nullable Object doIt();
|
||||
}
|
||||
|
||||
class TransactionalServiceImpl implements TransactionalService {
|
||||
static class TransactionalServiceImpl implements TransactionalService {
|
||||
|
||||
@Override
|
||||
public @Nullable Object doIt() {
|
||||
|
||||
+2
-3
@@ -2794,7 +2794,7 @@ class MergedAnnotationsTests {
|
||||
void doIt();
|
||||
}
|
||||
|
||||
class TransactionalServiceImpl implements TransactionalService {
|
||||
static class TransactionalServiceImpl implements TransactionalService {
|
||||
|
||||
@Override
|
||||
public void doIt() {
|
||||
@@ -3289,8 +3289,7 @@ class MergedAnnotationsTests {
|
||||
@interface DoublyComposedRootAnnotation {
|
||||
}
|
||||
|
||||
class DomainType {
|
||||
|
||||
static class DomainType {
|
||||
@RootAnnotation
|
||||
Object directlyAnnotated;
|
||||
|
||||
|
||||
@@ -967,7 +967,7 @@ class TypeDescriptorTests {
|
||||
}
|
||||
|
||||
|
||||
public class IntegerType implements GenericType<Integer> {
|
||||
public static class IntegerType implements GenericType<Integer> {
|
||||
|
||||
@Override
|
||||
public Integer getProperty() {
|
||||
@@ -989,7 +989,7 @@ class TypeDescriptorTests {
|
||||
}
|
||||
|
||||
|
||||
public class NumberType implements GenericType<Number> {
|
||||
public static class NumberType implements GenericType<Number> {
|
||||
|
||||
@Override
|
||||
public Integer getProperty() {
|
||||
|
||||
+1
-1
@@ -1195,7 +1195,7 @@ class DefaultConversionServiceTests {
|
||||
}
|
||||
|
||||
|
||||
public class ColorConverter implements Converter<String, Color> {
|
||||
public static class ColorConverter implements Converter<String, Color> {
|
||||
|
||||
@Override
|
||||
public Color convert(String source) {
|
||||
|
||||
+1
-1
@@ -372,7 +372,7 @@ class SelectionAndProjectionTests {
|
||||
/**
|
||||
* Simulates a custom {@link Iterable} which is itself not a {@link Collection}.
|
||||
*/
|
||||
class Counter implements Iterable<Integer> {
|
||||
static class Counter implements Iterable<Integer> {
|
||||
|
||||
private final List<Integer> list = new ArrayList<>();
|
||||
|
||||
|
||||
+2
-2
@@ -6744,7 +6744,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
|
||||
public class PayloadX {
|
||||
public static class PayloadX {
|
||||
|
||||
public int valueI = 120;
|
||||
public Integer valueIB = 120;
|
||||
@@ -7456,7 +7456,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
|
||||
public class Reg {
|
||||
public static class Reg {
|
||||
|
||||
private Integer _value,_value2;
|
||||
private Long _valueL,_valueL2;
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ public abstract class AbstractReactiveTransactionAspectTests {
|
||||
}
|
||||
|
||||
|
||||
public class DefaultTestBean implements TestBean {
|
||||
public static class DefaultTestBean implements TestBean {
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ class CorsUrlHandlerMappingTests {
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomCorsConfigurationSource implements CorsConfigurationSource {
|
||||
public static class CustomCorsConfigurationSource implements CorsConfigurationSource {
|
||||
|
||||
@Override
|
||||
public CorsConfiguration getCorsConfiguration(ServerWebExchange exchange) {
|
||||
|
||||
Reference in New Issue
Block a user