Replace lenient fallback with assertion for actual annotation present
See gh-35133
This commit is contained in:
parent
b794abd8cb
commit
46654a03fe
|
@ -20,7 +20,6 @@ import java.lang.reflect.Method;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.aopalliance.intercept.Joinpoint;
|
|
||||||
import org.aopalliance.intercept.MethodInterceptor;
|
import org.aopalliance.intercept.MethodInterceptor;
|
||||||
import org.aopalliance.intercept.MethodInvocation;
|
import org.aopalliance.intercept.MethodInvocation;
|
||||||
import org.jspecify.annotations.Nullable;
|
import org.jspecify.annotations.Nullable;
|
||||||
|
@ -93,8 +92,8 @@ public class ConcurrencyLimitBeanPostProcessor extends AbstractBeanFactoryAwareA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (interceptor == null) {
|
if (interceptor == null) {
|
||||||
interceptor = (limit != null ? new ConcurrencyThrottleInterceptor(limit.value()) :
|
Assert.state(limit != null, "No @ConcurrencyLimit annotation found");
|
||||||
Joinpoint::proceed);
|
interceptor = new ConcurrencyThrottleInterceptor(limit.value());
|
||||||
if (!perMethod) {
|
if (!perMethod) {
|
||||||
cache.classInterceptor = interceptor;
|
cache.classInterceptor = interceptor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue