Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection
Issue: SPR-15540
This commit is contained in:
@@ -314,6 +314,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Class<?> getPropertyType() {
|
||||
if (this.propertyType == null) {
|
||||
try {
|
||||
@@ -425,6 +426,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Class<?> getPropertyType() {
|
||||
if (this.propertyType == null) {
|
||||
try {
|
||||
@@ -460,6 +462,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Class<?> getIndexedPropertyType() {
|
||||
if (this.indexedPropertyType == null) {
|
||||
try {
|
||||
|
||||
@@ -196,7 +196,7 @@ class ConstructorResolver {
|
||||
for (Constructor<?> candidate : candidates) {
|
||||
Class<?>[] paramTypes = candidate.getParameterTypes();
|
||||
|
||||
if (constructorToUse != null && argsToUse.length > paramTypes.length) {
|
||||
if (constructorToUse != null && argsToUse != null && argsToUse.length > paramTypes.length) {
|
||||
// Already found greedy constructor that can be satisfied ->
|
||||
// do not look any further, there are only less greedy constructors left.
|
||||
break;
|
||||
@@ -276,11 +276,12 @@ class ConstructorResolver {
|
||||
ambiguousConstructors);
|
||||
}
|
||||
|
||||
if (explicitArgs == null) {
|
||||
if (explicitArgs == null && argsHolderToUse != null) {
|
||||
argsHolderToUse.storeCache(mbd, constructorToUse);
|
||||
}
|
||||
}
|
||||
|
||||
Assert.state(argsToUse != null, "Unresolved constructor arguments");
|
||||
bw.setBeanInstance(instantiate(beanName, mbd, constructorToUse, argsToUse));
|
||||
return bw;
|
||||
}
|
||||
@@ -602,12 +603,13 @@ class ConstructorResolver {
|
||||
}
|
||||
}
|
||||
|
||||
Assert.state(argsToUse != null, "Unresolved factory method arguments");
|
||||
bw.setBeanInstance(instantiate(beanName, mbd, factoryBean, factoryMethodToUse, argsToUse));
|
||||
return bw;
|
||||
}
|
||||
|
||||
private Object instantiate(
|
||||
String beanName, RootBeanDefinition mbd, Object factoryBean, Method factoryMethod, Object[] args) {
|
||||
private Object instantiate(String beanName, RootBeanDefinition mbd,
|
||||
@Nullable Object factoryBean, Method factoryMethod, Object[] args) {
|
||||
|
||||
try {
|
||||
if (System.getSecurityManager() != null) {
|
||||
|
||||
Reference in New Issue
Block a user