Bug 1060033

Summary: Inconsistent behavior of "contains" operator
Product: [Retired] JBoss BRMS Platform 6 Reporter: Mario Fusco <mfusco>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: kverlaen, mbaluch
Target Milestone: ER1   
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:59:15 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:
Embargoed:

Description Mario Fusco 2014-01-31 09:48:45 UTC
The compiler accepts constraints such as

Person( fullName contains 'Jr' )  // should be fullName.contains('Jr')

Interestingly, MVEL evaluates it as the string operation "contains", but
once the constraint is jitted it is again evaluated as a collection operator.

That is, a rule such as:

  when
    $s : String( this contains "foo" ) 
  then

with inputs "foo1" .. "fooN" effectively fires an unpredictable number of times before starting to fail silently

Comment 2 Mario Fusco 2014-01-31 09:55:33 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/31cfa285f

Comment 3 JBoss JIRA Server 2014-01-31 09:56:00 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-388 to Resolved

Comment 4 Marek Winkler 2014-02-21 19:24:59 UTC
Verified that the fix is present in BRMS 6.0.1 ER1 and the corresponding test passes.