Skip to content

Commit

Permalink
ArC: improve how intercepted methods are searched for
Browse files Browse the repository at this point in the history
If there are no interceptor binding annotations on the method, we can
interrupt the search process a bit earlier and don't have to call
the "skip this method?" predicate. This slightly improves the user
experience, because the predicate can pring warnings (which would
be useless in this case).
  • Loading branch information
Ladicek committed Nov 22, 2024
1 parent cbd735f commit 4c6af39
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,15 @@ private static Set<MethodInfo> addInterceptedMethodCandidates(BeanDeployment bea
Set<AnnotationInstance> bindings = mergeBindings(beanDeployment, originalClassInfo, classLevelBindings,
ignoreMethodLevelBindings, method, noClassInterceptorsMethods, bindingsDiscovery);
boolean possiblyIntercepted = !bindings.isEmpty() || targetHasAroundInvokes;
if (!possiblyIntercepted) {
candidates.put(key, bindings);
continue;
}
if (skipPredicate.test(method)) {
continue;
}
boolean addToCandidates = true;
if (Modifier.isFinal(method.flags()) && possiblyIntercepted) {
if (Modifier.isFinal(method.flags())) {
if (transformUnproxyableClasses && !isNoninterceptableKotlinMethod(method)) {
methodsFromWhichToRemoveFinal.add(new MethodKey(method));
} else {
Expand All @@ -207,7 +211,7 @@ private static Set<MethodInfo> addInterceptedMethodCandidates(BeanDeployment bea
}
}
if (addToCandidates) {
candidates.putIfAbsent(key, bindings);
candidates.put(key, bindings);
}
}
skipPredicate.methodsProcessed();
Expand Down

0 comments on commit 4c6af39

Please sign in to comment.