[jboss-jira] [JBoss JIRA] Updated: (JBRULES-3196) Infinite loop instead of NPE

Mark Proctor (JIRA) jira-events at lists.jboss.org
Thu Sep 29 03:05:29 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-3196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor updated JBRULES-3196:
----------------------------------

    Assignee: Edson Tirelli  (was: Mark Proctor)


> 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: Edson Tirelli
>            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: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list