Skip to content

Commit 7d8843d

Browse files
jhoellerunknown
authored andcommitted
Expression detection properly handles cached String literals
Issue: SPR-9670
1 parent f29b791 commit 7d8843d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2010 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@
3838
import org.springframework.beans.factory.config.RuntimeBeanReference;
3939
import org.springframework.beans.factory.config.TypedStringValue;
4040
import org.springframework.util.ClassUtils;
41+
import org.springframework.util.ObjectUtils;
4142
import org.springframework.util.StringUtils;
4243

4344
/**
@@ -208,7 +209,7 @@ else if (value instanceof TypedStringValue) {
208209
*/
209210
protected Object evaluate(TypedStringValue value) {
210211
Object result = this.beanFactory.evaluateBeanDefinitionString(value.getValue(), this.beanDefinition);
211-
if (result != value.getValue()) {
212+
if (!ObjectUtils.nullSafeEquals(result, value.getValue())) {
212213
value.setDynamic();
213214
}
214215
return result;

0 commit comments

Comments
 (0)