[
https://issues.redhat.com/browse/DROOLS-5937?page=com.atlassian.jira.plug...
]
Toshiya Kobayashi edited comment on DROOLS-5937 at 1/11/21 9:00 PM:
--------------------------------------------------------------------
Fixed by
https://github.com/mvel/mvel/commit/0f34afbd1a5f4b0b6c0c836e2c932eac3b6d9cce
Once drools consumes mvel 2.4.12+, this JIRA will be closed.
was (Author: tkobayashi):
Fixed by
https://github.com/mvel/mvel/pull/257
Once drools consumes mvel 2.4.12+, this JIRA will be closed.
Compound assignment operation like BigDecimal_type_property
<op> Numeric/BigDecimal_value causes an unexpected result or error in MVEL.
---------------------------------------------------------------------------------------------------------------------------------------
Key: DROOLS-5937
URL:
https://issues.redhat.com/browse/DROOLS-5937
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.48.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Priority: Major
Labels: support
Attachments: reproducer_02801729_6_mvel.zip, reproducer_02801729_6e_6f.zip
Compound assignment operation like BigDecimal_type_property <op>
Numeric/BigDecimal_value causes an unexpected result or error in MVEL (org.mvel2).
When using MVEL.eval method, the result of "+=" operation is incorrect, and
"-=", "*=", "/=" operations result in an error.
- BigDecimal_type_property <op> Numeric_value (Initial value of $bus.weight is
12000B)
-- $bus.weight += 1000 ==> 1000 // incorrect result
-- $bus.weight -= 1000 ==> Error
-- $bus.weight *= 1000 ==> Error
-- $bus.weight /= 1000 ==> Error
- BigDecimal_type_property <op> BigDecimal_value (Initial value of $bus.weight and
bdv are 12000B and 1000B respectively)
-- $bus.weight += bdv ==> 1000 // incorrect result
-- $bus.weight -= bdv ==> Error
-- $bus.weight *= bdv ==> Error
-- $bus.weight /= bdv ==> Error
When using MVEL.executeExpression method, the result of "+=" operation is
correct, while "-=", "*=", "/=" operations cause an error.
- BigDecimal_type_property <op> Numeric_value (Initial value of $bus.weight is
12000B)
-- $bus.weight += 1000 ==> 13000 // correct
-- $bus.weight -= 1000 ==> Error
-- $bus.weight *= 1000 ==> Error
-- $bus.weight /= 1000 ==> Error
- BigDecimal_type_property <op> BigDecimal_value (Initial value of $bus.weight and
bdv are 12000B and 1000B respectively)
-- $bus.weight += bdv ==> 13000 // correct
-- $bus.weight -= bdv ==> Error
-- $bus.weight *= bdv ==> Error
-- $bus.weight /= bdv ==> Error
$bus.weight is a BigDecimal type property.
MVEL library should return correct result for any operations above.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)