From 641bc35a50a0f2b6b5eae9bbb1d50cff85454a08 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 28 Nov 2011 17:34:57 +0000 Subject: [PATCH] fixed setRootObject check in StandardEvaluationContext (SPR-8241) --- .../spel/support/StandardEvaluationContext.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java index 3a73fed410..a0cfd7547e 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2011 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. @@ -80,18 +80,14 @@ public class StandardEvaluationContext implements EvaluationContext { } - public void setRootObject(Object rootObject) { - if (this.rootObject == null) { - this.rootObject = TypedValue.NULL; - } else { - this.rootObject = new TypedValue(rootObject);//, TypeDescriptor.forObject(rootObject)); - } - } - public void setRootObject(Object rootObject, TypeDescriptor typeDescriptor) { this.rootObject = new TypedValue(rootObject, typeDescriptor); } + public void setRootObject(Object rootObject) { + this.rootObject = (rootObject != null ? new TypedValue(rootObject) : TypedValue.NULL); + } + public TypedValue getRootObject() { return this.rootObject; }