Bug 1019708

Summary: NPE when ksession.getQueryResults() should return empty result
Product: [Retired] JBoss BRMS Platform 6 Reporter: Tomas David <tdavid>
Component: BREAssignee: Edson Tirelli <etirelli>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas David <tdavid>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: rrajasek, vigoyal
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Summary: When there are no events in an entry-point in a defined DRL file OR there are events but they don't meet the defined query criteria the getQueryResults() method should return an empty result. Instead, this method throws a NullPointerException. Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:18:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tomas David 2013-10-16 09:29:35 UTC
Description of problem:
When query, which returns events from some entry-point, is defined in drl file and no events are inserted into entry point, NPE is thrown.

Empty result should be return in cases when no event is in entry-point, or when there are some events, which don't meet the conditions of query. 

Version-Release number of selected component (if applicable):
Drools 6.0.0-SNAPSHOT
Drools 6.0.0.ER4

How reproducible:
Pull request #269 submited in Drools.

Steps to Reproduce:
1. Write a drl file with one query which should return events from some entry-point.
2. Write a test with one kieSession. Don't insert any event into entry-point.
3. Run test.

Actual results:
NullPointerException is thrown.

Expected results:
getQueryResults() should return empty result (results.size() == 0).

Additional info:

Comment 2 Tomas David 2013-10-17 13:02:59 UTC
NPE problem appeared in some test which should return some result. Example added to pull request.

Comment 4 Tomas David 2013-11-29 15:14:32 UTC
Verified on BRMS 6.0.0.ER5.