Expand configuration class eager filtering to imports
Previously, only root auto-configuration classes could be excluded eagerly via an AutoConfigurationImportFilter. Any configuration class loaded as a result of processing a particular auto-configuration were parsed and checked as usual. This commit makes use of the `getExclusionFilter` callback to expand this filter to all candidates that are considered. The annotation processor has also be expanded to generate metadata for non-root configuration classes. Closes gh-12157
This commit is contained in:
@@ -40,7 +40,6 @@ import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.AnnotationMirror;
|
||||
import javax.lang.model.element.AnnotationValue;
|
||||
import javax.lang.model.element.Element;
|
||||
import javax.lang.model.element.ElementKind;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.lang.model.type.DeclaredType;
|
||||
import javax.tools.FileObject;
|
||||
@@ -127,10 +126,7 @@ public class AutoConfigureAnnotationProcessor extends AbstractProcessor {
|
||||
TypeElement annotationType = this.processingEnv.getElementUtils().getTypeElement(annotationName);
|
||||
if (annotationType != null) {
|
||||
for (Element element : roundEnv.getElementsAnnotatedWith(annotationType)) {
|
||||
Element enclosingElement = element.getEnclosingElement();
|
||||
if (enclosingElement != null && enclosingElement.getKind() == ElementKind.PACKAGE) {
|
||||
processElement(element, propertyKey, annotationName);
|
||||
}
|
||||
processElement(element, propertyKey, annotationName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user