Skip to content

Commit 46654a0

Browse files
committed
Replace lenient fallback with assertion for actual annotation present
See gh-35133
1 parent b794abd commit 46654a0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-context/src/main/java/org/springframework/resilience/annotation/ConcurrencyLimitBeanPostProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.Map;
2121
import java.util.concurrent.ConcurrentHashMap;
2222

23-
import org.aopalliance.intercept.Joinpoint;
2423
import org.aopalliance.intercept.MethodInterceptor;
2524
import org.aopalliance.intercept.MethodInvocation;
2625
import org.jspecify.annotations.Nullable;
@@ -93,8 +92,8 @@ private static class ConcurrencyLimitInterceptor implements MethodInterceptor {
9392
}
9493
}
9594
if (interceptor == null) {
96-
interceptor = (limit != null ? new ConcurrencyThrottleInterceptor(limit.value()) :
97-
Joinpoint::proceed);
95+
Assert.state(limit != null, "No @ConcurrencyLimit annotation found");
96+
interceptor = new ConcurrencyThrottleInterceptor(limit.value());
9897
if (!perMethod) {
9998
cache.classInterceptor = interceptor;
10099
}

0 commit comments

Comments
 (0)