[jboss-jira] [JBoss JIRA] (DROOLS-388) Inconsistent behavior of "contains" operator
Davide Sottara (JIRA)
issues at jboss.org
Sat Dec 28 23:34:32 EST 2013
[ https://issues.jboss.org/browse/DROOLS-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Sottara updated DROOLS-388:
----------------------------------
Description:
The compiler accepts constraints such as
{code}
Person( fullName contains 'Jr' ) // should be fullName.contains('Jr')
{code}
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:
{code}
when
$s : String( this contains "foo" )
then
{code}
with inputs "foo1" .. "fooN" effectively fires an unpredictable number of times before starting to fail silently
was:
The compiler accepts constraints such as
{code}
Person( fullName contains 'Jr' ) // should be fullName.contains('Jr')
{code}
Interestingly, MVEL evaluates it as the string "contains", but once
the constraint is jitted it is again evaluated as a collection operator.
That is, a rule such as:
{code}
when
$s : String( this contains "foo" )
then
{code}
with inputs "foo1" .. "fooN" effectively fires an unpredictable number of times before starting to fail silently
> Inconsistent behavior of "contains" operator
> --------------------------------------------
>
> Key: DROOLS-388
> URL: https://issues.jboss.org/browse/DROOLS-388
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.1.Final, 6.0.0.Final
> Reporter: Davide Sottara
> Assignee: Mario Fusco
> Priority: Minor
>
> The compiler accepts constraints such as
> {code}
> Person( fullName contains 'Jr' ) // should be fullName.contains('Jr')
> {code}
> 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:
> {code}
> when
> $s : String( this contains "foo" )
> then
> {code}
> with inputs "foo1" .. "fooN" effectively fires an unpredictable number of times before starting to fail silently
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list