diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java index 8c4651bc37..eae51ec251 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java @@ -16,8 +16,6 @@ package org.springframework.context.annotation; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import java.lang.annotation.Annotation; import org.springframework.core.GenericTypeResolver; @@ -25,6 +23,8 @@ import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.Assert; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * Convenient base class for {@link ImportSelector} implementations that select imports * based on an {@link AdviceMode} value from an annotation (such as the {@code @Enable*} diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java index d184aa9b00..72592b9cf4 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java @@ -16,8 +16,6 @@ package org.springframework.context.annotation; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import java.util.LinkedHashSet; import java.util.Set; @@ -32,6 +30,8 @@ import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.ClassUtils; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * Utility class that allows for convenient registration of common * {@link org.springframework.beans.factory.config.BeanPostProcessor} and diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java index 0d655830b3..493745bd82 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java @@ -16,8 +16,6 @@ package org.springframework.context.annotation; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import java.lang.annotation.Annotation; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; @@ -25,6 +23,8 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.util.Assert; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * A {@link ScopeMetadataResolver} implementation that by default checks for * the presence of Spring's {@link Scope} annotation on the bean class. diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/AspectJAutoProxyRegistrar.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/AspectJAutoProxyRegistrar.java index b41fa7da25..aedbbbe28e 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/AspectJAutoProxyRegistrar.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/AspectJAutoProxyRegistrar.java @@ -16,13 +16,13 @@ package org.springframework.context.annotation; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import org.springframework.aop.config.AopConfigUtils; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotationMetadata; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * Registers an {@link org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator * AnnotationAwareAspectJAutoProxyCreator} against the current {@link BeanDefinitionRegistry} diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java index 04a249566d..2afeba197e 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java @@ -30,9 +30,9 @@ import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.annotation.AnnotationAttributes; -import org.springframework.core.env.StandardEnvironment; import org.springframework.core.env.Environment; import org.springframework.core.env.EnvironmentCapable; +import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java index a6533c9111..f27124e8ac 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java @@ -16,8 +16,6 @@ package org.springframework.context.annotation; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import java.io.IOException; import java.lang.annotation.Annotation; import java.util.ArrayList; @@ -51,6 +49,8 @@ import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.core.type.filter.AssignableTypeFilter; import org.springframework.util.StringUtils; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * Parses a {@link Configuration} class definition, populating a collection of * {@link ConfigurationClass} objects (parsing a single Configuration class may result in diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java index 3f74a3d779..d81821b703 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java @@ -16,8 +16,6 @@ package org.springframework.context.annotation; -import static org.springframework.context.weaving.AspectJWeavingEnabler.ASPECTJ_AOP_XML_RESOURCE; - import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; @@ -30,6 +28,8 @@ import org.springframework.core.type.AnnotationMetadata; import org.springframework.instrument.classloading.LoadTimeWeaver; import org.springframework.util.Assert; +import static org.springframework.context.weaving.AspectJWeavingEnabler.*; + /** * {@code @Configuration} class that registers a {@link LoadTimeWeaver} bean. * diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java index 180176452b..822923d9c1 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/ImportAwareTests.java @@ -16,11 +16,6 @@ package org.springframework.context.annotation; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; -import static org.springframework.context.annotation.MetadataUtils.attributesFor; - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -35,6 +30,10 @@ import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotationMetadata; import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; +import static org.springframework.context.annotation.MetadataUtils.*; + /** * Tests that an ImportAware @Configuration classes gets injected with the * annotation metadata of the @Configuration class that imported it.