[
https://issues.jboss.org/browse/JBRULES-3196?page=com.atlassian.jira.plug...
]
Geoffrey De Smet updated JBRULES-3196:
--------------------------------------
Fix Version/s: 5.4.0.Beta1
(was: 5.3.0.Final)
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: Mario Fusco
Priority: Critical
Fix For: 5.4.0.Beta1
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.
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