Matteo Casalino created DROOLS-5224:
---------------------------------------
Summary: KieBase build fails with forall patterns containing "not
equal" constraints on Dates
Key: DROOLS-5224
URL:
https://issues.redhat.com/browse/DROOLS-5224
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.35.0.Final, 7.34.0.Final, 7.33.0.Final
Reporter: Matteo Casalino
Assignee: Mario Fusco
Attachments: forall-not-equal-constraint-on-dates.zip
This is the same issue as
https://issues.redhat.com/browse/DROOLS-5100, but on Dates.
As of Drools 7.33.0.Final, forall patterns with "not equal" (!=) constraints on
Dates will break when building the KieBase.
For example the following DRL:
{noformat}
rule "forall with not equal"
when forall(java.util.Date(this != "29-Dec-2019"))
then
end
{noformat}
generates the following error:
{noformat}
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at
org.drools.core.rule.constraint.MvelConstraint.getLeftInExpression(MvelConstraint.java:608)
at org.drools.core.rule.constraint.MvelConstraint.hashCode(MvelConstraint.java:602)
at org.drools.core.reteoo.AlphaNode.calculateHashCode(AlphaNode.java:189)
at org.drools.core.reteoo.AlphaNode.<init>(AlphaNode.java:89)
at
org.drools.core.reteoo.builder.PhreakNodeFactory.buildAlphaNode(PhreakNodeFactory.java:88)
at
org.drools.core.reteoo.builder.PatternBuilder.buildAlphaNodeChain(PatternBuilder.java:360)
at
org.drools.core.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:346)
at
org.drools.core.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:136)
at org.drools.core.reteoo.builder.PatternBuilder.build(PatternBuilder.java:84)
at
org.drools.core.reteoo.builder.GroupElementBuilder$NotBuilder.build(GroupElementBuilder.java:220)
at
org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
at
org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:108)
at
org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
at
org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:167)
at
org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:139)
at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
at
org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1525)
at
org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:926)
at
org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:728)
at
org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:745)
at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:728)
at
org.drools.compiler.kie.builder.impl.AbstractKieModule.createKieBase(AbstractKieModule.java:226)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:407)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:375)
{noformat}
This is working fine when using Drools <= 7.32.0.Final.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)