[jboss-jira] [JBoss JIRA] (DROOLS-2928) Wrong division calculation in Mvel Jitted constraint
Mario Fusco (JIRA)
issues at jboss.org
Mon Aug 27 04:48:00 EDT 2018
[ https://issues.jboss.org/browse/DROOLS-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco updated DROOLS-2928:
--------------------------------
Sprint: 2018 Week 33-35
> Wrong division calculation in Mvel Jitted constraint
> ----------------------------------------------------
>
> Key: DROOLS-2928
> URL: https://issues.jboss.org/browse/DROOLS-2928
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.10.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Mario Fusco
> Labels: support
>
> For a constraint like "age > ((2*$age1)/3) ", Mvel Jitting generates a class like:
> {code:java}
> public class ConditionEvaluator251ed544c9124e1d99d3a8cae5048e1a
> implements ConditionEvaluator
> {
> public boolean evaluate(InternalFactHandle internalfacthandle, InternalWorkingMemory internalworkingmemory, Tuple tuple)
> {
> Tuple tuple1 = tuple;
> int i = declarations[0].getIntValue(internalworkingmemory, tuple1.getFactHandle().getObject());
> return ((Person)internalfacthandle.getObject()).getAge() > 2 * i * 3;
> }
> public ConditionEvaluator251ed544c9124e1d99d3a8cae5048e1a(Declaration adeclaration[])
> {
> declarations = adeclaration;
> }
> private static final String EXPRESSION = "age > ((2*$age1)/3)";
> private final Declaration declarations[];
> }
> {code}
> The division is wrongly generated like "getAge() > 2 * i * 3".
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list