Skip to content

Commit 54d3d78

Browse files
committed
Polishing
1 parent a23629f commit 54d3d78

File tree

7 files changed

+39
-32
lines changed

7 files changed

+39
-32
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -30,33 +30,33 @@
3030
*
3131
* <p>The default placeholder syntax follows the Ant / Log4J / JSP EL style:
3232
*
33-
*<pre class="code">${...}</pre>
33+
* <pre class="code">${...}</pre>
3434
*
3535
* Example XML bean definition:
3636
*
37-
*<pre class="code">{@code
38-
*<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
39-
* <property name="driverClassName" value="}${driver}{@code "/>
40-
* <property name="url" value="jdbc:}${dbname}{@code "/>
41-
*</bean>
42-
*}</pre>
37+
* <pre class="code">
38+
* <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
39+
* <property name="driverClassName" value="${driver}"/>
40+
* <property name="url" value="jdbc:${dbname}"/>
41+
* </bean>
42+
* </pre>
4343
*
4444
* Example properties file:
4545
*
46-
* <pre class="code"> driver=com.mysql.jdbc.Driver
46+
* <pre class="code">driver=com.mysql.jdbc.Driver
4747
* dbname=mysql:mydb</pre>
4848
*
4949
* Annotated bean definitions may take advantage of property replacement using
5050
* the {@link org.springframework.beans.factory.annotation.Value @Value} annotation:
5151
*
52-
*<pre class="code">@Value("${person.age}")</pre>
52+
* <pre class="code">@Value("${person.age}")</pre>
5353
*
5454
* Implementations check simple property values, lists, maps, props, and bean names
5555
* in bean references. Furthermore, placeholder values can also cross-reference
5656
* other placeholders, like:
5757
*
58-
*<pre class="code">rootPath=myrootdir
59-
*subPath=${rootPath}/subdir</pre>
58+
* <pre class="code">rootPath=myrootdir
59+
* subPath=${rootPath}/subdir</pre>
6060
*
6161
* In contrast to {@link PropertyOverrideConfigurer}, subclasses of this type allow
6262
* filling in of explicit placeholders in bean definitions.
@@ -75,9 +75,9 @@
7575
*
7676
* <p>Example XML property with default value:
7777
*
78-
*<pre class="code">{@code
79-
* <property name="url" value="jdbc:}${dbname:defaultdb}{@code "/>
80-
*}</pre>
78+
* <pre class="code">
79+
* <property name="url" value="jdbc:${dbname:defaultdb}"/>
80+
* </pre>
8181
*
8282
* @author Chris Beams
8383
* @author Juergen Hoeller
@@ -107,14 +107,14 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
107107
/** Defaults to {@value #DEFAULT_VALUE_SEPARATOR} */
108108
protected String valueSeparator = DEFAULT_VALUE_SEPARATOR;
109109

110-
protected boolean ignoreUnresolvablePlaceholders = false;
111-
112110
protected String nullValue;
113111

114-
private BeanFactory beanFactory;
112+
protected boolean ignoreUnresolvablePlaceholders = false;
115113

116114
private String beanName;
117115

116+
private BeanFactory beanFactory;
117+
118118

119119
/**
120120
* Set the prefix that a placeholder string starts with.
@@ -143,13 +143,13 @@ public void setValueSeparator(String valueSeparator) {
143143
}
144144

145145
/**
146-
* Set a value that should be treated as {@code null} when
147-
* resolved as a placeholder value: e.g. "" (empty String) or "null".
146+
* Set a value that should be treated as {@code null} when resolved
147+
* as a placeholder value: e.g. "" (empty String) or "null".
148148
* <p>Note that this will only apply to full property values,
149149
* not to parts of concatenated values.
150150
* <p>By default, no such null value is defined. This means that
151-
* there is no way to express {@code null} as a property
152-
* value unless you explicitly map a corresponding value here.
151+
* there is no way to express {@code null} as a property value
152+
* unless you explicitly map a corresponding value here.
153153
*/
154154
public void setNullValue(String nullValue) {
155155
this.nullValue = nullValue;

spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -44,7 +44,7 @@ public interface ScriptEvaluator {
4444
* Evaluate the given script with the given arguments.
4545
* @param script the ScriptSource for the script to evaluate
4646
* @param arguments the key-value pairs to expose to the script,
47-
* typically as script variables. May be {@code null}.
47+
* typically as script variables (may be {@code null} or empty)
4848
* @return the return value of the script, if any
4949
* @throws ScriptCompilationException if the evaluator failed to read,
5050
* compile or evaluate the script

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<beans xmlns="http://www.springframework.org/schema/beans"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns:context="http://www.springframework.org/schema/context"
5-
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
66
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
77

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

1212
<bean id="foo" class="java.lang.String">
13-
<constructor-arg value="${foo}" />
13+
<constructor-arg value="${foo}"/>
1414
</bean>
1515

1616
<bean id="bar" class="java.lang.String">
17-
<constructor-arg value="${bar}" />
17+
<constructor-arg value="${bar}"/>
1818
</bean>
1919

2020
<bean id="spam" class="java.lang.String">
21-
<constructor-arg value="${spam}" />
21+
<constructor-arg value="${spam}"/>
2222
</bean>
2323

2424
</beans>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xmlns:context="http://www.springframework.org/schema/context"
4-
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
5-
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
6-
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
4+
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
5+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
6+
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
77

88
<util:properties id="overrideProps">
99
<prop key="date.minutes">42</prop>
1010
</util:properties>
1111

12-
<context:property-override properties-ref="overrideProps" order="1" />
12+
<context:property-override properties-ref="overrideProps" order="1"/>
1313

1414
<bean id="date" class="java.util.Date">
1515
<property name="minutes" value="10"/>

spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class JRubyScriptTemplateTests {
4444

4545
private ServletContext servletContext;
4646

47+
4748
@Before
4849
public void setup() {
4950
this.webAppContext = mock(WebApplicationContext.class);
@@ -81,6 +82,7 @@ private ScriptTemplateView createViewWithUrl(String viewUrl) throws Exception {
8182
return view;
8283
}
8384

85+
8486
@Configuration
8587
static class ScriptTemplatingConfiguration {
8688

spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class JythonScriptTemplateTests {
4444

4545
private ServletContext servletContext;
4646

47+
4748
@Before
4849
public void setup() {
4950
this.webAppContext = mock(WebApplicationContext.class);
@@ -81,6 +82,7 @@ private ScriptTemplateView createViewWithUrl(String viewUrl) throws Exception {
8182
return view;
8283
}
8384

85+
8486
@Configuration
8587
static class ScriptTemplatingConfiguration {
8688

spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class NashornScriptTemplateTests {
4444

4545
private ServletContext servletContext;
4646

47+
4748
@Before
4849
public void setup() {
4950
this.webAppContext = mock(WebApplicationContext.class);
@@ -90,6 +91,7 @@ private ScriptTemplateView createViewWithUrl(String viewUrl, Class<?> configurat
9091
return view;
9192
}
9293

94+
9395
@Configuration
9496
static class ScriptTemplatingConfiguration {
9597

@@ -103,6 +105,7 @@ public ScriptTemplateConfigurer nashornConfigurer() {
103105
}
104106
}
105107

108+
106109
@Configuration
107110
static class ScriptTemplatingWithUrlConfiguration {
108111

0 commit comments

Comments
 (0)