-
Bug
-
Resolution: Fixed
-
Trivial
-
1.3.4
-
None
-
-
Empty show more show less
the following line
subList = ((List)items).subList(offset, limit);
generates an exception
java.lang.IllegalArgumentException: fromIndex(4) > toIndex(2)
if offset is larger than limit.
FIX:
public Collection getPageItems() {
Collection subList = items;
int offset = getOffset();
if(count > 0) {
int limit = maxResultsPerPage + offset;
if(items.size() < limit)
if(offset < limit)
{ subList = ((List)items).subList(offset, limit); }else
{ subList = items; } }
return subList;
}
This error happens if the GET Parameter currentPage is set (for example from an old session or an old link), but there are not enought items in the current Collection.
- is causing
-
MGNLSTK-744 Paging broken due to wrong offset calculation
- Closed