From 1cd77e2a152027c25f133d2cf50c00bf0189607a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 10 Oct 2010 20:11:53 +0000 Subject: [PATCH] polishing --- .../expression/spel/ast/PropertyOrFieldReference.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java index a3292bb0ab3..60da3da74da 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java @@ -160,7 +160,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl { TypedValue contextObject = state.getActiveContextObject(); Object targetObject = contextObject.getValue(); - if (targetObject == null && nullSafe) { + if (targetObject == null && this.nullSafe) { return TypedValue.NULL; } @@ -188,7 +188,8 @@ public class PropertyOrFieldReference extends SpelNodeImpl { for (PropertyAccessor accessor : accessorsToTry) { if (accessor.canRead(eContext, contextObject.getValue(), name)) { if (accessor instanceof ReflectivePropertyAccessor) { - accessor = ((ReflectivePropertyAccessor)accessor).createOptimalAccessor(eContext, contextObject.getValue(), name); + accessor = ((ReflectivePropertyAccessor) accessor).createOptimalAccessor( + eContext, contextObject.getValue(), name); } this.cachedReadAccessor = accessor; return accessor.read(eContext, contextObject.getValue(), name); @@ -203,7 +204,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl { throw new SpelEvaluationException(SpelMessage.PROPERTY_OR_FIELD_NOT_READABLE_ON_NULL, name); } else { - throw new SpelEvaluationException(getStartPosition(),SpelMessage.PROPERTY_OR_FIELD_NOT_READABLE, name, + throw new SpelEvaluationException(getStartPosition(), SpelMessage.PROPERTY_OR_FIELD_NOT_READABLE, name, FormatHelper.formatClassNameForMessage(contextObjectClass)); } }