]
Geoffrey De Smet updated JBRULES-3196:
--------------------------------------
Fix Version/s: 5.3.0.Final
(was: 5.3.0.CR1)
Infinite loop instead of NPE
----------------------------
Key: JBRULES-3196
URL:
https://issues.jboss.org/browse/JBRULES-3196
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.3.0.Beta1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Priority: Critical
Fix For: 5.3.0.Final
The marked statement results in an infinite loop if the
HashMap gradeMap is not initialized. Expected behaviour
is to throw an exception, e.g. NPE.
import java.util.HashMap;
declare Student
name : String @key
gradeMap : HashMap
end
rule KickOff
when
then
Student s = new Student( "Joe" );
insert( s );
end
rule "Subject grade points"
dialect "mvel"
when
$u : Student()
then
System.out.println("Adding marks for " + $u.getName() );
$u.gradeMap["CompSc"] += 100;
###<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
LOOP
System.out.println("Marks added");
end
--
This message is automatically generated by JIRA.
For more information on JIRA, see: