Make getters and setters null-safety consistent

This commit ensure that null-safety is consistent between
getters and setters in order to be able to provide beans
with properties with a common type when type safety is
taken in account like with Kotlin.

It also add a few missing property level @Nullable
annotations.

Issue: SPR-15792
This commit is contained in:
Sebastien Deleuze
2017-07-19 08:55:05 +02:00
parent ff85726fa9
commit fb4ddb0746
201 changed files with 579 additions and 489 deletions

View File

@@ -34,7 +34,7 @@ public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdv
private final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
public void setExpression(String expression) {
public void setExpression(@Nullable String expression) {
this.pointcut.setExpression(expression);
}
@@ -43,7 +43,7 @@ public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdv
return this.pointcut.getExpression();
}
public void setLocation(String location) {
public void setLocation(@Nullable String location) {
this.pointcut.setLocation(location);
}

View File

@@ -203,7 +203,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
}
@Override
public void setBeanFactory(BeanFactory beanFactory) {
public void setBeanFactory(@Nullable BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}

View File

@@ -70,7 +70,7 @@ public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCrea
* references. Default value is the bean name of this object + a dot.
* @param advisorBeanNamePrefix the exclusion prefix
*/
public void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix) {
public void setAdvisorBeanNamePrefix(@Nullable String advisorBeanNamePrefix) {
this.advisorBeanNamePrefix = advisorBeanNamePrefix;
}

View File

@@ -63,7 +63,7 @@ public abstract class AbstractBeanFactoryPointcutAdvisor extends AbstractPointcu
* of the advisor.
* @see #getAdvice()
*/
public void setAdviceBeanName(String adviceBeanName) {
public void setAdviceBeanName(@Nullable String adviceBeanName) {
this.adviceBeanName = adviceBeanName;
}

View File

@@ -43,7 +43,7 @@ public abstract class AbstractExpressionPointcut implements ExpressionPointcut,
/**
* Set the location for debugging.
*/
public void setLocation(String location) {
public void setLocation(@Nullable String location) {
this.location = location;
}
@@ -58,7 +58,7 @@ public abstract class AbstractExpressionPointcut implements ExpressionPointcut,
return this.location;
}
public void setExpression(String expression) {
public void setExpression(@Nullable String expression) {
this.expression = expression;
try {
onSetExpression(expression);
@@ -82,7 +82,7 @@ public abstract class AbstractExpressionPointcut implements ExpressionPointcut,
* @throws IllegalArgumentException if the expression is invalid
* @see #setExpression
*/
protected void onSetExpression(String expression) throws IllegalArgumentException {
protected void onSetExpression(@Nullable String expression) throws IllegalArgumentException {
}
/**