[jboss-jira] [JBoss JIRA] Created: (JBRULES-579) NPE when imports not available
Edson Tirelli (JIRA)
jira-events at jboss.com
Thu Dec 7 06:20:55 EST 2006
NPE when imports not available
------------------------------
Key: JBRULES-579
URL: http://jira.jboss.com/jira/browse/JBRULES-579
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.1-m1
Reporter: Edson Tirelli
Assigned To: Mark Proctor
REPORTED BY DIRK BERGSTROM:
------------------------------------------------
Trying to compile this rule, I get an NPE:
package foo;
rule "Generates NPE"
when
$count : Thing( size > 0 ) from collect( Gizmo( length == 1 ) )
then
System.out.println("boo");
end
Like so:
java.lang.NullPointerException
at org.drools.rule.Rule.addDeclarations(Rule.java:316)
at org.drools.rule.Rule.addPattern(Rule.java:304)
at org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java:320)
at org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java:215)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:366)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:215)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:181)
at net.juniper.dash.DroolsTest.readRule(DroolsTest.java:106)
at net.juniper.dash.DroolsTest.main(DroolsTest.java:22)
This happens when there are two undefined classes referenced in a rule, with the
second one inside a collect() statement. If I import Thing, or import Gizmo, or
have a constraint on Gizmo not in a collect(), I get a parser exception, as
expected.
This is with Trunk, revision 8110.
--
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