Bug 980385 - NPE when compiling DRL with two timers
NPE when compiling DRL with two timers
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity high
: DR6
: 6.0.0
Assigned To: Mario Fusco
Marek Winkler
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-02 04:44 EDT by Marek Winkler
Modified: 2014-08-06 16:16 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:16:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Winkler 2013-07-02 04:44:29 EDT
Description of problem:

When compiling the following DRL:

package ...

import java.util.Date
import java.util.List

global List dates

rule "intervalRule"
  timer(int: 200ms 100ms)
when
  String(this == "intervalRule")
then
  Date date = new Date();
  dates.add(date);
end


// this rule stops timer
rule "stopIntervalRule"
  timer(int: 320ms)
when
  $s : String(this == "intervalRule")
then
  retract($s);
end

The following NPE is thrown:

java.lang.NullPointerException: null
	at org.drools.core.reteoo.TimerNode.equals(TimerNode.java:170)
	at org.drools.core.reteoo.SingleLeftTupleSinkAdapter.getMatchingNode(SingleLeftTupleSinkAdapter.java:159)
	at org.drools.core.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:122)
	at org.drools.core.reteoo.builder.TimerBuilder.build(TimerBuilder.java:68)
	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:170)
	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:136)
	at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:112)
	at org.drools.core.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:429)
	at org.drools.core.common.AbstractRuleBase.addRule(AbstractRuleBase.java:924)
	at org.drools.core.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:600)
	at org.drools.core.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:456)
	at org.drools.core.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:152)
	at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:133)
	at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:81)


Version-Release number of selected component (if applicable):

Drools 6.0.0-SNAPSHOT
Drools 6.0.0.Beta4

This worked in 6.0.0.Beta3, marking as regression.


Additional info:

The stacktrace contains classes from package org.drools.core.reteoo - should they be there when using phreak?
Comment 1 Mario Fusco 2013-07-02 05:37:50 EDT
Fixed.
Comment 2 Marek Winkler 2013-08-08 11:31:44 EDT
Verified on 6.0.0.DR6.

Note You need to log in before you can comment on or make changes to this bug.