Browse Source

Remove superfluous static declaration for enum, annotation, & interface

pull/28853/head
Sam Brannen 3 years ago
parent
commit
d274e893a6
  1. 6
      spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java
  2. 2
      spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java
  3. 2
      spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
  4. 10
      spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
  5. 12
      spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java
  6. 2
      spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java
  7. 2
      spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java
  8. 32
      spring-context/src/test/java/org/springframework/context/annotation/AnnotationBeanNameGeneratorTests.java
  9. 13
      spring-context/src/test/java/org/springframework/context/annotation/BeanMethodMetadataTests.java
  10. 2
      spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java
  11. 2
      spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java
  12. 2
      spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java
  13. 2
      spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java
  14. 13
      spring-core/src/test/java/org/springframework/core/annotation/AnnotationEnclosingClassSample.java
  15. 13
      spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java
  16. 4
      spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java
  17. 30
      spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java
  18. 40
      spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java
  19. 2
      spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java
  20. 4
      spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java
  21. 26
      spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java
  22. 2
      spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java
  23. 4
      spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java
  24. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTests.java
  25. 10
      spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java
  26. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java
  27. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerTests.java
  28. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java
  29. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/rules/RepeatedSpringRuleTests.java
  30. 6
      spring-test/src/test/java/org/springframework/test/context/support/AbstractContextConfigurationUtilsTests.java
  31. 6
      spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java
  32. 4
      spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderUtilsTests.java
  33. 2
      spring-test/src/test/java/org/springframework/test/context/support/BootstrapTestUtilsMergedConfigTests.java
  34. 10
      spring-test/src/test/java/org/springframework/test/context/support/ContextLoaderUtilsContextHierarchyTests.java
  35. 2
      spring-test/src/test/java/org/springframework/test/context/transaction/TransactionalTestExecutionListenerTests.java
  36. 2
      spring-test/src/test/java/org/springframework/test/util/AopTestUtilsTests.java
  37. 20
      spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java
  38. 4
      spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java
  39. 2
      spring-tx/src/test/java/org/springframework/transaction/event/TransactionalEventListenerTests.java
  40. 2
      spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java

6
spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -142,11 +142,11 @@ public class TrickyAspectJPointcutExpressionTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
@Inherited @Inherited
public static @interface Log { @interface Log {
} }
public static interface TestService { public interface TestService {
public String sayHello(); public String sayHello();
} }

2
spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java

@ -48,7 +48,7 @@ public class IntroductionBenchmarkTests {
} }
} }
public static interface Counter { public interface Counter {
int getCount(); int getCount();
} }

2
spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java

@ -307,7 +307,7 @@ public class DelegatingIntroductionInterceptorTests {
} }
private static interface SubTimeStamped extends TimeStamped { private interface SubTimeStamped extends TimeStamped {
} }
} }

10
spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java

@ -278,19 +278,19 @@ public class ServiceLocatorFactoryBeanTests {
} }
public static interface TestServiceLocator { public interface TestServiceLocator {
TestService getTestService(); TestService getTestService();
} }
public static interface TestServiceLocator2 { public interface TestServiceLocator2 {
TestService getTestService(String id) throws CustomServiceLocatorException2; TestService getTestService(String id) throws CustomServiceLocatorException2;
} }
public static interface TestServiceLocator3 { public interface TestServiceLocator3 {
TestService getTestService(); TestService getTestService();
@ -302,13 +302,13 @@ public class ServiceLocatorFactoryBeanTests {
} }
public static interface TestService2Locator { public interface TestService2Locator {
TestService2 getTestService() throws CustomServiceLocatorException3; TestService2 getTestService() throws CustomServiceLocatorException3;
} }
public static interface ServiceLocatorInterfaceWithExtraNonCompliantMethod { public interface ServiceLocatorInterfaceWithExtraNonCompliantMethod {
TestService2 getTestService(); TestService2 getTestService();

12
spring-context/src/test/java/org/springframework/aop/aspectj/ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.java

@ -118,28 +118,28 @@ class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests {
assertThat(counter.atAnnotationMethodAnnotationCounter).isEqualTo(1); assertThat(counter.atAnnotationMethodAnnotationCounter).isEqualTo(1);
} }
public static interface TestInterface { interface TestInterface {
public void doIt(); public void doIt();
} }
public static class TestImpl implements TestInterface { static class TestImpl implements TestInterface {
@Override @Override
public void doIt() { public void doIt() {
} }
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface TestAnnotation { @interface TestAnnotation {
} }
@TestAnnotation @TestAnnotation
public static class AnnotatedClassTestImpl implements TestInterface { static class AnnotatedClassTestImpl implements TestInterface {
@Override @Override
public void doIt() { public void doIt() {
} }
} }
public static class AnnotatedMethodTestImpl implements TestInterface { static class AnnotatedMethodTestImpl implements TestInterface {
@Override @Override
@TestAnnotation @TestAnnotation
public void doIt() { public void doIt() {
@ -147,7 +147,7 @@ class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests {
} }
@Aspect @Aspect
public static class Counter { static class Counter {
int thisAsClassCounter; int thisAsClassCounter;
int thisAsInterfaceCounter; int thisAsInterfaceCounter;
int targetAsClassCounter; int targetAsClassCounter;

2
spring-context/src/test/java/org/springframework/aop/aspectj/generic/GenericParameterMatchingTests.java

@ -79,7 +79,7 @@ class GenericParameterMatchingTests {
} }
static interface GenericInterface<T> { interface GenericInterface<T> {
void save(T bean); void save(T bean);

2
spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java

@ -1770,7 +1770,7 @@ public abstract class AbstractAopProxyTests {
} }
public static interface IOverloads { public interface IOverloads {
void overload(); void overload();

32
spring-context/src/test/java/org/springframework/context/annotation/AnnotationBeanNameGeneratorTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -44,13 +44,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Chris Beams * @author Chris Beams
* @author Sam Brannen * @author Sam Brannen
*/ */
public class AnnotationBeanNameGeneratorTests { class AnnotationBeanNameGeneratorTests {
private AnnotationBeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator(); private AnnotationBeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator();
@Test @Test
public void generateBeanNameWithNamedComponent() { void generateBeanNameWithNamedComponent() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithName.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithName.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -60,7 +60,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameWithDefaultNamedComponent() { void generateBeanNameWithDefaultNamedComponent() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(DefaultNamedComponent.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(DefaultNamedComponent.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -70,7 +70,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameWithNamedComponentWhereTheNameIsBlank() { void generateBeanNameWithNamedComponentWhereTheNameIsBlank() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithBlankName.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithBlankName.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -81,7 +81,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameWithAnonymousComponentYieldsGeneratedBeanName() { void generateBeanNameWithAnonymousComponentYieldsGeneratedBeanName() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(AnonymousComponent.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(AnonymousComponent.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -92,7 +92,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameFromMetaComponentWithStringValue() { void generateBeanNameFromMetaComponentWithStringValue() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromStringMeta.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromStringMeta.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -100,7 +100,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameFromMetaComponentWithNonStringValue() { void generateBeanNameFromMetaComponentWithNonStringValue() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromNonStringMeta.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromNonStringMeta.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry); String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@ -108,7 +108,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameFromComposedControllerAnnotationWithoutName() { void generateBeanNameFromComposedControllerAnnotationWithoutName() {
// SPR-11360 // SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithoutName.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithoutName.class);
@ -118,7 +118,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameFromComposedControllerAnnotationWithBlankName() { void generateBeanNameFromComposedControllerAnnotationWithBlankName() {
// SPR-11360 // SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithBlankName.class); AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithBlankName.class);
@ -128,7 +128,7 @@ public class AnnotationBeanNameGeneratorTests {
} }
@Test @Test
public void generateBeanNameFromComposedControllerAnnotationWithStringValue() { void generateBeanNameFromComposedControllerAnnotationWithStringValue() {
// SPR-11360 // SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry(); BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition( AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(
@ -157,7 +157,7 @@ public class AnnotationBeanNameGeneratorTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Component @Component
public @interface NonStringMetaComponent { @interface NonStringMetaComponent {
long value(); long value();
} }
@ -172,21 +172,21 @@ public class AnnotationBeanNameGeneratorTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Controller @Controller
public static @interface TestRestController { @interface TestRestController {
String value() default ""; String value() default "";
} }
@TestRestController @TestRestController
public static class ComposedControllerAnnotationWithoutName { static class ComposedControllerAnnotationWithoutName {
} }
@TestRestController(" ") @TestRestController(" ")
public static class ComposedControllerAnnotationWithBlankName { static class ComposedControllerAnnotationWithBlankName {
} }
@TestRestController("restController") @TestRestController("restController")
public static class ComposedControllerAnnotationWithStringValue { static class ComposedControllerAnnotationWithStringValue {
} }
} }

13
spring-context/src/test/java/org/springframework/context/annotation/BeanMethodMetadataTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,17 +27,14 @@ import org.springframework.beans.factory.config.BeanDefinition;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* @author Phillip Webb * @author Phillip Webb
* @author Juergen Hoeller * @author Juergen Hoeller
*/ */
public class BeanMethodMetadataTests { class BeanMethodMetadataTests {
@Test @Test
public void providesBeanMethodBeanDefinition() throws Exception { void providesBeanMethodBeanDefinition() throws Exception {
AnnotationConfigApplicationContext context= new AnnotationConfigApplicationContext(Conf.class); AnnotationConfigApplicationContext context= new AnnotationConfigApplicationContext(Conf.class);
BeanDefinition beanDefinition = context.getBeanDefinition("myBean"); BeanDefinition beanDefinition = context.getBeanDefinition("myBean");
assertThat(beanDefinition).as("should provide AnnotatedBeanDefinition").isInstanceOf(AnnotatedBeanDefinition.class); assertThat(beanDefinition).as("should provide AnnotatedBeanDefinition").isInstanceOf(AnnotatedBeanDefinition.class);
@ -53,7 +50,7 @@ public class BeanMethodMetadataTests {
@Bean @Bean
@MyAnnotation("test") @MyAnnotation("test")
public MyBean myBean() { MyBean myBean() {
return new MyBean(); return new MyBean();
} }
} }
@ -64,7 +61,7 @@ public class BeanMethodMetadataTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface MyAnnotation { @interface MyAnnotation {
String value(); String value();
} }

2
spring-context/src/test/java/org/springframework/context/annotation/spr8761/Spr8761Tests.java

@ -53,6 +53,6 @@ class WithNestedAnnotation {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Component @Component
public static @interface MyComponent { @interface MyComponent {
} }
} }

2
spring-context/src/test/java/org/springframework/jmx/export/MBeanExporterTests.java

@ -724,7 +724,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
} }
public static interface PersonMBean { public interface PersonMBean {
String getName(); String getName();
} }

2
spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java

@ -1345,7 +1345,7 @@ class AnnotatedElementUtilsTests {
} }
@Transactional @Transactional
static interface InterfaceWithInheritedAnnotation { interface InterfaceWithInheritedAnnotation {
@Order @Order
void handleFromInterface(); void handleFromInterface();

2
spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java

@ -97,7 +97,7 @@ class AnnotationBackCompatibiltyTests {
} }
static enum TestEnum { enum TestEnum {
ONE, ONE,

13
spring-core/src/test/java/org/springframework/core/annotation/AnnotationEnclosingClassSample.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -33,7 +33,6 @@ public class AnnotationEnclosingClassSample {
@EnclosedThree @EnclosedThree
public static class EnclosedStaticStatic { public static class EnclosedStaticStatic {
} }
} }
@ -43,24 +42,20 @@ public class AnnotationEnclosingClassSample {
@EnclosedThree @EnclosedThree
public class EnclosedInnerInner { public class EnclosedInnerInner {
} }
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface EnclosedOne { @interface EnclosedOne {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface EnclosedTwo { @interface EnclosedTwo {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface EnclosedThree { @interface EnclosedThree {
} }
} }

13
spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -128,7 +128,7 @@ class MergedAnnotationClassLoaderTests {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface TestMetaAnnotation { @interface TestMetaAnnotation {
@AliasFor("d") @AliasFor("d")
String c() default ""; String c() default "";
@ -144,7 +144,7 @@ class MergedAnnotationClassLoaderTests {
@TestMetaAnnotation(classValue = TestReference.class, enumValue = TestEnum.TWO) @TestMetaAnnotation(classValue = TestReference.class, enumValue = TestEnum.TWO)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface TestAnnotation { @interface TestAnnotation {
@AliasFor("b") @AliasFor("b")
String a() default ""; String a() default "";
@ -156,16 +156,13 @@ class MergedAnnotationClassLoaderTests {
@TestAnnotation @TestAnnotation
static class WithTestAnnotation { static class WithTestAnnotation {
} }
static class TestReference { static class TestReference {
} }
static enum TestEnum { enum TestEnum {
ONE, TWO, THREE ONE, TWO, THREE
} }
} }

4
spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java

@ -2175,7 +2175,7 @@ class MergedAnnotationsTests {
} }
} }
static interface NonAnnotatedInterface { interface NonAnnotatedInterface {
} }
@TransactionalComponent @TransactionalComponent
@ -2539,7 +2539,7 @@ class MergedAnnotationsTests {
} }
@Transactional @Transactional
static interface InterfaceWithInheritedAnnotation { interface InterfaceWithInheritedAnnotation {
@Order @Order
void handleFromInterface(); void handleFromInterface();

30
spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -206,79 +206,67 @@ class RepeatableContainersTests {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface NonRepeatable { @interface NonRepeatable {
String value() default ""; String value() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Repeatable(StandardContainer.class) @Repeatable(StandardContainer.class)
static @interface StandardRepeatable { @interface StandardRepeatable {
String value() default ""; String value() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface StandardContainer { @interface StandardContainer {
StandardRepeatable[] value(); StandardRepeatable[] value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ExplicitRepeatable { @interface ExplicitRepeatable {
String value() default ""; String value() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ExplicitContainer { @interface ExplicitContainer {
ExplicitRepeatable[] value(); ExplicitRepeatable[] value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface InvalidNoValue { @interface InvalidNoValue {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface InvalidNotArray { @interface InvalidNotArray {
int value(); int value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface InvalidWrongArrayType { @interface InvalidWrongArrayType {
StandardRepeatable[] value(); StandardRepeatable[] value();
} }
@NonRepeatable("a") @NonRepeatable("a")
static class WithNonRepeatable { static class WithNonRepeatable {
} }
@StandardRepeatable("a") @StandardRepeatable("a")
static class WithSingleStandardRepeatable { static class WithSingleStandardRepeatable {
} }
@StandardRepeatable("a") @StandardRepeatable("a")
@StandardRepeatable("b") @StandardRepeatable("b")
static class WithStandardRepeatables { static class WithStandardRepeatables {
} }
@ExplicitContainer({ @ExplicitRepeatable("a"), @ExplicitRepeatable("b") }) @ExplicitContainer({ @ExplicitRepeatable("a"), @ExplicitRepeatable("b") })
static class WithExplicitRepeatables { static class WithExplicitRepeatables {
} }
} }

40
spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -132,8 +132,7 @@ class TypeMappedAnnotationTests {
private AnnotationTypeMapping getMapping(Annotation annotation, private AnnotationTypeMapping getMapping(Annotation annotation,
Class<? extends Annotation> mappedAnnotationType) { Class<? extends Annotation> mappedAnnotationType) {
AnnotationTypeMappings mappings = AnnotationTypeMappings.forAnnotationType( AnnotationTypeMappings mappings = AnnotationTypeMappings.forAnnotationType(annotation.annotationType());
annotation.annotationType());
for (int i = 0; i < mappings.size(); i++) { for (int i = 0; i < mappings.size(); i++) {
AnnotationTypeMapping candidate = mappings.get(i); AnnotationTypeMapping candidate = mappings.get(i);
if (candidate.getAnnotationType().equals(mappedAnnotationType)) { if (candidate.getAnnotationType().equals(mappedAnnotationType)) {
@ -145,75 +144,66 @@ class TypeMappedAnnotationTests {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ExplicitMirror { @interface ExplicitMirror {
@AliasFor("b") @AliasFor("b")
String a() default ""; String a() default "";
@AliasFor("a") @AliasFor("a")
String b() default ""; String b() default "";
} }
@ExplicitMirror(a = "test") @ExplicitMirror(a = "test")
static class WithExplicitMirrorA { static class WithExplicitMirrorA {
} }
@ExplicitMirror(b = "test") @ExplicitMirror(b = "test")
static class WithExplicitMirrorB { static class WithExplicitMirrorB {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@ExplicitAliasMetaAnnotationTarget(nonAliased = "nonAliased") @ExplicitAliasMetaAnnotationTarget(nonAliased = "nonAliased")
static @interface ExplicitAliasToMetaAnnotation { @interface ExplicitAliasToMetaAnnotation {
@AliasFor(annotation = ExplicitAliasMetaAnnotationTarget.class) @AliasFor(annotation = ExplicitAliasMetaAnnotationTarget.class)
String aliased() default ""; String aliased() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ExplicitAliasMetaAnnotationTarget { @interface ExplicitAliasMetaAnnotationTarget {
String aliased() default ""; String aliased() default "";
String nonAliased() default ""; String nonAliased() default "";
} }
@ExplicitAliasToMetaAnnotation(aliased = "aliased") @ExplicitAliasToMetaAnnotation(aliased = "aliased")
private static class WithExplicitAliasToMetaAnnotation { private static class WithExplicitAliasToMetaAnnotation {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@ConventionAliasMetaAnnotationTarget @ConventionAliasMetaAnnotationTarget
static @interface ConventionAliasToMetaAnnotation { @interface ConventionAliasToMetaAnnotation {
String value() default ""; String value() default "";
String convention() default ""; String convention() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ConventionAliasMetaAnnotationTarget { @interface ConventionAliasMetaAnnotationTarget {
String value() default ""; String value() default "";
String convention() default ""; String convention() default "";
} }
@ConventionAliasToMetaAnnotation(value = "value", convention = "convention") @ConventionAliasToMetaAnnotation(value = "value", convention = "convention")
private static class WithConventionAliasToMetaAnnotation { private static class WithConventionAliasToMetaAnnotation {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ArrayTypes { @interface ArrayTypes {
String[] stringValue(); String[] stringValue();
@ -238,32 +228,30 @@ class TypeMappedAnnotationTests {
ExplicitMirror[] annotationValue(); ExplicitMirror[] annotationValue();
ExampleEnum[] enumValue(); ExampleEnum[] enumValue();
} }
enum ExampleEnum {ONE,TWO,THREE} enum ExampleEnum {
ONE, TWO, THREE
}
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface NestedContainer { @interface NestedContainer {
Nested value(); Nested value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface Nested { @interface Nested {
String value() default ""; String value() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface ClassAttributes { @interface ClassAttributes {
Class<?> classValue(); Class<?> classValue();
Class<?>[] classArrayValue(); Class<?>[] classArrayValue();
} }
} }

2
spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java

@ -748,7 +748,7 @@ class GenericConversionServiceTests {
} }
} }
private static interface MyEnumBaseInterface { private interface MyEnumBaseInterface {
String getBaseCode(); String getBaseCode();
} }

4
spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java

@ -307,10 +307,10 @@ public abstract class AbstractAnnotationMetadataTests {
public static class TestClass { public static class TestClass {
} }
public static interface TestInterface { public interface TestInterface {
} }
public static interface TestSubInterface extends TestInterface { public interface TestSubInterface extends TestInterface {
} }
public @interface TestAnnotation { public @interface TestAnnotation {

26
spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -181,9 +181,8 @@ public abstract class AbstractMethodMetadataTests {
@Test @Test
public void getAllAnnotationAttributesReturnsAllAttributes() { public void getAllAnnotationAttributesReturnsAllAttributes() {
MultiValueMap<String, Object> attributes = getTagged( MultiValueMap<String, Object> attributes = getTagged(WithMetaAnnotationAttributes.class)
WithMetaAnnotationAttributes.class).getAllAnnotationAttributes( .getAllAnnotationAttributes(AnnotationAttributes.class.getName());
AnnotationAttributes.class.getName());
assertThat(attributes).containsOnlyKeys("name", "size"); assertThat(attributes).containsOnlyKeys("name", "size");
assertThat(attributes.get("name")).containsExactlyInAnyOrder("m1", "m2"); assertThat(attributes.get("name")).containsExactlyInAnyOrder("m1", "m2");
assertThat(attributes.get("size")).containsExactlyInAnyOrder(1, 2); assertThat(attributes.get("size")).containsExactlyInAnyOrder(1, 2);
@ -206,8 +205,7 @@ public abstract class AbstractMethodMetadataTests {
protected abstract AnnotationMetadata get(Class<?> source); protected abstract AnnotationMetadata get(Class<?> source);
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface Tag { @interface Tag {
} }
public static class WithMethod { public static class WithMethod {
@ -288,14 +286,13 @@ public abstract class AbstractMethodMetadataTests {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface DirectAnnotation { // Must be public. See AnnotationAttributesReadingVisitor.recursivelyCollectMetaAnnotations().
public @interface DirectAnnotation {
} }
@DirectAnnotation @DirectAnnotation
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface MetaAnnotation { @interface MetaAnnotation {
} }
public static abstract class WithAnnotationAttributes { public static abstract class WithAnnotationAttributes {
@ -317,18 +314,17 @@ public abstract class AbstractMethodMetadataTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@AnnotationAttributes(name = "m1", size = 1) @AnnotationAttributes(name = "m1", size = 1)
public static @interface MetaAnnotationAttributes1 { @interface MetaAnnotationAttributes1 {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@AnnotationAttributes(name = "m2", size = 2) @AnnotationAttributes(name = "m2", size = 2)
public static @interface MetaAnnotationAttributes2 { @interface MetaAnnotationAttributes2 {
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public static @interface AnnotationAttributes { // Must be public. See AnnotationAttributesReadingVisitor.recursivelyCollectMetaAnnotations().
public @interface AnnotationAttributes {
String name(); String name();

2
spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java

@ -407,7 +407,7 @@ class AnnotationMetadataTests {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
public static enum SomeEnum { public enum SomeEnum {
LABEL1, LABEL2, DEFAULT LABEL1, LABEL2, DEFAULT
} }

4
spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java

@ -69,11 +69,11 @@ class InstanceComparatorTests {
assertThat(comparator.compare(c4, null)).isEqualTo(0); assertThat(comparator.compare(c4, null)).isEqualTo(0);
} }
private static interface I1 { private interface I1 {
} }
private static interface I2 { private interface I2 {
} }

2
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTests.java

@ -109,7 +109,7 @@ public class DelegatingDataSourceTests {
assertThat(dataSource.isWrapperFor(ExampleWrapper.class)).isTrue(); assertThat(dataSource.isWrapperFor(ExampleWrapper.class)).isTrue();
} }
public static interface ExampleWrapper { public interface ExampleWrapper {
} }
private static class DelegatingDataSourceWithWrapper extends DelegatingDataSource private static class DelegatingDataSourceWithWrapper extends DelegatingDataSource

10
spring-test/src/test/java/org/springframework/test/annotation/ProfileValueUtilsTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -239,12 +239,12 @@ class ProfileValueUtilsTests {
@IfProfileValue(name = NAME, value = VALUE) @IfProfileValue(name = NAME, value = VALUE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaEnabled { private @interface MetaEnabled {
} }
@IfProfileValue(name = NAME, value = VALUE + "X") @IfProfileValue(name = NAME, value = VALUE + "X")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaDisabled { private @interface MetaDisabled {
} }
@MetaEnabled @MetaEnabled
@ -298,13 +298,13 @@ class ProfileValueUtilsTests {
@ProfileValueSourceConfiguration(HardCodedProfileValueSource.class) @ProfileValueSourceConfiguration(HardCodedProfileValueSource.class)
@IfProfileValue(name = NAME, value = "42") @IfProfileValue(name = NAME, value = "42")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaEnabledWithCustomProfileValueSource { private @interface MetaEnabledWithCustomProfileValueSource {
} }
@ProfileValueSourceConfiguration(HardCodedProfileValueSource.class) @ProfileValueSourceConfiguration(HardCodedProfileValueSource.class)
@IfProfileValue(name = NAME, value = "13") @IfProfileValue(name = NAME, value = "13")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaDisabledWithCustomProfileValueSource { private @interface MetaDisabledWithCustomProfileValueSource {
} }
@MetaEnabledWithCustomProfileValueSource @MetaEnabledWithCustomProfileValueSource

4
spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -144,7 +144,7 @@ public class RepeatedSpringRunnerTests {
@Repeat(5) @Repeat(5)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface RepeatedFiveTimes { private @interface RepeatedFiveTimes {
} }
public static final class RepeatedFiveTimesViaMetaAnnotationRepeatedTestCase extends AbstractRepeatedTestCase { public static final class RepeatedFiveTimesViaMetaAnnotationRepeatedTestCase extends AbstractRepeatedTestCase {

4
spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerTests.java

@ -87,12 +87,12 @@ public class SpringJUnit4ClassRunnerTests {
@Timed(millis = 10) @Timed(millis = 10)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaTimed { private @interface MetaTimed {
} }
@Timed(millis = 1000) @Timed(millis = 1000)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaTimedWithOverride { private @interface MetaTimedWithOverride {
long millis() default 1000; long millis() default 1000;
} }

4
spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java

@ -112,12 +112,12 @@ public class TimedSpringRunnerTests {
@Timed(millis = 10) @Timed(millis = 10)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaTimed { private @interface MetaTimed {
} }
@Timed(millis = 1000) @Timed(millis = 1000)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaTimedWithOverride { private @interface MetaTimedWithOverride {
long millis() default 1000; long millis() default 1000;
} }

4
spring-test/src/test/java/org/springframework/test/context/junit4/rules/RepeatedSpringRuleTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -124,7 +124,7 @@ public class RepeatedSpringRuleTests extends RepeatedSpringRunnerTests {
@Repeat(5) @Repeat(5)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface RepeatedFiveTimes { private @interface RepeatedFiveTimes {
} }
public static final class RepeatedFiveTimesViaMetaAnnotationRepeatedTestCase extends AbstractRepeatedTestCase { public static final class RepeatedFiveTimesViaMetaAnnotationRepeatedTestCase extends AbstractRepeatedTestCase {

6
spring-test/src/test/java/org/springframework/test/context/support/AbstractContextConfigurationUtilsTests.java

@ -149,14 +149,14 @@ abstract class AbstractContextConfigurationUtilsTests {
@ActiveProfiles(profiles = "foo") @ActiveProfiles(profiles = "foo")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public static @interface MetaLocationsFooConfig { public @interface MetaLocationsFooConfig {
} }
@ContextConfiguration @ContextConfiguration
@ActiveProfiles @ActiveProfiles
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public static @interface MetaLocationsFooConfigWithOverrides { public @interface MetaLocationsFooConfigWithOverrides {
String[] locations() default "/foo.xml"; String[] locations() default "/foo.xml";
@ -167,7 +167,7 @@ abstract class AbstractContextConfigurationUtilsTests {
@ActiveProfiles(profiles = "bar") @ActiveProfiles(profiles = "bar")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public static @interface MetaLocationsBarConfig { public @interface MetaLocationsBarConfig {
} }
@MetaLocationsFooConfig @MetaLocationsFooConfig

6
spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -264,13 +264,13 @@ class ActiveProfilesUtilsTests extends AbstractContextConfigurationUtilsTests {
@ActiveProfiles(profiles = { "dog", "cat" }, inheritProfiles = false) @ActiveProfiles(profiles = { "dog", "cat" }, inheritProfiles = false)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
private static @interface MetaAnimalsConfig { private @interface MetaAnimalsConfig {
} }
@ActiveProfiles(resolver = TestClassVerifyingActiveProfilesResolver.class) @ActiveProfiles(resolver = TestClassVerifyingActiveProfilesResolver.class)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
private static @interface MetaResolverConfig { private @interface MetaResolverConfig {
} }
@MetaAnimalsConfig @MetaAnimalsConfig

4
spring-test/src/test/java/org/springframework/test/context/support/AnnotationConfigContextLoaderUtilsTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -79,7 +79,7 @@ class AnnotationConfigContextLoaderUtilsTests {
@Configuration @Configuration
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
private static @interface MetaConfig { private @interface MetaConfig {
} }
private static class MetaAnnotatedConfigTestCase { private static class MetaAnnotatedConfigTestCase {

2
spring-test/src/test/java/org/springframework/test/context/support/BootstrapTestUtilsMergedConfigTests.java

@ -464,7 +464,7 @@ class BootstrapTestUtilsMergedConfigTests extends AbstractContextConfigurationUt
@ContextConfiguration @ContextConfiguration
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public static @interface SpringAppConfig { public @interface SpringAppConfig {
Class<?>[] classes() default {}; Class<?>[] classes() default {};
} }

10
spring-test/src/test/java/org/springframework/test/context/support/ContextLoaderUtilsContextHierarchyTests.java

@ -365,7 +365,7 @@ class ContextLoaderUtilsContextHierarchyTests extends AbstractContextConfigurati
@ContextConfiguration("foo.xml") @ContextConfiguration("foo.xml")
@ContextHierarchy(@ContextConfiguration("bar.xml")) @ContextHierarchy(@ContextConfiguration("bar.xml"))
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface ContextConfigurationAndContextHierarchyOnSingleMeta { private @interface ContextConfigurationAndContextHierarchyOnSingleMeta {
} }
@ContextConfigurationAndContextHierarchyOnSingleMeta @ContextConfigurationAndContextHierarchyOnSingleMeta
@ -542,17 +542,17 @@ class ContextLoaderUtilsContextHierarchyTests extends AbstractContextConfigurati
@ContextHierarchy(@ContextConfiguration("A.xml")) @ContextHierarchy(@ContextConfiguration("A.xml"))
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface ContextHierarchyA { private @interface ContextHierarchyA {
} }
@ContextHierarchy(@ContextConfiguration({ "B-one.xml", "B-two.xml" })) @ContextHierarchy(@ContextConfiguration({ "B-one.xml", "B-two.xml" }))
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface ContextHierarchyB { private @interface ContextHierarchyB {
} }
@ContextHierarchy(@ContextConfiguration("C.xml")) @ContextHierarchy(@ContextConfiguration("C.xml"))
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface ContextHierarchyC { private @interface ContextHierarchyC {
} }
@ContextHierarchyA @ContextHierarchyA
@ -577,7 +577,7 @@ class ContextLoaderUtilsContextHierarchyTests extends AbstractContextConfigurati
@ContextConfiguration @ContextConfiguration
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface ContextConfigWithOverrides { private @interface ContextConfigWithOverrides {
String[] locations() default "A.xml"; String[] locations() default "A.xml";
} }

2
spring-test/src/test/java/org/springframework/test/context/transaction/TransactionalTestExecutionListenerTests.java

@ -285,7 +285,7 @@ class TransactionalTestExecutionListenerTests {
@Transactional @Transactional
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
private static @interface MetaTxWithOverride { private @interface MetaTxWithOverride {
@AliasFor(annotation = Transactional.class, attribute = "value") @AliasFor(annotation = Transactional.class, attribute = "value")
String transactionManager() default ""; String transactionManager() default "";

2
spring-test/src/test/java/org/springframework/test/util/AopTestUtilsTests.java

@ -142,7 +142,7 @@ class AopTestUtilsTests {
} }
static interface Foo { interface Foo {
} }
static class FooImpl implements Foo { static class FooImpl implements Foo {

20
spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java

@ -480,7 +480,7 @@ class MetaAnnotationUtilsTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
static @interface Meta1 { @interface Meta1 {
} }
@Component(value = "meta2") @Component(value = "meta2")
@ -488,7 +488,7 @@ class MetaAnnotationUtilsTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
static @interface Meta2 { @interface Meta2 {
} }
@Meta2 @Meta2
@ -530,7 +530,7 @@ class MetaAnnotationUtilsTests {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Documented @Documented
static @interface MetaConfig { @interface MetaConfig {
static class DevConfig { static class DevConfig {
} }
@ -555,7 +555,7 @@ class MetaAnnotationUtilsTests {
} }
@Meta1 @Meta1
static interface InterfaceWithMetaAnnotation { interface InterfaceWithMetaAnnotation {
} }
static class ClassWithMetaAnnotatedInterface implements InterfaceWithMetaAnnotation { static class ClassWithMetaAnnotatedInterface implements InterfaceWithMetaAnnotation {
@ -592,26 +592,26 @@ class MetaAnnotationUtilsTests {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@Transactional @Transactional
static interface InheritedAnnotationInterface { interface InheritedAnnotationInterface {
} }
static interface SubInheritedAnnotationInterface extends InheritedAnnotationInterface { interface SubInheritedAnnotationInterface extends InheritedAnnotationInterface {
} }
static interface SubSubInheritedAnnotationInterface extends SubInheritedAnnotationInterface { interface SubSubInheritedAnnotationInterface extends SubInheritedAnnotationInterface {
} }
@Order @Order
static interface NonInheritedAnnotationInterface { interface NonInheritedAnnotationInterface {
} }
static interface SubNonInheritedAnnotationInterface extends NonInheritedAnnotationInterface { interface SubNonInheritedAnnotationInterface extends NonInheritedAnnotationInterface {
} }
static class NonAnnotatedClass { static class NonAnnotatedClass {
} }
static interface NonAnnotatedInterface { interface NonAnnotatedInterface {
} }
@Transactional @Transactional

4
spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java

@ -125,7 +125,7 @@ class OverriddenMetaAnnotationAttributesTests {
@ContextConfiguration("foo.xml") @ContextConfiguration("foo.xml")
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface MetaValueConfig { @interface MetaValueConfig {
String[] value() default {}; String[] value() default {};
} }
@ -140,7 +140,7 @@ class OverriddenMetaAnnotationAttributesTests {
@ContextConfiguration(locations = "foo.xml", inheritLocations = false) @ContextConfiguration(locations = "foo.xml", inheritLocations = false)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
static @interface MetaLocationsConfig { @interface MetaLocationsConfig {
String[] locations() default {}; String[] locations() default {};

2
spring-tx/src/test/java/org/springframework/transaction/event/TransactionalEventListenerTests.java

@ -512,7 +512,7 @@ public class TransactionalEventListenerTests {
@Transactional @Transactional
@Component @Component
static interface TransactionalComponentTestListenerInterface { interface TransactionalComponentTestListenerInterface {
// Cannot use #data in condition due to dynamic proxy. // Cannot use #data in condition due to dynamic proxy.
@TransactionalEventListener(condition = "!'SKIP'.equals(#p0)") @TransactionalEventListener(condition = "!'SKIP'.equals(#p0)")

2
spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java

@ -382,7 +382,7 @@ class ContextLoaderTests {
} }
private static interface UnknownApplicationContext extends ConfigurableApplicationContext { private interface UnknownApplicationContext extends ConfigurableApplicationContext {
void unheardOf(); void unheardOf();
} }

Loading…
Cancel
Save