Formal null safety for exception message through String.valueOf

See gh-33117
This commit is contained in:
Juergen Hoeller 2024-06-28 18:09:39 +02:00
parent 61894af0bd
commit 61adf2dd25
2 changed files with 4 additions and 2 deletions

View File

@ -853,7 +853,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
}
}
catch (IllegalArgumentException ex) {
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName, ex.getMessage());
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
String.valueOf(ex.getMessage()));
}
// For instance supplied beans, try the target type and bean class immediately

View File

@ -1723,7 +1723,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
catch (IllegalArgumentException ex) {
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName, ex.getMessage());
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
String.valueOf(ex.getMessage()));
}
if (allowInit && mbd.isSingleton()) {