[jboss-jira] [JBoss JIRA] Created: (JBRULES-1747) Null pointer exception from AbstractRuleBase.addPackage when loading rules scoped with parens

Joe Re (JIRA) jira-events at lists.jboss.org
Wed Aug 20 01:02:23 EDT 2008


Null pointer exception from AbstractRuleBase.addPackage when loading rules scoped with parens
---------------------------------------------------------------------------------------------

                 Key: JBRULES-1747
                 URL: https://jira.jboss.org/jira/browse/JBRULES-1747
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder, Reteoo
    Affects Versions:  5.0.0.M2, FUTURE
         Environment: Windows XP, 1.5.0_12, drools trunk rev 21627
            Reporter: Joe Re
            Assignee: Mark Proctor


The drl below produces a null pointer exception when calling ruleBase.addPackage(Drl). If the extra parens after the "||" are removed the exception doesn't occur. The rule compiles and runs successfully in 5.0M1.

/***********EXCEPTION****************************/
java.lang.NullPointerException
	at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:418)
	at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:380)
	at com.sample.DroolsTest.readRule(DroolsTest.java:75)
	at com.sample.DroolsTest.main(DroolsTest.java:26)
/*************************************************/

/*********TEST DRL****************************/
package test;

import com.sample.TestInput;

rule "TestRule"
	when
		TestInput( valOne ==true ||(valOne==false && doubVal ==0)  )
	then
		
end
/*************************************************/

/***********************TEST INPUT JAVA***********************/
package com.sample;

public class TestInput {

	public boolean valOne;
	public boolean valTwo;
	public double doubVal;
	
	public boolean getValOne() {
		return valOne;
	}
	public void setValOne(boolean valOne) {
		this.valOne = valOne;
	}
	public boolean getValTwo() {
		return valTwo;
	}
	public void setValTwo(boolean valTwo) {
		this.valTwo = valTwo;
	}
	public double getDoubVal() {
		return doubVal;
	}
	public void setDoubVal(double doubVal) {
		this.doubVal = doubVal;
	}	
}

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

        



More information about the jboss-jira mailing list