]
Mario Fusco resolved DROOLS-578.
--------------------------------
Fix Version/s: 6.2.0.Beta2
Resolution: Done
Patch merged with
add double null check to asm stub builders
------------------------------------------
Key: DROOLS-578
URL:
https://issues.jboss.org/browse/DROOLS-578
Project: Drools
Issue Type: Patch
Security Level: Public(Everyone can see)
Affects Versions: 6.1.0.Beta1, 6.1.0.Beta2, 6.1.0.Beta3, 6.1.0.Beta4, 6.1.0.CR1,
6.1.0.CR2, 6.1.0.Final
Reporter: david hendi
Assignee: Mario Fusco
Fix For: 6.2.0.Beta2
Attachments: asm-builder-double-null-check.patch
currently the code generated does a null check within the synchronized code. this forces
all threads to block while the check is made even after the check returns false. by adding
a double null check, the synchronized code is bypassed once the check is satisfied.
public void evaluate(KnowledgeHelper paramKnowledgeHelper, WorkingMemory
paramWorkingMemory)
throws Exception
{
if (this.consequence == null) {
synchronized (this) {
if (this.consequence == null) {
ConsequenceGenerator.generate(this, paramKnowledgeHelper,
paramWorkingMemory);
}
}
}
this.consequence.evaluate(paramKnowledgeHelper, paramWorkingMemory);
}