Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #279 from josejulio/bugs/1367505
Browse files Browse the repository at this point in the history
Bug 1367505 - Trims result to match page controls.
  • Loading branch information
josejulio committed Dec 29, 2016
2 parents fef5e1d + d5510f1 commit 31b1995
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -299,6 +299,12 @@ public int compare(Object o1, Object o2) {
}
});

// Trim modifiedResults to match pc.
modifiedResults = modifiedResults.subList(
Math.min(pc.getStartRow(), modifiedResults.size()),
Math.min(pc.getStartRow() + pc.getPageSize(), modifiedResults.size())
);

return new PageList<PackageVersionComposite>(modifiedResults, (int) count, pc);
}

Expand Down Expand Up @@ -385,6 +391,12 @@ public int compare(Object o1, Object o2) {
}
});

// Trim finalResults to match pc.
finalResults = finalResults.subList(
Math.min(pc.getStartRow(), finalResults.size()),
Math.min(pc.getStartRow() + pc.getPageSize(), finalResults.size())
);

return new PageList<PackageVersionComposite>(finalResults, (int) count, pc);
}

Expand Down

0 comments on commit 31b1995

Please sign in to comment.