From 7d8843d0691435cf809fa095cca1846348384149 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 10 Sep 2012 11:10:24 +0200 Subject: [PATCH] Expression detection properly handles cached String literals Issue: SPR-9670 --- .../beans/factory/support/BeanDefinitionValueResolver.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java index 8220ee353b..d794b3a4ef 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -38,6 +38,7 @@ import org.springframework.beans.factory.config.RuntimeBeanNameReference; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.config.TypedStringValue; import org.springframework.util.ClassUtils; +import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; /** @@ -208,7 +209,7 @@ class BeanDefinitionValueResolver { */ protected Object evaluate(TypedStringValue value) { Object result = this.beanFactory.evaluateBeanDefinitionString(value.getValue(), this.beanDefinition); - if (result != value.getValue()) { + if (!ObjectUtils.nullSafeEquals(result, value.getValue())) { value.setDynamic(); } return result;