Use Assert.state() where appropriate
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,7 +44,7 @@ public class ProxyAsyncConfiguration extends AbstractAsyncConfiguration {
|
||||
@Bean(name = TaskManagementConfigUtils.ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public AsyncAnnotationBeanPostProcessor asyncAdvisor() {
|
||||
Assert.notNull(this.enableAsync, "@EnableAsync annotation metadata was not injected");
|
||||
Assert.state(this.enableAsync != null, "@EnableAsync annotation metadata was not injected");
|
||||
AsyncAnnotationBeanPostProcessor bpp = new AsyncAnnotationBeanPostProcessor();
|
||||
bpp.configure(this.executor, this.exceptionHandler);
|
||||
Class<? extends Annotation> customAsyncAnnotation = this.enableAsync.getClass("annotation");
|
||||
|
||||
@@ -378,43 +378,43 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter
|
||||
|
||||
@Override
|
||||
public Validator getValidator() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getValidator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidatorContext usingContext() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.usingContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInterpolator getMessageInterpolator() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getMessageInterpolator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TraversableResolver getTraversableResolver() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getTraversableResolver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintValidatorFactory getConstraintValidatorFactory() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getConstraintValidatorFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParameterNameProvider getParameterNameProvider() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getParameterNameProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClockProvider getClockProvider() {
|
||||
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
|
||||
Assert.state(this.validatorFactory != null, "No target ValidatorFactory set");
|
||||
return this.validatorFactory.getClockProvider();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user