[jboss-jira] [JBoss JIRA] Updated: (JBRULES-3112) Shift operator differs between Java and MVEL
Geoffrey De Smet (JIRA)
jira-events at lists.jboss.org
Sun Sep 25 04:02:39 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Geoffrey De Smet updated JBRULES-3112:
--------------------------------------
Fix Version/s: 5.3.0.Final
(was: 5.3.0.CR1)
> Shift operator differs between Java and MVEL
> --------------------------------------------
>
> Key: JBRULES-3112
> URL: https://issues.jboss.org/browse/JBRULES-3112
> 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: Mark Proctor
> Priority: Critical
> Fix For: 5.3.0.Final
>
>
> The following DRL file can be run without and with "dialect 'mvel'"; in the latter case rules 2 and 4 do not fire, otherwise all 4 rules fire.
> *** Using dialect Java ***
> test1 1 << 65552 = 10000
> test1 1 << 65536 = 1
> test1 1 << 65568 = 1
> test2 1 << 4294967296 = 1
> test2 1 << 65536 = 1
> test2 1 << 65552 = 10000
> test2 1 << 65568 = 1
> test3 1 << 4294967296 = 1
> test3 1 << 65536 = 1
> test3 1 << 65552 = 10000
> test4 1 << 65552 = 10000
> test4 1 << 65536 = 1
> *** Using dialect MVEL ***
> test1 1 << 65552 = 10000
> test1 1 << 65536 = 1
> test1 1 << 65568 = 1
> test3 1 << 4294967296 = 1
> test3 1 << 65536 = 1
> test3 1 << 65552 = 10000
> === 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 test1
> salience -1
> when
> $a: Integer( $one: intValue == 1 )
> $b: Integer( $shift: intValue )
> $c: Integer( $i: intValue, intValue == ($one << $shift ) )
> then
> System.out.println( "test1 " + $a + " << " + $b + " = " + Integer.toHexString( $c ) );
> end
> rule test2
> salience -2
> when
> $a: Integer( $one: intValue == 1 )
> $b: Long ( $shift: longValue )
> $c: Integer( $i: intValue, intValue == ($one << $shift ) )
> then
> System.out.println( "test2 " + $a + " << " + $b + " = " + Integer.toHexString( $c ) );
> end
> rule test3
> salience -3
> when
> $a: Long ( $one: longValue == 1 )
> $b: Long ( $shift: longValue )
> $c: Integer( $i: intValue, intValue == ($one << $shift ) )
> then
> System.out.println( "test3 " + $a + " << " + $b + " = " + Integer.toHexString( $c ) );
> end
> rule test4
> salience -4
> when
> $a: Long ( $one: longValue == 1 )
> $b: Integer( $shift: intValue )
> $c: Integer( $i: intValue, intValue == ($one << $shift ) )
> then
> System.out.println( "test4 " + $a + " << " + $b + " = " + Integer.toHexString( $c ) );
> end
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list