@@ -103,26 +103,25 @@ private static <C, R> R processClass(C context, Class<?> source, SearchStrategy
103103
104104 return switch (searchStrategy ) {
105105 case DIRECT -> processElement (context , source , processor );
106- case INHERITED_ANNOTATIONS -> processClassInheritedAnnotations (context , source , searchStrategy , processor );
106+ case INHERITED_ANNOTATIONS -> processClassInheritedAnnotations (context , source , processor );
107107 case SUPERCLASS -> processClassHierarchy (context , source , processor , false , Search .never );
108108 case TYPE_HIERARCHY -> processClassHierarchy (context , source , processor , true , searchEnclosingClass );
109109 };
110110 }
111111
112112 @ Nullable
113113 private static <C , R > R processClassInheritedAnnotations (C context , Class <?> source ,
114- SearchStrategy searchStrategy , AnnotationsProcessor <C , R > processor ) {
114+ AnnotationsProcessor <C , R > processor ) {
115115
116116 try {
117- if (isWithoutHierarchy (source , searchStrategy , Search .never )) {
117+ if (isWithoutHierarchy (source , Search .never )) {
118118 return processElement (context , source , processor );
119119 }
120120 Annotation [] relevant = null ;
121121 int remaining = Integer .MAX_VALUE ;
122122 int aggregateIndex = 0 ;
123123 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 )) {
126125 R result = processor .doWithAggregate (context , aggregateIndex );
127126 if (result != null ) {
128127 return result ;
@@ -483,7 +482,7 @@ static boolean isKnownEmpty(AnnotatedElement source, SearchStrategy searchStrate
483482 if (hasPlainJavaAnnotationsOnly (source )) {
484483 return true ;
485484 }
486- if (searchStrategy == SearchStrategy .DIRECT || isWithoutHierarchy (source , searchStrategy , searchEnclosingClass )) {
485+ if (searchStrategy == SearchStrategy .DIRECT || isWithoutHierarchy (source , searchEnclosingClass )) {
487486 if (source instanceof Method method && method .isBridge ()) {
488487 return false ;
489488 }
@@ -508,9 +507,7 @@ static boolean hasPlainJavaAnnotationsOnly(Class<?> type) {
508507 return (type .getName ().startsWith ("java." ) || type == Ordered .class );
509508 }
510509
511- private static boolean isWithoutHierarchy (AnnotatedElement source , SearchStrategy searchStrategy ,
512- Predicate <Class <?>> searchEnclosingClass ) {
513-
510+ private static boolean isWithoutHierarchy (AnnotatedElement source , Predicate <Class <?>> searchEnclosingClass ) {
514511 if (source == Object .class ) {
515512 return true ;
516513 }
@@ -522,7 +519,7 @@ private static boolean isWithoutHierarchy(AnnotatedElement source, SearchStrateg
522519 }
523520 if (source instanceof Method sourceMethod ) {
524521 return (Modifier .isPrivate (sourceMethod .getModifiers ()) ||
525- isWithoutHierarchy (sourceMethod .getDeclaringClass (), searchStrategy , searchEnclosingClass ));
522+ isWithoutHierarchy (sourceMethod .getDeclaringClass (), searchEnclosingClass ));
526523 }
527524 return true ;
528525 }
0 commit comments