DATACMNS-713 - Disabled total adaption in PageImpl for empty pages.

The newly introduced adaption of the total in PageImpl must only be applied if the page accessed is not empty.
This commit is contained in:
Oliver Gierke
2015-06-19 15:26:40 +02:00
parent c49f8357b6
commit 3a2dc3d1d4
2 changed files with 11 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ public class PageImpl<T> extends Chunk<T> implements Page<T> {
super(content, pageable);
this.pageable = pageable;
this.total = pageable != null && pageable.getOffset() + pageable.getPageSize() > total
this.total = !content.isEmpty() && pageable != null && pageable.getOffset() + pageable.getPageSize() > total
? pageable.getOffset() + content.size() : total;
}