polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4177 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
b953ffc0be
commit
772aee728b
|
|
@ -126,7 +126,7 @@ public abstract class ContextLoaderUtils {
|
|||
}
|
||||
|
||||
try {
|
||||
ContextConfiguration contextConfiguration = clazz.getAnnotation(ContextConfiguration.class);
|
||||
ContextConfiguration contextConfiguration = clazz.getAnnotation(annotationType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Using default ContextLoader class [" + defaultContextLoaderClassName
|
||||
+ "] for @ContextConfiguration [" + contextConfiguration + "] and class [" + clazz + "]");
|
||||
|
|
@ -165,17 +165,17 @@ public abstract class ContextLoaderUtils {
|
|||
Assert.notNull(contextLoader, "ContextLoader must not be null");
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
|
||||
boolean processConfigurationClasses = (contextLoader instanceof ResourceTypeAwareContextLoader)
|
||||
&& ((ResourceTypeAwareContextLoader) contextLoader).supportsClassResources();
|
||||
LocationsResolver locationsResolver = processConfigurationClasses ? classNameLocationsResolver
|
||||
: resourcePathLocationsResolver;
|
||||
|
||||
Class<ContextConfiguration> annotationType = ContextConfiguration.class;
|
||||
Class<?> declaringClass = AnnotationUtils.findAnnotationDeclaringClass(annotationType, clazz);
|
||||
Assert.notNull(declaringClass, String.format(
|
||||
"Could not find an 'annotation declaring class' for annotation type [%s] and class [%s]", annotationType,
|
||||
clazz));
|
||||
|
||||
boolean processConfigurationClasses = (contextLoader instanceof ResourceTypeAwareContextLoader)
|
||||
&& ((ResourceTypeAwareContextLoader) contextLoader).supportsClassResources();
|
||||
LocationsResolver locationsResolver = processConfigurationClasses ? classNameLocationsResolver
|
||||
: resourcePathLocationsResolver;
|
||||
|
||||
List<String> locationsList = new ArrayList<String>();
|
||||
|
||||
while (declaringClass != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue