This repository was archived by the owner on Oct 27, 2020. It is now read-only.
[ALF-22050] CQ: Allow to recover empty pagings #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requesting a paging wich does not exist should return either null, either an empty paging which can give the information on the absence of results.
Currently, the only way to know the number of results in a PagingResult is to call
PagingResults#getPage()
.The problem is that this method throws an exception if the paging has no results when asking an out-of-bound page (for example asking for page two with 10 items in a query which has only 9 results).
Even if most of the time the developer has control over the paging of his request, it is not fundamentally wrong to ask for a not existing paging. It is like making a query which has no results, and in this case no exception is raised.