Skip to content

Commit 5469b46

Browse files
authored
Merge pull request #49664 from gsmet/avoid-creating-set
Tighten up contract of AnnotationStore#hasAnyAnnotation()
2 parents 8969dec + d2ad777 commit 5469b46

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationStore.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.quarkus.arc.processor;
22

33
import java.util.Collection;
4-
import java.util.HashSet;
54
import java.util.Set;
65

76
import org.jboss.jandex.AnnotationInstance;
@@ -71,12 +70,8 @@ public boolean hasAnnotation(AnnotationTarget target, DotName name) {
7170
* @return {@code true} if the specified target contains any of the specified annotations, {@code false} otherwise
7271
* @see #getAnnotations(AnnotationTarget)
7372
*/
74-
public boolean hasAnyAnnotation(AnnotationTarget target, Iterable<DotName> names) {
75-
Set<DotName> set = new HashSet<>();
76-
for (DotName name : names) {
77-
set.add(name);
78-
}
79-
return delegate.hasAnyAnnotation(target.asDeclaration(), set);
73+
public boolean hasAnyAnnotation(AnnotationTarget target, Set<DotName> names) {
74+
return delegate.hasAnyAnnotation(target.asDeclaration(), names);
8075
}
8176

8277
}

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanDeployment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ enum SkippedReason {
10411041
NO_BEAN_CONSTRUCTOR
10421042
}
10431043

1044-
private BeanDiscoveryResult findBeans(Collection<DotName> beanDefiningAnnotations, List<ObserverInfo> observers,
1044+
private BeanDiscoveryResult findBeans(Set<DotName> beanDefiningAnnotations, List<ObserverInfo> observers,
10451045
List<InjectionPointInfo> injectionPoints, boolean jtaCapabilities) {
10461046

10471047
Set<ClassInfo> beanClasses = new HashSet<>();

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Methods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ public ClassVisitor apply(String className, ClassVisitor classVisitor) {
440440
*/
441441
static class SubclassSkipPredicate implements Predicate<MethodInfo> {
442442

443-
private static final List<DotName> INTERCEPTOR_ANNOTATIONS = List.of(DotNames.AROUND_INVOKE, DotNames.POST_CONSTRUCT,
443+
private static final Set<DotName> INTERCEPTOR_ANNOTATIONS = Set.of(DotNames.AROUND_INVOKE, DotNames.POST_CONSTRUCT,
444444
DotNames.PRE_DESTROY);
445445

446446
private final BiFunction<Type, Type, Boolean> assignableFromFun;

0 commit comments

Comments
 (0)