[JBoss JIRA] (DROOLS-4334) Type coercion with Map.get() after jitting
by Mario Fusco (Jira)
[ https://issues.jboss.org/browse/DROOLS-4334?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-4334:
--------------------------------
Sprint: 2019 Week 29-31
> Type coercion with Map.get() after jitting
> ------------------------------------------
>
> Key: DROOLS-4334
> URL: https://issues.jboss.org/browse/DROOLS-4334
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.24.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Mario Fusco
> Priority: Major
> Labels: support
>
> When comparing an Integer taken from Map.get() with a String, Mvel coerces the type so they are compared as Integers.
> For example, here $map.get("key") returns Integer 5, $status is String "10". So it doesn't match (expected).
> {noformat}
> rule R when
> FactWithMap( $map : valueMap )
> Person( $status : status, $map.get("key") >= $status)
> then
> end
> {noformat}
> However, after jitting, the constraint is evaluated as true so the rule is fired (unexpected).
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (DROOLS-4334) Type coercion with Map.get() after jitting
by Toshiya Kobayashi (Jira)
Toshiya Kobayashi created DROOLS-4334:
-----------------------------------------
Summary: Type coercion with Map.get() after jitting
Key: DROOLS-4334
URL: https://issues.jboss.org/browse/DROOLS-4334
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.24.0.Final
Reporter: Toshiya Kobayashi
Assignee: Mario Fusco
When comparing an Integer taken from Map.get() with a String, Mvel coerces the type so they are compared as Integers.
For example, here $map.get("key") returns Integer 5, $status is String "10". So it doesn't match (expected).
{noformat}
rule R when
FactWithMap( $map : valueMap )
Person( $status : status, $map.get("key") >= $status)
then
end
{noformat}
However, after jitting, the constraint is evaluated as true so the rule is fired (unexpected).
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years