This commit is contained in:
Phillip Webb
2015-03-30 10:37:02 -07:00
parent d07e18143d
commit fbf34e261e
7 changed files with 63 additions and 38 deletions

View File

@@ -73,8 +73,7 @@ class EnableAutoConfigurationImportSelector implements DeferredImportSelector,
this.beanClassLoader)));
// Remove those specifically disabled
List<String> excluded = new ArrayList<String>(Arrays.asList(attributes
.getStringArray("exclude")));
List<String> excluded = Arrays.asList(attributes.getStringArray("exclude"));
factories.removeAll(excluded);
ConditionEvaluationReport.get(this.beanFactory).recordExclusions(excluded);

View File

@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.condition;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
@@ -87,7 +88,7 @@ public class ConditionEvaluationReport {
*/
public void recordExclusions(List<String> exclusions) {
Assert.notNull(exclusions, "exclusions must not be null");
this.exclusions = exclusions;
this.exclusions = new ArrayList<String>(exclusions);
}
/**
@@ -106,14 +107,6 @@ public class ConditionEvaluationReport {
return Collections.unmodifiableMap(this.outcomes);
}
/**
* Returns the name of the classes that have been excluded from condition evaluation.
* @return the names of the excluded classes
*/
public List<String> getExclusions() {
return Collections.unmodifiableList(this.exclusions);
}
private void addNoMatchOutcomeToAncestors(String source) {
String prefix = source + "$";
for (Entry<String, ConditionAndOutcomes> entry : this.outcomes.entrySet()) {
@@ -125,6 +118,14 @@ public class ConditionEvaluationReport {
}
}
/**
* Returns the name of the classes that have been excluded from condition evaluation.
* @return the names of the excluded classes
*/
public List<String> getExclusions() {
return Collections.unmodifiableList(this.exclusions);
}
/**
* The parent report (from a parent BeanFactory if there is one).
* @return the parent report (or null if there isn't one)