diff --git a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/SpringDataJPAProcessor.java b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/SpringDataJPAProcessor.java index a41cfc8bfda0b..7ccfbb5648538 100644 --- a/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/SpringDataJPAProcessor.java +++ b/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/SpringDataJPAProcessor.java @@ -10,11 +10,13 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; +import java.util.stream.Collectors; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; +import org.jboss.jandex.AnnotationTarget.Kind; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.jboss.jandex.IndexView; @@ -232,20 +234,11 @@ private List getAllInterfacesExtending(Collection targets, I } private Collection getAllNoRepositoryBeanInterfaces(IndexView index) { - Set result = new HashSet<>(); - Collection knownClasses = index.getKnownClasses(); - for (ClassInfo clazz : knownClasses) { - if (!Modifier.isInterface(clazz.flags())) { - continue; - } - boolean found = false; - for (ClassInfo classInfo : knownClasses) { - if (classInfo.classAnnotation(DotNames.SPRING_DATA_NO_REPOSITORY_BEAN) != null) { - result.add(classInfo.name()); - } - } - } - return result; + return index.getAnnotations(DotNames.SPRING_DATA_NO_REPOSITORY_BEAN).stream() + .filter(ai -> ai.target().kind() == Kind.CLASS) + .filter(ai -> Modifier.isInterface(ai.target().asClass().flags())) + .map(ai -> ai.target().asClass().name()) + .collect(Collectors.toSet()); } // generate a concrete class that will be used by Arc to resolve injection points