Skip to content

Commit 81e9f6c

Browse files
committed
fixed setRootObject check in StandardEvaluationContext (SPR-8241)
1 parent 1843bdd commit 81e9f6c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

org.springframework.expression/src/main/java/org/springframework/expression/spel/support/StandardEvaluationContext.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,18 +80,14 @@ public StandardEvaluationContext(Object rootObject) {
8080
}
8181

8282

83-
public void setRootObject(Object rootObject) {
84-
if (this.rootObject == null) {
85-
this.rootObject = TypedValue.NULL;
86-
} else {
87-
this.rootObject = new TypedValue(rootObject);//, TypeDescriptor.forObject(rootObject));
88-
}
89-
}
90-
9183
public void setRootObject(Object rootObject, TypeDescriptor typeDescriptor) {
9284
this.rootObject = new TypedValue(rootObject, typeDescriptor);
9385
}
9486

87+
public void setRootObject(Object rootObject) {
88+
this.rootObject = (rootObject != null ? new TypedValue(rootObject) : TypedValue.NULL);
89+
}
90+
9591
public TypedValue getRootObject() {
9692
return this.rootObject;
9793
}

0 commit comments

Comments
 (0)