[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-579) NPE when imports not available
Edson Tirelli (JIRA)
jira-events at jboss.com
Thu Dec 14 11:05:47 EST 2006
[ http://jira.jboss.com/jira/browse/JBRULES-579?page=all ]
Edson Tirelli resolved JBRULES-579.
-----------------------------------
Fix Version/s: 3.1-m1
Resolution: Done
$ svn log -r 8315 -v
------------------------------------------------------------------------
r8315 | tirelli | 2006-12-14 13:02:20 -0300 (Thu, 14 Dec 2006) | 1 line
Changed paths:
M /labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/semantics/java/RuleBuilder.java
M /labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java
A /labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_missing_import.drl
JBRULES-579: fixing NPE when not able to resolve object types for 'from', 'collect' and 'accumulate' constructs
------------------------------------------------------------------------
> 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: Edson Tirelli
> Fix For: 3.1-m1
>
>
> 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