Red Hat Bugzilla – Bug 1019708
NPE when ksession.getQueryResults() should return empty result
Last modified: 2014-08-06 16:18:58 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):
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.
NullPointerException is thrown.
getQueryResults() should return empty result (results.size() == 0).
NPE problem appeared in some test which should return some result. Example added to pull request.
Verified on BRMS 6.0.0.ER5.