Bug 1060033 - Inconsistent behavior of "contains" operator
Summary: Inconsistent behavior of "contains" operator
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER1
: 6.0.1
Assignee: Mario Fusco
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-31 09:48 UTC by Mario Fusco
Modified: 2014-08-06 19:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:59:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-388 0 Minor Resolved Inconsistent behavior of "contains" operator 2015-11-04 15:52:32 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.