Check on Concurrency correctness of SimpleNode.evaluateGetValueBody
-------------------------------------------------------------------
Key: OGNL-25
URL: https://issues.apache.org/jira/browse/OGNL-25
Project: OGNL
Issue Type: Bug
Reporter: Daniel Pitts
Looking at this, it looks suspiciously like it has concurrency issues.
In particular:
<code>
if ( !_constantValueCalculated )
{
_constantValueCalculated = true;
boolean constant = isConstant( context );
if ( constant )
{
_constantValue = getValueBody( context, source );
}
_hasConstantValue = constant;
}
</code>
In concurrent situations, _constValueCalculated could get set to true, before
the rest of the if statement is completed. On top of that,
_constantValueCalculated isn't volatile, so there is no appropriate memory
barrier and data may not be set as expected.
I'll attach a patch which should fix the issues.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira