]
Davide Sottara updated DROOLS-678:
----------------------------------
Summary: Constraints index Null values as 0s (was: Coercion from 0 to null causes an
unwanted firing)
Constraints index Null values as 0s
-----------------------------------
Key: DROOLS-678
URL:
https://issues.jboss.org/browse/DROOLS-678
Project: Drools
Issue Type: Bug
Reporter: Mario Fusco
Assignee: Mario Fusco
In the following test case:
{code}
@Test
public void testAlphaIndexing() throws Exception {
String drl =
" package org.drools.test; " +
" declare ObjectB " +
" name : String " +
" intValue : Integer " +
" end " +
" rule 'insert object' " +
" when " +
" then " +
" insert( new ObjectB( null, 0 ) ); " +
" end " +
" rule 'rule 1' " +
" when " +
" ObjectB( intValue == 1 ) " +
" then " +
" end " +
" rule 'rule 2' " +
" when " +
" ObjectB( intValue == 2 ) " +
" then " +
" end " +
" rule 'rule 3' " +
" when " +
" $b : ObjectB( intValue == null ) " +
" then\n" +
" System.out.println( $b ); " +
" end" +
"\n" ;
KieHelper helper = new KieHelper();
helper.addContent( drl, ResourceType.DRL );
assertTrue( helper.verify().getMessages(
org.kie.api.builder.Message.Level.ERROR ).isEmpty() );
helper.build( ).newKieSession().fireAllRules();
}
{code}
rule 3 fires even if it shouldn't