Bug 1300692

Summary: Parsing of a complex constraint with an || causes a RuntimeException
Product: [Retired] JBoss BRMS Platform 6 Reporter: Martin Weiler <mweiler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0   
Target Milestone: DR2   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1300699 (view as bug list) Environment:
Last Closed: 2020-03-27 19:36:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1300699    

Description Martin Weiler 2016-01-21 13:19:23 UTC
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\")) )

Comment 2 Mario Fusco 2016-01-26 14:16:27 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/2b80add23

Comment 3 Marek Winkler 2016-03-18 14:58:52 UTC
Verified in BRMS 6.3.0.ER1.