@@ -103,26 +103,25 @@ private static <C, R> R processClass(C context, Class<?> source, SearchStrategy
103
103
104
104
return switch (searchStrategy ) {
105
105
case DIRECT -> processElement (context , source , processor );
106
- case INHERITED_ANNOTATIONS -> processClassInheritedAnnotations (context , source , searchStrategy , processor );
106
+ case INHERITED_ANNOTATIONS -> processClassInheritedAnnotations (context , source , processor );
107
107
case SUPERCLASS -> processClassHierarchy (context , source , processor , false , Search .never );
108
108
case TYPE_HIERARCHY -> processClassHierarchy (context , source , processor , true , searchEnclosingClass );
109
109
};
110
110
}
111
111
112
112
@ Nullable
113
113
private static <C , R > R processClassInheritedAnnotations (C context , Class <?> source ,
114
- SearchStrategy searchStrategy , AnnotationsProcessor <C , R > processor ) {
114
+ AnnotationsProcessor <C , R > processor ) {
115
115
116
116
try {
117
- if (isWithoutHierarchy (source , searchStrategy , Search .never )) {
117
+ if (isWithoutHierarchy (source , Search .never )) {
118
118
return processElement (context , source , processor );
119
119
}
120
120
Annotation [] relevant = null ;
121
121
int remaining = Integer .MAX_VALUE ;
122
122
int aggregateIndex = 0 ;
123
123
Class <?> root = source ;
124
- while (source != null && source != Object .class && remaining > 0 &&
125
- !hasPlainJavaAnnotationsOnly (source )) {
124
+ while (source != null && source != Object .class && remaining > 0 && !hasPlainJavaAnnotationsOnly (source )) {
126
125
R result = processor .doWithAggregate (context , aggregateIndex );
127
126
if (result != null ) {
128
127
return result ;
@@ -483,7 +482,7 @@ static boolean isKnownEmpty(AnnotatedElement source, SearchStrategy searchStrate
483
482
if (hasPlainJavaAnnotationsOnly (source )) {
484
483
return true ;
485
484
}
486
- if (searchStrategy == SearchStrategy .DIRECT || isWithoutHierarchy (source , searchStrategy , searchEnclosingClass )) {
485
+ if (searchStrategy == SearchStrategy .DIRECT || isWithoutHierarchy (source , searchEnclosingClass )) {
487
486
if (source instanceof Method method && method .isBridge ()) {
488
487
return false ;
489
488
}
@@ -508,9 +507,7 @@ static boolean hasPlainJavaAnnotationsOnly(Class<?> type) {
508
507
return (type .getName ().startsWith ("java." ) || type == Ordered .class );
509
508
}
510
509
511
- private static boolean isWithoutHierarchy (AnnotatedElement source , SearchStrategy searchStrategy ,
512
- Predicate <Class <?>> searchEnclosingClass ) {
513
-
510
+ private static boolean isWithoutHierarchy (AnnotatedElement source , Predicate <Class <?>> searchEnclosingClass ) {
514
511
if (source == Object .class ) {
515
512
return true ;
516
513
}
@@ -522,7 +519,7 @@ private static boolean isWithoutHierarchy(AnnotatedElement source, SearchStrateg
522
519
}
523
520
if (source instanceof Method sourceMethod ) {
524
521
return (Modifier .isPrivate (sourceMethod .getModifiers ()) ||
525
- isWithoutHierarchy (sourceMethod .getDeclaringClass (), searchStrategy , searchEnclosingClass ));
522
+ isWithoutHierarchy (sourceMethod .getDeclaringClass (), searchEnclosingClass ));
526
523
}
527
524
return true ;
528
525
}
0 commit comments