Bug 1019708 - NPE when ksession.getQueryResults() should return empty result
Summary: NPE when ksession.getQueryResults() should return empty result
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER5
: 6.0.0
Assignee: Edson Tirelli
QA Contact: Tomas David
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-16 09:29 UTC by Tomas David
Modified: 2014-08-06 20:18 UTC (History)
2 users (show)

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:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:18:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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