Only load enclosing class for TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Prior to this commit, the enclosing class was always eagerly loaded even if the annotation search strategy was not explicitly TYPE_HIERARCHY_AND_ENCLOSING_CLASSES. See gh-24136
This commit is contained in:
@@ -230,12 +230,14 @@ abstract class AnnotationsScanner {
|
||||
return superclassResult;
|
||||
}
|
||||
}
|
||||
Class<?> enclosingClass = source.getEnclosingClass();
|
||||
if (includeEnclosing && enclosingClass != null) {
|
||||
R enclosingResult = processClassHierarchy(context, aggregateIndex,
|
||||
if (includeEnclosing) {
|
||||
Class<?> enclosingClass = source.getEnclosingClass();
|
||||
if (enclosingClass != null) {
|
||||
R enclosingResult = processClassHierarchy(context, aggregateIndex,
|
||||
enclosingClass, processor, classFilter, includeInterfaces, true);
|
||||
if (enclosingResult != null) {
|
||||
return enclosingResult;
|
||||
if (enclosingResult != null) {
|
||||
return enclosingResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user