Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.6.9
-
None
-
None
-
Patch
Description
SimpleNode#evaluateGetValueBody(OgnlContext, Object) might return null.
I have a patch that resolves the issue for version 2.6.9. Same issue might be in the above vesions.
Index: C:/User/Work/workspace/ognl/src/java/ognl/SimpleNode.java =================================================================== --- C:/User/Work/workspace/ognl/src/java/ognl/SimpleNode.java (revision 139) +++ C:/User/Work/workspace/ognl/src/java/ognl/SimpleNode.java (working copy) @@ -44,7 +44,7 @@ protected OgnlParser parser; private boolean constantValueCalculated; - private boolean hasConstantValue; + private volatile boolean hasConstantValue; private Object constantValue; public SimpleNode(int i) { @@ -162,10 +162,11 @@ context.setCurrentNode(this); if (!constantValueCalculated) { constantValueCalculated = true; - hasConstantValue = isConstant(context); - if (hasConstantValue) { + boolean constant = isConstant(context); + if (constant) { constantValue = getValueBody(context, source); } + hasConstantValue = constant; } return hasConstantValue ? constantValue : getValueBody(context, source); }