Red Hat Bugzilla – Bug 1300692
Parsing of a complex constraint with an || causes a RuntimeException
Last modified: 2017-05-24 01:33:12 EDT
Description of problem: Platform issue for DROOLS-1037 to fix the following RuntimeException during compilation: java.lang.RuntimeException at org.drools.compiler.rule.builder.PatternBuilder.rewriteCompositeExpressions(PatternBuilder.java:924) at org.drools.compiler.rule.builder.PatternBuilder.rewriteCompositeExpressions(PatternBuilder.java:919) at org.drools.compiler.rule.builder.PatternBuilder.rewriteOrExpressions(PatternBuilder.java:893) at org.drools.compiler.rule.builder.PatternBuilder.buildExpression(PatternBuilder.java:889) at org.drools.compiler.rule.builder.PatternBuilder.buildCcdDescr(PatternBuilder.java:860) at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:715) at org.drools.compiler.rule.builder.PatternBuilder.processConstraintsAndBinds(PatternBuilder.java:580) Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Build a rule with the following LHS: $p : Person( name == null || (name in (\"Alice\", \"Charlie\", \"David\"))==false ) 2. Try to compile the package Actual results: Build fails with RuntimeException Expected results: Build is successful Additional info: Changing the constraint to the following works as well: $p : Person( name == null || (name not in (\"Alice\", \"Charlie\", \"David\")) )
Fixed by https://github.com/droolsjbpm/drools/commit/2b80add23
Verified in BRMS 6.3.0.ER1.