better method name

This commit is contained in:
Andy Clement
2009-07-10 19:44:40 +00:00
parent 3788a84b8e
commit 84bdd1ab8e
3 changed files with 58 additions and 4 deletions

View File

@@ -217,7 +217,7 @@ public class ExpressionState {
return (configuration & SpelExpressionParserConfiguration.GrowListsOnIndexBeyondSize)!=0;
}
public boolean configuredToCreateCollectionOrMap() {
public boolean configuredToDynamicallyCreateNullObjects() {
return (configuration & SpelExpressionParserConfiguration.CreateObjectIfAttemptToReferenceNull)!=0;
}

View File

@@ -59,7 +59,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
TypedValue result = readProperty(state, this.name);
TypeDescriptor resultDescriptor = result.getTypeDescriptor();
// Dynamically create the objects if the user has requested that optional behaviour
if (result.getValue()==null && state.configuredToCreateCollectionOrMap() && nextChildIs(Indexer.class,PropertyOrFieldReference.class)) {
if (result.getValue()==null && state.configuredToDynamicallyCreateNullObjects() && nextChildIs(Indexer.class,PropertyOrFieldReference.class)) {
// Creating lists and maps
if ((resultDescriptor.getType().equals(List.class) || resultDescriptor.getType().equals(Map.class))) {
// Create a new collection or map ready for the indexer