Merge branch '1.1.x'

This commit is contained in:
Andy Wilkinson 2014-09-16 17:20:35 +01:00
commit e8ce93715a
1 changed files with 6 additions and 0 deletions

View File

@ -31,12 +31,14 @@ import org.springframework.core.annotation.Order;
import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.Assert;
/** /**
* {@link DeferredImportSelector} to handle {@link EnableAutoConfiguration * {@link DeferredImportSelector} to handle {@link EnableAutoConfiguration
* auto-configuration}. * auto-configuration}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson
* @see EnableAutoConfiguration * @see EnableAutoConfiguration
*/ */
@Order(Ordered.LOWEST_PRECEDENCE) @Order(Ordered.LOWEST_PRECEDENCE)
@ -54,6 +56,10 @@ class EnableAutoConfigurationImportSelector implements DeferredImportSelector,
.getAnnotationAttributes(EnableAutoConfiguration.class.getName(), .getAnnotationAttributes(EnableAutoConfiguration.class.getName(),
true)); true));
Assert.notNull(attributes, "No auto-configuration attributes found. Is "
+ metadata.getClassName()
+ " annotated with @EnableAutoConfiguration?");
// Find all possible auto configuration classes, filtering duplicates // Find all possible auto configuration classes, filtering duplicates
List<String> factories = new ArrayList<String>(new LinkedHashSet<String>( List<String> factories = new ArrayList<String>(new LinkedHashSet<String>(
SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class, SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class,