[jboss-jira] [JBoss JIRA] (JBRULES-3113) MVEL accepts funny comparison and evaluates without apparent semantics
Geoffrey De Smet (Updated) (JIRA)
jira-events at lists.jboss.org
Tue Dec 20 05:15:14 EST 2011
[ https://issues.jboss.org/browse/JBRULES-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Geoffrey De Smet updated JBRULES-3113:
--------------------------------------
Fix Version/s: 5.4.0.Beta2
(was: 5.4.0.Beta1)
> MVEL accepts funny comparison and evaluates without apparent semantics
> ----------------------------------------------------------------------
>
> Key: JBRULES-3113
> URL: https://issues.jboss.org/browse/JBRULES-3113
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-compiler (expert)
> Affects Versions: 5.2.0.Final
> Reporter: Wolfgang Laun
> Assignee: Edson Tirelli
> Fix For: 5.4.0.Beta2
>
>
> Without "dialect 'mvel'", the funny expression in eval() is (correctly) refused by the compiler (" The operator == is undefined for the argument type(s) boolean, int"). Using MVEL, the rule compiles and fires, apparently with random values for $int3 and $long4:
> test5 1 1 65536 4294967296
> test5 1 1 65568 4294967296
> test5 1 1 65552 4294967296
> test5 1 1 65536 65536
> test5 1 1 65568 65536
> test5 1 1 65552 65536
> test5 1 1 65536 65568
> test5 1 1 65536 65552
> test5 1 1 65568 65568
> test5 1 1 65552 65568
> test5 1 1 65568 65552
> test5 1 1 65552 65552
> === DRL ===
> dialect "mvel"
> rule kickOff
> when
> then
> insert( Integer.valueOf( 1 ) );
> insert( Long.valueOf( 1 ) );
> insert( Integer.valueOf( 65552 ) ); // 0x10010
> insert( Long.valueOf( 65552 ) );
> insert( Integer.valueOf( 65568 ) ); // 0x10020
> insert( Long.valueOf( 65568 ) );
> insert( Integer.valueOf( 65536 ) ); // 0x10000
> insert( Long.valueOf( 65536L ) );
> insert( Long.valueOf( 4294967296L ) ); // 0x100000000L
> end
> rule test5
> salience 100
> when
> $n1: Integer( $int1: intValue == 1 )
> $n2: Long ( $long2: longValue )
> $n3: Integer( this != $n1, $int3: intValue )
> $n4: Long ( this != $n2, $long4: longValue )
> eval( $int1 == $long2 == $int3 == $long4 )
> then
> System.out.println( "test5 " + $int1 + " "
> + $long2 + " "
> + $int3 + " "
> + $long4 );
> end
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list