Bug 1019708 - NPE when ksession.getQueryResults() should return empty result
NPE when ksession.getQueryResults() should return empty result
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
Unspecified Unspecified
high Severity high
: ER5
: 6.0.0
Assigned To: Edson Tirelli
Tomas David
Depends On:
  Show dependency treegraph
Reported: 2013-10-16 05:29 EDT by Tomas David
Modified: 2014-08-06 16:18 EDT (History)
2 users (show)

See Also:
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:
Last Closed: 2014-08-06 16:18:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tomas David 2013-10-16 05:29:35 EDT
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 09:02:59 EDT
NPE problem appeared in some test which should return some result. Example added to pull request.
Comment 4 Tomas David 2013-11-29 10:14:32 EST
Verified on BRMS 6.0.0.ER5.

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