[jboss-jira] [JBoss JIRA] (DROOLS-5237) Wrong property reactivity with non getter chain of non-direct statements
Toshiya Kobayashi (Jira)
issues at jboss.org
Wed Apr 15 23:02:18 EDT 2020
[ https://issues.redhat.com/browse/DROOLS-5237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Toshiya Kobayashi updated DROOLS-5237:
--------------------------------------
Summary: Wrong property reactivity with non getter chain of non-direct statements (was: Wrong property reactivity with non getter chain of argume)
> Wrong property reactivity with non getter chain of non-direct statements
> ------------------------------------------------------------------------
>
> Key: DROOLS-5237
> URL: https://issues.redhat.com/browse/DROOLS-5237
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.36.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> DROOLS-5025 solves a case like this by exclude getter property from property reactivity mask.
> {noformat}
> rule R1 when
> $p : Person( name == "Mario" )
> then
> System.out.println("name = " + $p.getName());
> modify($p) { setAge(41) };
> end
> {noformat}
> However, there are still some cases which cause unexpected property reactivity.
> For example, the rule below causes an infinite loop with executable model because "name" is considered as modified property.
> {noformat}
> rule R1 when
> $p : Person( name == "Mario" )
> then
> System.out.println("name.length = " + $p.getName().length());
> modify($p) { setAge(41) };
> end
> {noformat}
> In standard-drl (DialectUtil.parseModifiedProperties), "getter + otherMethod" chain is considered that the property is modified. So excutable model follows the same.
> However, executable model evaluates all method calls in RHS while standard-drl evaluates only direct statements like "setName("AAA");" or "getName().xxx();". executable model also should follow.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list