blaze-persistence
blaze-persistence copied to clipboard
Potential java.lang.ClassCastException in KeysetAwarePageImpl#nextPageable
trafficstars
The current implementation of KeysetAwarePageImpl#nextPageable is:
@Override
public KeysetPageable nextPageable() {
return (KeysetPageable) super.nextPageable();
}
This assumes that super.nextPageable() always returns a KeysetPageable, which is not true. If hasNext() is false for the page, super.nextPageable() will return Pageable.unpaged() which is not instanceof KeysetPageable.