[
https://issues.jboss.org/browse/JBRULES-3715?page=com.atlassian.jira.plug...
]
Mario Fusco commented on JBRULES-3715:
--------------------------------------
Considering that in Java:
new BigDecimal("0").equals(new BigDecimal("0.0"))
is false I'd actually say that it starts working only after a certain number of
times.
To be more precise the constraints are evaluated in an interpreted mode (using mvel) for
that "certain number of times" and after that they get jitted via ASM and run in
compiled mode. The problem is that, while the jitted constraint applies the Java semantic
above and correctly returns false, the interpreted (mvel) one does something slightly
different and actually evaluates
new BigDecimal("0").compareTo(new BigDecimal("0.0")) == 0
that evaluates to true.
We are still discussing which of these 2 semantics fits better the drools needs but in the
meanwhile I strongly suggest to stick with the Java semantic and consider 0.0B and 0B as 2
different numbers.
when using BigDecimal Comparing to 0 only works for a certain number
of time
----------------------------------------------------------------------------
Key: JBRULES-3715
URL:
https://issues.jboss.org/browse/JBRULES-3715
Project: JBRULES
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: All
Affects Versions: 5.4.0.Final
Environment: Jdk1.6; Drools 5.5
Reporter: Nicolas Heron
Assignee: Mario Fusco
Attachments: BugBigDecimalDrools.zip
in a rule like this :
rule "Hello World"
dialect "mvel"
no-loop
when
$c : Contract( aValue == 0.0B )
then
$c.setDone("OK");
update($c);
end
when called a certain number of times, the comparaison does not work
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira