[
https://issues.redhat.com/browse/DROOLS-5231?page=com.atlassian.jira.plug...
]
Toshiya Kobayashi updated DROOLS-5231:
--------------------------------------
Description:
When a nested property is modified in modify block like this:
{noformat}
rule R1
when
$pet : Pet(age == 3)
then
modify ($pet) { getOwner().setLikes("Cookie") };
end
{noformat}
executable model creates BitMask for "owner" and "likes" thus causes a
build error.
{noformat}
[ERROR] testNestedPropInRHS[PATTERN_DSL](org.drools.modelcompiler.PropertyReactivityTest)
Time elapsed: 2.702 s <<< ERROR!
java.lang.RuntimeException: Unknown property 'likes' for class class class
org.drools.modelcompiler.domain.Pet
at
org.drools.test.DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D$org_drools_modelcompiler_domain_Pet_Metadata.getPropertyIndex(DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D.java:24)
at org.drools.model.bitmask.BitMaskUtil.calculatePatternMask(BitMaskUtil.java:61)
at org.drools.model.BitMask.getPatternMask(BitMask.java:54)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.rule_R1(Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.java:24)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.getRulesList(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:60)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.<init>(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:64)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at
org.drools.modelcompiler.CanonicalKieModule.createInstance(CanonicalKieModule.java:410)
{noformat}
was:
When a nested property is modified in modify block like this:
{noformat}
rule R1
when
$pet : Pet(age == 3)
then
modify ($pet) { getOwner().setLikes("Cookie") };
end
{noformat}
executable model creates BitMask for "owner" and "likes" thus causes a
build error.
Wrong BitMask created by a nested property in modify block
----------------------------------------------------------
Key: DROOLS-5231
URL:
https://issues.redhat.com/browse/DROOLS-5231
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.35.0.Final
Reporter: Toshiya Kobayashi
Assignee: Luca Molteni
Priority: Major
When a nested property is modified in modify block like this:
{noformat}
rule R1
when
$pet : Pet(age == 3)
then
modify ($pet) { getOwner().setLikes("Cookie") };
end
{noformat}
executable model creates BitMask for "owner" and "likes" thus causes
a build error.
{noformat}
[ERROR] testNestedPropInRHS[PATTERN_DSL](org.drools.modelcompiler.PropertyReactivityTest)
Time elapsed: 2.702 s <<< ERROR!
java.lang.RuntimeException: Unknown property 'likes' for class class class
org.drools.modelcompiler.domain.Pet
at
org.drools.test.DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D$org_drools_modelcompiler_domain_Pet_Metadata.getPropertyIndex(DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D.java:24)
at org.drools.model.bitmask.BitMaskUtil.calculatePatternMask(BitMaskUtil.java:61)
at org.drools.model.BitMask.getPatternMask(BitMask.java:54)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.rule_R1(Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.java:24)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.getRulesList(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:60)
at
org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.<init>(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:64)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at
org.drools.modelcompiler.CanonicalKieModule.createInstance(CanonicalKieModule.java:410)
{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)