[jboss-jira] [JBoss JIRA] Commented: (JBRULES-951) Strange NullPointerException in rule compilation with Iterator in RHS

Alexandre Gattiker (JIRA) jira-events at lists.jboss.org
Wed Jun 27 08:17:57 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBRULES-951?page=comments#action_12366999 ] 
            
Alexandre Gattiker commented on JBRULES-951:
--------------------------------------------

I found a workaround:

Iterator iter;
for (iter = list.iterator(); iter.hasNext();)
{
} 

Curiously the bug appears whether using the Eclipse or Janino compiler.

> Strange NullPointerException in rule compilation with Iterator in RHS
> ---------------------------------------------------------------------
>
>                 Key: JBRULES-951
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-951
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions:  4.0.0.MR3
>         Environment: IBM RAD 7
>            Reporter: Alexandre Gattiker
>         Assigned To: Mark Proctor
>
> Create a new Rules Project
> In Sample.drl add "import java.util.*;" at the top, and within the consequence block of one of the two rules:
> ArrayList list = new ArrayList();
> for (Iterator iter = list.iterator(); iter.hasNext();)
> {
> }
> Eclipse reports a problem:
> Severity and Description	Path	Resource	Location	Creation Time	Id
> Error: java.lang.NullPointerException	droolstest6/src/rules	Sample.drl	Unknown	1182938042901	228615
> When executing DroolsTest I get:
> java.lang.NullPointerException
> 	at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:54)
> 	at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
> 	at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:390)
> 	at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:264)
> 	at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:147)
> 	at com.sample.DroolsTest.readRule(DroolsTest.java:54)
> 	at com.sample.DroolsTest.main(DroolsTest.java:21)
> With 4.0.0.MR2 the bug does not happen.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list