Order modifiers to align with JLS

This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
This commit is contained in:
Johnny Lim
2023-10-05 21:52:29 +09:00
committed by Stéphane Nicoll
parent f60791a8e2
commit 919faa2ce2
108 changed files with 175 additions and 172 deletions

View File

@@ -87,7 +87,7 @@ class TargetPointcutSelectionTests {
// Reproducing bug requires that the class specified in target() pointcut doesn't
// include the advised method's implementation (instead a base class should include it)
static abstract class AbstractTestImpl implements TestInterface {
abstract static class AbstractTestImpl implements TestInterface {
@Override
public void interfaceMethod() {

View File

@@ -1915,7 +1915,7 @@ public abstract class AbstractAopProxyTests {
}
static abstract class ExposedInvocationTestBean extends TestBean {
abstract static class ExposedInvocationTestBean extends TestBean {
@Override
public String getName() {

View File

@@ -35,7 +35,7 @@ class BridgeMethodAutowiringTests {
}
static abstract class GenericServiceImpl<D> {
abstract static class GenericServiceImpl<D> {
public abstract void setObject(D object);
}

View File

@@ -1131,11 +1131,11 @@ class ConfigurationClassPostProcessorTests {
@Order(1)
static class SingletonBeanConfig {
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1143,11 +1143,11 @@ class ConfigurationClassPostProcessorTests {
@Configuration(proxyBeanMethods = false)
static class NonEnhancedSingletonBeanConfig {
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1168,11 +1168,11 @@ class ConfigurationClassPostProcessorTests {
@Order(2)
static class OverridingSingletonBeanConfig {
public @Bean ExtendedFoo foo() {
@Bean public ExtendedFoo foo() {
return new ExtendedFoo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1180,7 +1180,7 @@ class ConfigurationClassPostProcessorTests {
@Configuration
static class OverridingAgainSingletonBeanConfig {
public @Bean ExtendedAgainFoo foo() {
@Bean public ExtendedAgainFoo foo() {
return new ExtendedAgainFoo();
}
}
@@ -1188,7 +1188,7 @@ class ConfigurationClassPostProcessorTests {
@Configuration
static class InvalidOverridingSingletonBeanConfig {
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
}
@@ -1200,11 +1200,11 @@ class ConfigurationClassPostProcessorTests {
@Order(1)
static class SingletonBeanConfig {
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1213,11 +1213,11 @@ class ConfigurationClassPostProcessorTests {
@Order(2)
static class OverridingSingletonBeanConfig {
public @Bean ExtendedFoo foo() {
@Bean public ExtendedFoo foo() {
return new ExtendedFoo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1233,11 +1233,11 @@ class ConfigurationClassPostProcessorTests {
public SingletonBeanConfig(ConfigWithOrderedInnerClasses other) {
}
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1250,11 +1250,11 @@ class ConfigurationClassPostProcessorTests {
other.getObject();
}
public @Bean ExtendedFoo foo() {
@Bean public ExtendedFoo foo() {
return new ExtendedFoo();
}
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(foo());
}
}
@@ -1281,7 +1281,7 @@ class ConfigurationClassPostProcessorTests {
@Configuration
static class UnloadedConfig {
public @Bean Foo foo() {
@Bean public Foo foo() {
return new Foo();
}
}
@@ -1289,7 +1289,7 @@ class ConfigurationClassPostProcessorTests {
@Configuration
static class LoadedConfig {
public @Bean Bar bar() {
@Bean public Bar bar() {
return new Bar(new Foo());
}
}
@@ -1707,7 +1707,7 @@ class ConfigurationClassPostProcessorTests {
}
@Configuration
public static abstract class AbstractConfig {
public abstract static class AbstractConfig {
@Bean
public ServiceBean serviceBean() {
@@ -1891,7 +1891,7 @@ class ConfigurationClassPostProcessorTests {
}
}
static abstract class FooFactory {
abstract static class FooFactory {
abstract DependingFoo createFoo(BarArgument bar);
}
@@ -2010,7 +2010,7 @@ class ConfigurationClassPostProcessorTests {
}
@Configuration
static abstract class BeanLookupConfiguration {
abstract static class BeanLookupConfiguration {
@Bean
public TestBean thing() {

View File

@@ -54,7 +54,7 @@ public class ReflectionUtilsIntegrationTests {
@Configuration
static abstract class Parent {
abstract static class Parent {
public abstract Number m1();
}

View File

@@ -432,7 +432,7 @@ class ConfigurationClassProcessingTests {
@Configuration
static class ConfigWithFinalBean {
public final @Bean TestBean testBean() {
@Bean public final TestBean testBean() {
return new TestBean();
}
}
@@ -441,7 +441,7 @@ class ConfigurationClassProcessingTests {
@Configuration
static class ConfigWithVoidBean {
public @Bean void testBean() {
@Bean public void testBean() {
}
}
@@ -449,7 +449,7 @@ class ConfigurationClassProcessingTests {
@Configuration
static class SimplestPossibleConfig {
public @Bean String stringBean() {
@Bean public String stringBean() {
return "foo";
}
}
@@ -458,11 +458,11 @@ class ConfigurationClassProcessingTests {
@Configuration
static class ConfigWithNonSpecificReturnTypes {
public @Bean Object stringBean() {
@Bean public Object stringBean() {
return "foo";
}
public @Bean FactoryBean<?> factoryBean() {
@Bean public FactoryBean<?> factoryBean() {
ListFactoryBean fb = new ListFactoryBean();
fb.setSourceList(Arrays.asList("element1", "element2"));
return fb;
@@ -473,13 +473,13 @@ class ConfigurationClassProcessingTests {
@Configuration
static class ConfigWithPrototypeBean {
public @Bean TestBean foo() {
@Bean public TestBean foo() {
TestBean foo = new SpousyTestBean("foo");
foo.setSpouse(bar());
return foo;
}
public @Bean TestBean bar() {
@Bean public TestBean bar() {
TestBean bar = new SpousyTestBean("bar");
bar.setSpouse(baz());
return bar;

View File

@@ -120,7 +120,7 @@ public class ImportResourceTests {
static class ImportXmlConfig {
@Value("${name}")
private String name;
public @Bean TestBean javaDeclaredBean() {
@Bean public TestBean javaDeclaredBean() {
return new TestBean(this.name);
}
}
@@ -160,7 +160,7 @@ public class ImportResourceTests {
static class ImportXmlAutowiredConfig {
@Autowired TestBean xmlDeclaredBean;
public @Bean String xmlBeanName() {
@Bean public String xmlBeanName() {
return xmlDeclaredBean.getName();
}
}

View File

@@ -729,7 +729,7 @@ class AnnotationDrivenEventListenerTests {
}
static abstract class AbstractTestEventListener extends AbstractIdentifiable {
abstract static class AbstractTestEventListener extends AbstractIdentifiable {
@Autowired
private EventCollector eventCollector;

View File

@@ -618,7 +618,7 @@ public class ApplicationContextEventTests extends AbstractApplicationEventListen
}
public static abstract class MyOrderedListenerBase implements MyOrderedListenerIfc<MyEvent> {
public abstract static class MyOrderedListenerBase implements MyOrderedListenerIfc<MyEvent> {
@Override
public int getOrder() {

View File

@@ -180,7 +180,7 @@ class ScheduledAnnotationBeanPostProcessorObservabilityTests {
}
static abstract class TaskTester {
abstract static class TaskTester {
ObservationRegistry observationRegistry;