Bug 1049367 - RETE-OO: NPE when using queries
Summary: RETE-OO: NPE when using queries
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: CR1
: 6.0.0
Assignee: Mario Fusco
QA Contact: Marek Winkler
Depends On:
TreeView+ depends on / blocked
Reported: 2014-01-07 13:33 UTC by Marek Winkler
Modified: 2014-08-06 20:18 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-06 20:18:14 UTC
Type: Bug

Attachments (Terms of Use)
Maven project with reproducer (16.47 KB, application/zip)
2014-01-07 13:40 UTC, Marek Winkler
no flags Details

Description Marek Winkler 2014-01-07 13:33:52 UTC
Description of problem:

When evaluating a query with forall, such as

query ifAllPersonsAreOlderReturnThem (int pAge)
    forall ( Person(age > pAge) )
    $person : Person()

the following NPE is thrown:

	at org.drools.core.util.LinkedList.add(LinkedList.java:113)
	at org.drools.core.phreak.SegmentUtilities.createSegmentMemory(SegmentUtilities.java:145)
	at org.drools.core.phreak.SegmentUtilities.createChildSegment(SegmentUtilities.java:331)
	at org.drools.core.phreak.SegmentUtilities.createChildSegments(SegmentUtilities.java:323)
	at org.drools.core.reteoo.LeftInputAdapterNode.doInsertObject(LeftInputAdapterNode.java:215)
	at org.drools.core.common.AbstractWorkingMemory.evalQuery(AbstractWorkingMemory.java:552)
	at org.drools.core.common.AbstractWorkingMemory.getQueryResults(AbstractWorkingMemory.java:446)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.getQueryResults(StatefulKnowledgeSessionImpl.java:816)

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

BRMS 6.0.0 ER7

How reproducible:

Please run QueryTest from the attached maven project with reproducer:

mvn clean test -Dtest=QueryTest -Ddrools.ruleEngine=reteoo

The test passes with phreak.

Actual results:

A NPE is thrown.

Expected results:

The test passes.
Additional info:

Comment 1 Marek Winkler 2014-01-07 13:40:33 UTC
Created attachment 846665 [details]
Maven project with reproducer

Comment 2 Mario Fusco 2014-01-08 11:51:46 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/dacb3774f

Comment 3 Marek Winkler 2014-01-23 17:41:02 UTC
Verified on BRMS 6.0.0 CR1.

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