Hi,
I was investigating this issue and just found the cause of the double
evaluation of the pattern. The problem is in the
EqualityEvaluatorsDefinition.BooleanEqualEvaluator.evaluate() method:
https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/jav...
As you can see here the extractor is invoked twice: first with isNullValue()
and then with getBooleanValue() and both these invocations cause in turn the
evaluation of the pattern.
Unfortunately this is necessary to avoid a NullPointerException when
unboxing the primitive type. The (ugly) alternative would be to just invoke
the getBooleanValue() method in a try/catch block and act accordingly when a
NPE is thrown.
The good news is that I just finished to develop a totally new (and faster)
implementation of constraints evaluation. I already checked that this new
implementation doesn't suffer of this issue and it will be available in
Drools 5.4.
Mario
--
View this message in context:
http://drools.46999.n3.nabble.com/Error-in-MVEL-execution-optimization-tp...
Sent from the Drools: User forum mailing list archive at
Nabble.com.