Consistently detect resilience annotations on interfaces

Closes gh-36233
This commit is contained in:
Juergen Hoeller
2026-01-30 17:12:22 +01:00
parent 32b55e68fc
commit 516bf1c606
4 changed files with 69 additions and 6 deletions
@@ -101,14 +101,14 @@ public class ConcurrencyLimitBeanPostProcessor extends AbstractBeanFactoryAwareA
interceptor = holder.methodInterceptors.get(method);
if (interceptor == null) {
boolean perMethod = false;
ConcurrencyLimit annotation = AnnotatedElementUtils.getMergedAnnotation(method, ConcurrencyLimit.class);
ConcurrencyLimit annotation = AnnotatedElementUtils.findMergedAnnotation(method, ConcurrencyLimit.class);
if (annotation != null) {
perMethod = true;
}
else {
interceptor = holder.classInterceptor;
if (interceptor == null) {
annotation = AnnotatedElementUtils.getMergedAnnotation(targetClass, ConcurrencyLimit.class);
annotation = AnnotatedElementUtils.findMergedAnnotation(targetClass, ConcurrencyLimit.class);
}
}
if (interceptor == null) {
@@ -93,9 +93,9 @@ public class RetryAnnotationBeanPostProcessor extends AbstractBeanFactoryAwareAd
return retrySpec;
}
Retryable retryable = AnnotatedElementUtils.getMergedAnnotation(method, Retryable.class);
Retryable retryable = AnnotatedElementUtils.findMergedAnnotation(method, Retryable.class);
if (retryable == null) {
retryable = AnnotatedElementUtils.getMergedAnnotation(targetClass, Retryable.class);
retryable = AnnotatedElementUtils.findMergedAnnotation(targetClass, Retryable.class);
if (retryable == null) {
return null;
}