AccumulateNode runs into NPE
----------------------------
Key: JBRULES-2953
URL:
https://issues.jboss.org/browse/JBRULES-2953
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.1.1.FINAL
Reporter: Alessandro Lazarotti
Assignee: Edson Tirelli
Priority: Critical
Fix For: 5.2.0.M1
Attachments: DroolsTest.java, JB2887.zip, SampleAlarmRules.drl
A rule such as
rule "average"
when
B( id < 10 )
$list: List() from collect ( A() over window:time(10s) )
Number( $avg: doubleValue ) from accumulate( A( $id : id ) from $list, average(
$id ) )
then
System.out.println( "average = " + $avg );
end
runs into a NPE
Caused by: java.lang.NullPointerException
at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:967)
at org.drools.reteoo.AccumulateNode.splitList(AccumulateNode.java:920)
at
org.drools.reteoo.AccumulateNode.removePreviousMatchesForLeftTuple(AccumulateNode.java:874)
at org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:205)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:238)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTupleDestroyRightTuple(CompositeLeftTupleSinkAdapter.java:138)
at org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:212)
at org.drools.reteoo.ModifyPreviousTuples.retractTuples(ModifyPreviousTuples.java:111)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:176)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:450)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:361)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:183)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:196)
at event.Rule_launch_0.defaultConsequence(Rule_launch_0.java:7)
at
event.Rule_launch_0DefaultConsequenceInvoker.evaluate(Rule_launch_0DefaultConsequenceInvoker.java:33)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:913)
A null Parameter accctx is passed down from retractLeftTuple.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira