Skip to content

Commit 61adf2d

Browse files
committed
Formal null safety for exception message through String.valueOf
See gh-33117
1 parent 61894af commit 61adf2d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefiniti
853853
}
854854
}
855855
catch (IllegalArgumentException ex) {
856-
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName, ex.getMessage());
856+
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
857+
String.valueOf(ex.getMessage()));
857858
}
858859

859860
// For instance supplied beans, try the target type and bean class immediately

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,8 @@ protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefiniti
17231723
}
17241724
}
17251725
catch (IllegalArgumentException ex) {
1726-
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName, ex.getMessage());
1726+
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
1727+
String.valueOf(ex.getMessage()));
17271728
}
17281729

17291730
if (allowInit && mbd.isSingleton()) {

0 commit comments

Comments
 (0)