Skip to content

Commit 0862a29

Browse files
committed
"file-encoding" attribute value is being applied correctly (SPR-8024)
1 parent 8d83f69 commit 0862a29

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

org.springframework.context/src/main/java/org/springframework/context/config/AbstractPropertyLoadingBeanDefinitionParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 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.
@@ -53,7 +53,7 @@ protected void doParse(Element element, BeanDefinitionBuilder builder) {
5353

5454
String fileEncoding = element.getAttribute("file-encoding");
5555
if (StringUtils.hasLength(fileEncoding)) {
56-
builder.addPropertyReference("fileEncoding", fileEncoding);
56+
builder.addPropertyValue("fileEncoding", fileEncoding);
5757
}
5858

5959
String order = element.getAttribute("order");

org.springframework.context/src/main/java/org/springframework/context/config/PropertyPlaceholderBeanDefinitionParser.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 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,12 +38,9 @@ protected Class getBeanClass(Element element) {
3838

3939
@Override
4040
protected void doParse(Element element, BeanDefinitionBuilder builder) {
41-
4241
super.doParse(element, builder);
43-
4442
builder.addPropertyValue("ignoreUnresolvablePlaceholders",
4543
Boolean.valueOf(element.getAttribute("ignore-unresolvable")));
46-
4744
String systemPropertiesModeName = element.getAttribute("system-properties-mode");
4845
if (StringUtils.hasLength(systemPropertiesModeName)) {
4946
builder.addPropertyValue("systemPropertiesModeName", "SYSTEM_PROPERTIES_MODE_"+systemPropertiesModeName);

org.springframework.context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
88

99
<context:property-placeholder
10-
location="classpath*:/org/springframework/context/config/test-*.properties,classpath*:/org/springframework/context/config/empty-*.properties,classpath*:/org/springframework/context/config/missing-*.properties" />
10+
location="classpath*:/org/springframework/context/config/test-*.properties,classpath*:/org/springframework/context/config/empty-*.properties,classpath*:/org/springframework/context/config/missing-*.properties"
11+
file-encoding="ISO-8859-1"/>
1112

1213
<bean id="foo" class="java.lang.String">
1314
<constructor-arg value="${foo}" />

0 commit comments

Comments
 (0)