Browse Source

for Keith and his binder: fault in support for maps (if attempt made to reference into null map) and for general objects, e.g. foo.bar if foo was null, attempt to dynamically build foo.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1512 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Andy Clement 17 years ago
parent
commit
85a197f5b8
  1. 2
      org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java
  2. 2
      org.springframework.context/src/test/java/org/springframework/ui/binding/support/GenericBinderTests.java

2
org.springframework.context/src/main/java/org/springframework/ui/binding/support/GenericBinder.java

@ -104,7 +104,7 @@ public class GenericBinder implements Binder { @@ -104,7 +104,7 @@ public class GenericBinder implements Binder {
Assert.notNull(model, "The model to bind to is required");
this.model = model;
bindingFactories = new LinkedHashSet<BindingFactory>();
int parserConfig = SpelExpressionParserConfiguration.CreateListsOnAttemptToIndexIntoNull
int parserConfig = SpelExpressionParserConfiguration.CreateObjectIfAttemptToReferenceNull
| SpelExpressionParserConfiguration.GrowListsOnIndexBeyondSize;
expressionParser = new SpelExpressionParser(parserConfig);
typeConverter = new DefaultTypeConverter();

2
org.springframework.context/src/test/java/org/springframework/ui/binding/support/GenericBinderTests.java

@ -357,7 +357,6 @@ public class GenericBinderTests { @@ -357,7 +357,6 @@ public class GenericBinderTests {
}
@Test
@Ignore
public void bindToMapElements() {
binder.addBinding("favoriteFoodsByGroup");
Map<String, String> values = new LinkedHashMap<String, String>();
@ -401,7 +400,6 @@ public class GenericBinderTests { @@ -401,7 +400,6 @@ public class GenericBinderTests {
}
@Test
@Ignore
public void bindToNullObjectPath() {
binder.addBinding("primaryAddress.street");
binder.addBinding("primaryAddress.city");

Loading…
Cancel
Save