History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: OGNL-121
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jesse Kuhnert
Reporter: Toshihiro Nakamura
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OGNL

Race condition in SimpleNode#evaluateGetValueBody(OgnlContext, Object)

Created: 08/Sep/07 12:45 PM   Updated: 21/Jan/08 11:38 AM
Component/s: None
Affects Version/s: 2.6.9
Fix Version/s: 2.7.2

File Attachments: 1. Text File SimpleNode.java.patch (1 kb)


Flags: Patch


 Description  « Hide
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.

{noformat}
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);
     }
{noformat}

 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.