Please sign in to comment.
Empty result iterator's hasNext() returning true
Calling hasNext() method on an empty lazy-loaded query result iterator returns true while next() method returns null. Consequently, iterating over such a list results in a single null element being processed. The reason for this strange behavior is QueryResultIterator's hasNext() relying on the existence of at least one candidate result, failing to check if candidate's cursor contains at least one object. This quick fix ensures that only candidates with a non-empty cursor are added to query result candidate list.
- Loading branch information...
Showing with 4 additions and 1 deletion.