From 46654a03fedbf6ec2eeedd316564745d48e765e5 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 2 Jul 2025 11:09:53 +0200 Subject: [PATCH] Replace lenient fallback with assertion for actual annotation present See gh-35133 --- .../annotation/ConcurrencyLimitBeanPostProcessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/resilience/annotation/ConcurrencyLimitBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/resilience/annotation/ConcurrencyLimitBeanPostProcessor.java index 62f646ddc9..c556c7d52b 100644 --- a/spring-context/src/main/java/org/springframework/resilience/annotation/ConcurrencyLimitBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/resilience/annotation/ConcurrencyLimitBeanPostProcessor.java @@ -20,7 +20,6 @@ import java.lang.reflect.Method; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.aopalliance.intercept.Joinpoint; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.jspecify.annotations.Nullable; @@ -93,8 +92,8 @@ public class ConcurrencyLimitBeanPostProcessor extends AbstractBeanFactoryAwareA } } if (interceptor == null) { - interceptor = (limit != null ? new ConcurrencyThrottleInterceptor(limit.value()) : - Joinpoint::proceed); + Assert.state(limit != null, "No @ConcurrencyLimit annotation found"); + interceptor = new ConcurrencyThrottleInterceptor(limit.value()); if (!perMethod) { cache.classInterceptor = interceptor; }