marcaurele commented on a change in pull request #2481: CLOUDSTACK-10320 -
Invalid pair for response object breaking response parsing
URL: https://github.com/apache/cloudstack/pull/2481#discussion_r175355994
##########
File path: framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
##########
@@ -1315,6 +1315,10 @@ protected void addJoins(StringBuilder str,
Collection<JoinBuilder<SearchCriteria
public Pair<List<T>, Integer> searchAndCount(final SearchCriteria<T> sc,
final Filter filter) {
List<T> objects = search(sc, filter, null, false);
Integer count = getCount(sc);
+ // Count cannot be less than the result set but can be higher due to
pagination, see CLOUDSTACK-10320
+ if (count < objects.size()) {
Review comment:
I will change how it's handled
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services