[jboss-jira] [JBoss JIRA] (DROOLS-5237) Wrong property reactivity with non getter chain of argume
Toshiya Kobayashi (Jira)
issues at jboss.org
Wed Apr 15 22:55:47 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 argume (was: Wrong property reactivity with non getter chain outside of modify block)
> Wrong property reactivity with non getter chain of argume
> ---------------------------------------------------------
>
> 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
>
> The rule below causes 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.
> https://github.com/kiegroup/drools/blob/master/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/DialectUtil.java#L698-L700
> Executable model follows the approach in this commit:
> https://github.com/kiegroup/drools/commit/fc924465437919d5b6bd99849ee595e6e7ebf957
> but executable model evaluates method calls outside of modify block while standard-drl evaluates only inside modify block.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list