From b7c2881a4f9a92ac1e056156b4f4ca7abd1ecf0a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 2 Oct 2015 14:17:54 +0200 Subject: [PATCH] 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 --- .../beans/factory/config/YamlPropertiesFactoryBean.java | 6 ++---- .../factory/config/YamlPropertiesFactoryBeanTests.java | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java index 8ca4549795..0374ddbf55 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -48,8 +48,7 @@ import org.springframework.beans.factory.InitializingBean; * environments.prod.name=My Cool App * * - * Lists are represented as comma-separated values (useful for simple String - * values) and also as property keys with [] dereferencers, for + * Lists are split as property keys with [] dereferencers, for * example this YAML: * *
@@ -61,7 +60,6 @@ import org.springframework.beans.factory.InitializingBean;
  * becomes Java Properties like this:
  *
  * 
- * servers=dev.bar.com,foo.bar.com
  * servers[0]=dev.bar.com
  * servers[1]=foo.bar.com
  * 
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java index 5e3d953b2c..855e479a64 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlPropertiesFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -215,6 +215,7 @@ public class YamlPropertiesFactoryBeanTests { Properties properties = factory.getObject(); assertThat(properties.getProperty("foo[0]"), equalTo("bar")); assertThat(properties.getProperty("foo[1]"), equalTo("baz")); + assertThat(properties.get("foo"), is(nullValue())); } @Test @@ -229,6 +230,7 @@ public class YamlPropertiesFactoryBeanTests { assertThat(properties.getProperty("foo[1]"), equalTo("baz")); assertThat(properties.getProperty("foo[2].one"), equalTo("two")); assertThat(properties.getProperty("foo[2].three"), equalTo("four")); + assertThat(properties.get("foo"), is(nullValue())); } @SuppressWarnings("unchecked")