Skip to content

Commit f3e1c28

Browse files
authored
Merge pull request #46328 from geoand/#46201
Prevent indexing warning about Lombok annotation in REST Client
2 parents 54ec3c7 + 90833c0 commit f3e1c28

File tree

1 file changed

+15
-0
lines changed
  • independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor

1 file changed

+15
-0
lines changed

independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/NameBindingUtil.java

+15
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.HashSet;
1111
import java.util.List;
1212
import java.util.Set;
13+
import java.util.function.Predicate;
1314

1415
import org.jboss.jandex.AnnotationInstance;
1516
import org.jboss.jandex.ClassInfo;
@@ -19,6 +20,17 @@
1920

2021
public class NameBindingUtil {
2122

23+
// this is used to avoid looking up annotation that don't exist in an index and can cause
24+
// annoying indexing warnings.
25+
// TODO: We might have to make this smarter at some point
26+
private static final Predicate<DotName> CLASS_ANNOTATION_SKIP_PREDICATE = new Predicate<>() {
27+
@Override
28+
public boolean test(DotName dotName) {
29+
String className = dotName.toString();
30+
return className.contains("NonNull") || className.startsWith("lombok");
31+
}
32+
};
33+
2234
/**
2335
* Returns the class names of the {@code @NameBinding} annotations or null if non are present
2436
*/
@@ -50,6 +62,9 @@ private static Set<String> nameBindingNames(IndexView index, Collection<DotName>
5062
|| classAnnotationDotName.equals(PRODUCES)) {
5163
continue;
5264
}
65+
if (CLASS_ANNOTATION_SKIP_PREDICATE.test(classAnnotationDotName)) {
66+
continue;
67+
}
5368
ClassInfo classAnnotation = index.getClassByName(classAnnotationDotName);
5469
if (classAnnotation == null) {
5570
continue;

0 commit comments

Comments
 (0)