@ -183,7 +183,7 @@ class ConfigurationClassParser {
@@ -183,7 +183,7 @@ class ConfigurationClassParser {
protected void processConfigurationClass ( ConfigurationClass configClass ) throws IOException {
if ( shouldSkip ( asSourceClass ( configClass ) , ConfigurationPhase . PARSE_CONFIGURATION ) ) {
if ( this . conditionEvaluator . shouldSkip ( configClass . getMetadata ( ) , ConfigurationPhase . PARSE_CONFIGURATION ) ) {
return ;
}
@ -201,7 +201,6 @@ class ConfigurationClassParser {
@@ -201,7 +201,6 @@ class ConfigurationClassParser {
// Recursively process the configuration class and its superclass hierarchy.
SourceClass sourceClass = asSourceClass ( configClass ) ;
do {
configClass . addMetadataHierarchy ( sourceClass . getMetadata ( ) ) ;
sourceClass = doProcessConfigurationClass ( configClass , sourceClass ) ;
}
while ( sourceClass ! = null ) ;
@ -231,7 +230,7 @@ class ConfigurationClassParser {
@@ -231,7 +230,7 @@ class ConfigurationClassParser {
AnnotationAttributes componentScan = AnnotationConfigUtils . attributesFor ( sourceClass . getMetadata ( ) , ComponentScan . class ) ;
if ( componentScan ! = null ) {
// the config class is annotated with @ComponentScan -> perform the scan immediately
if ( ! shouldSkip ( sourceClass , ConfigurationPhase . REGISTER_BEAN ) ) {
if ( ! conditionEvaluator . shouldSkip ( sourceClass . getMetadata ( ) , ConfigurationPhase . REGISTER_BEAN ) ) {
Set < BeanDefinitionHolder > scannedBeanDefinitions =
this . componentScanParser . parse ( componentScan , sourceClass . getMetadata ( ) . getClassName ( ) ) ;
@ -270,7 +269,12 @@ class ConfigurationClassParser {
@@ -270,7 +269,12 @@ class ConfigurationClassParser {
if ( ! this . knownSuperclasses . containsKey ( superclass ) ) {
this . knownSuperclasses . put ( superclass , configClass ) ;
// superclass found, return its annotation metadata and recurse
return sourceClass . getSuperClass ( ) ;
try {
return sourceClass . getSuperClass ( ) ;
}
catch ( ClassNotFoundException ex ) {
throw new IllegalStateException ( ex ) ;
}
}
}
@ -278,17 +282,6 @@ class ConfigurationClassParser {
@@ -278,17 +282,6 @@ class ConfigurationClassParser {
return null ;
}
private boolean shouldSkip ( SourceClass sourceClass , ConfigurationPhase phase )
throws IOException {
while ( sourceClass ! = null ) {
if ( conditionEvaluator . shouldSkip ( sourceClass . getMetadata ( ) , phase ) ) {
return true ;
}
sourceClass = sourceClass . getSuperClass ( ) ;
}
return false ;
}
/ * *
* Register member ( nested ) classes that happen to be configuration classes themselves .
* @param sourceClass the source class to process
@ -699,19 +692,11 @@ class ConfigurationClassParser {
@@ -699,19 +692,11 @@ class ConfigurationClassParser {
return members ;
}
public SourceClass getSuperClass ( ) throws IOException {
if ( ! getMetadata ( ) . hasSuperClass ( ) ) {
return null ;
}
try {
if ( this . source instanceof Class < ? > ) {
return asSourceClass ( ( ( Class < ? > ) this . source ) . getSuperclass ( ) ) ;
}
return asSourceClass ( ( ( MetadataReader ) this . source ) . getClassMetadata ( ) . getSuperClassName ( ) ) ;
}
catch ( ClassNotFoundException ex ) {
throw new IllegalStateException ( ex ) ;
public SourceClass getSuperClass ( ) throws IOException , ClassNotFoundException {
if ( this . source instanceof Class < ? > ) {
return asSourceClass ( ( ( Class < ? > ) this . source ) . getSuperclass ( ) ) ;
}
return asSourceClass ( ( ( MetadataReader ) this . source ) . getClassMetadata ( ) . getSuperClassName ( ) ) ;
}
public Set < SourceClass > getAnnotations ( ) throws IOException , ClassNotFoundException {