[jboss-jira] [JBoss JIRA] (DROOLS-42) Equality comparison between classes of different types compiles but fails at runtime
Mario Fusco (JIRA)
jira-events at lists.jboss.org
Mon Feb 18 10:01:56 EST 2013
[ https://issues.jboss.org/browse/DROOLS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-42.
-------------------------------
Resolution: Done
fixed with mvel 2.1.5.Final
> Equality comparison between classes of different types compiles but fails at runtime
> ------------------------------------------------------------------------------------
>
> Key: DROOLS-42
> URL: https://issues.jboss.org/browse/DROOLS-42
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: Mario Fusco
> Assignee: Mario Fusco
>
> Below is a fully self-contained DRL that compiles correctly but runs into a runtime error when the LHS of rule "match" is evaluated. The "culprit" is the test "this != $c", but one would expect simply a true result from the comparison.
> {code}
> declare Person
> name: String
> end
> declare Customer
> extends Person
> rating: int
> end
> declare Employee
> extends Person
> wage: int
> end
> rule initphone
> salience 100
> when
> then
> insert( new Customer( "Joe", 100 ) );
> insert( new Employee( "Paul", 2100 ) );
> end
> rule match
> when
> $c: Customer()
> $e: Employee( this != $c )
> then
> System.out.println( "c/e " + $c + " " + $e );
> end
> {code}
--
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