java-topology/defects/quarkus/patch/quarkus-0001-bean-bound-interceptors-set.patch

31 lines
1.5 KiB
Diff

# UNDF: UNDF-2026-000000517
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanInfo.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanInfo.java
@@ -487,17 +487,17 @@ public class BeanInfo implements InjectionTargetInfo {
public List<InterceptorInfo> getBoundInterceptors() {
if (lifecycleInterceptors.isEmpty() && interceptedMethods.isEmpty()) {
return Collections.emptyList();
}
- List<InterceptorInfo> bound = new ArrayList<>();
+ // Use LinkedHashSet for O(1) dedup while preserving insertion order before sort.
+ Set<InterceptorInfo> seen = new LinkedHashSet<>();
for (InterceptionInfo interception : lifecycleInterceptors.values()) {
for (InterceptorInfo interceptor : interception.interceptors) {
- if (!bound.contains(interceptor)) {
- bound.add(interceptor);
- }
+ seen.add(interceptor);
}
}
for (InterceptionInfo interception : interceptedMethods.values()) {
for (InterceptorInfo interceptor : interception.interceptors) {
- if (!bound.contains(interceptor)) {
- bound.add(interceptor);
- }
+ seen.add(interceptor);
}
}
+ List<InterceptorInfo> bound = new ArrayList<>(seen);
Collections.sort(bound);
return bound;
}