Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)
Issue: SPR-15756
This commit is contained in:
@@ -367,23 +367,23 @@ public abstract class BeanUtils {
|
||||
public static Method resolveSignature(String signature, Class<?> clazz) {
|
||||
Assert.hasText(signature, "'signature' must not be empty");
|
||||
Assert.notNull(clazz, "Class must not be null");
|
||||
int firstParen = signature.indexOf('(');
|
||||
int lastParen = signature.indexOf(')');
|
||||
if (firstParen > -1 && lastParen == -1) {
|
||||
int startParen = signature.indexOf('(');
|
||||
int endParen = signature.indexOf(')');
|
||||
if (startParen > -1 && endParen == -1) {
|
||||
throw new IllegalArgumentException("Invalid method signature '" + signature +
|
||||
"': expected closing ')' for args list");
|
||||
}
|
||||
else if (lastParen > -1 && firstParen == -1) {
|
||||
else if (startParen == -1 && endParen > -1) {
|
||||
throw new IllegalArgumentException("Invalid method signature '" + signature +
|
||||
"': expected opening '(' for args list");
|
||||
}
|
||||
else if (firstParen == -1 && lastParen == -1) {
|
||||
else if (startParen == -1) {
|
||||
return findMethodWithMinimalParameters(clazz, signature);
|
||||
}
|
||||
else {
|
||||
String methodName = signature.substring(0, firstParen);
|
||||
String methodName = signature.substring(0, startParen);
|
||||
String[] parameterTypeNames =
|
||||
StringUtils.commaDelimitedListToStringArray(signature.substring(firstParen + 1, lastParen));
|
||||
StringUtils.commaDelimitedListToStringArray(signature.substring(startParen + 1, endParen));
|
||||
Class<?>[] parameterTypes = new Class<?>[parameterTypeNames.length];
|
||||
for (int i = 0; i < parameterTypeNames.length; i++) {
|
||||
String parameterTypeName = parameterTypeNames[i].trim();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -144,15 +144,16 @@ public class BeanConfigurerSupport implements BeanFactoryAware, InitializingBean
|
||||
ConfigurableListableBeanFactory beanFactory = this.beanFactory;
|
||||
Assert.state(beanFactory != null, "No BeanFactory available");
|
||||
try {
|
||||
if (bwi.indicatesAutowiring() || (bwi.isDefaultBeanName() && bwi.getBeanName() != null &&
|
||||
!beanFactory.containsBean(bwi.getBeanName()))) {
|
||||
String beanName = bwi.getBeanName();
|
||||
if (bwi.indicatesAutowiring() || (bwi.isDefaultBeanName() && beanName != null &&
|
||||
!beanFactory.containsBean(beanName))) {
|
||||
// Perform autowiring (also applying standard factory / post-processor callbacks).
|
||||
beanFactory.autowireBeanProperties(beanInstance, bwi.getAutowireMode(), bwi.getDependencyCheck());
|
||||
beanFactory.initializeBean(beanInstance, bwi.getBeanName());
|
||||
beanFactory.initializeBean(beanInstance, (beanName != null ? beanName : ""));
|
||||
}
|
||||
else {
|
||||
// Perform explicit wiring based on the specified bean definition.
|
||||
beanFactory.configureBean(beanInstance, bwi.getBeanName());
|
||||
beanFactory.configureBean(beanInstance, (beanName != null ? beanName : ""));
|
||||
}
|
||||
}
|
||||
catch (BeanCreationException ex) {
|
||||
|
||||
Reference in New Issue
Block a user