Commit b6150705 authored by Phillip Webb's avatar Phillip Webb

Merge branch '1.3.x'

parents 51862f3c e8bedacc
...@@ -263,6 +263,7 @@ public class PropertiesConfigurationFactory<T> ...@@ -263,6 +263,7 @@ public class PropertiesConfigurationFactory<T>
if (this.conversionService != null) { if (this.conversionService != null) {
dataBinder.setConversionService(this.conversionService); dataBinder.setConversionService(this.conversionService);
} }
dataBinder.setAutoGrowCollectionLimit(Integer.MAX_VALUE);
dataBinder.setIgnoreNestedProperties(this.ignoreNestedProperties); dataBinder.setIgnoreNestedProperties(this.ignoreNestedProperties);
dataBinder.setIgnoreInvalidFields(this.ignoreInvalidFields); dataBinder.setIgnoreInvalidFields(this.ignoreInvalidFields);
dataBinder.setIgnoreUnknownFields(this.ignoreUnknownFields); dataBinder.setIgnoreUnknownFields(this.ignoreUnknownFields);
......
...@@ -225,6 +225,20 @@ public class EnableConfigurationPropertiesTests { ...@@ -225,6 +225,20 @@ public class EnableConfigurationPropertiesTests {
assertThat(this.context.getBean(TestProperties.class).getList()).hasSize(2); assertThat(this.context.getBean(TestProperties.class).getList()).hasSize(2);
} }
@Test
public void testCollectionPropertiesBindingWithOver256Elements() {
this.context.register(TestConfiguration.class);
List<String> pairs = new ArrayList<String>();
pairs.add("name:foo");
for (int i = 0; i < 1000; i++) {
pairs.add("list[" + i + "]:" + i);
}
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context,
pairs.toArray(new String[] {}));
this.context.refresh();
assertThat(this.context.getBean(TestProperties.class).getList()).hasSize(1000);
}
@Test @Test
public void testPropertiesBindingWithoutAnnotation() { public void testPropertiesBindingWithoutAnnotation() {
this.context.register(InvalidConfiguration.class); this.context.register(InvalidConfiguration.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment