Skip to content

Commit b7c2881

Browse files
committed
Clarify javadoc
The Javadoc wrongly referred to a behaviour that is not (and should not be) implemented. List items are split into indexed keys and the comma-separated value is not retained. Issues: SPR-13257
1 parent 20c4f82 commit b7c2881

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 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.
@@ -48,8 +48,7 @@
4848
* environments.prod.name=My Cool App
4949
* </pre>
5050
*
51-
* Lists are represented as comma-separated values (useful for simple String
52-
* values) and also as property keys with <code>[]</code> dereferencers, for
51+
* Lists are split as property keys with <code>[]</code> dereferencers, for
5352
* example this YAML:
5453
*
5554
* <pre class="code">
@@ -61,7 +60,6 @@
6160
* becomes Java Properties like this:
6261
*
6362
* <pre class="code">
64-
* servers=dev.bar.com,foo.bar.com
6563
* servers[0]=dev.bar.com
6664
* servers[1]=foo.bar.com
6765
* </pre>

spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 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.
@@ -215,6 +215,7 @@ public void testLoadArrayOfString() throws Exception {
215215
Properties properties = factory.getObject();
216216
assertThat(properties.getProperty("foo[0]"), equalTo("bar"));
217217
assertThat(properties.getProperty("foo[1]"), equalTo("baz"));
218+
assertThat(properties.get("foo"), is(nullValue()));
218219
}
219220

220221
@Test
@@ -229,6 +230,7 @@ public void testLoadArrayOfObject() throws Exception {
229230
assertThat(properties.getProperty("foo[1]"), equalTo("baz"));
230231
assertThat(properties.getProperty("foo[2].one"), equalTo("two"));
231232
assertThat(properties.getProperty("foo[2].three"), equalTo("four"));
233+
assertThat(properties.get("foo"), is(nullValue()));
232234
}
233235

234236
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)