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

Mario Fusco (Commented) (JIRA) jira-events at lists.jboss.org
Wed Oct 5 11:01:16 EDT 2011


    [ https://issues.jboss.org/browse/JBRULES-3196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632508#comment-12632508 ] 

Mario Fusco commented on JBRULES-3196:
--------------------------------------

This issue is definitively caused by MVEL. I sent a pull request that should fix it: https://github.com/mvel/mvel/pull/20
                
> 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.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.
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

        


More information about the jboss-jira mailing list