-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align OffsetScrolling to zero-based indexes #3415
Conversation
@@ -259,7 +259,7 @@ public Query createQuery(JpaParametersParameterAccessor accessor) { | |||
@SuppressWarnings("ConstantConditions") | |||
private Query restrictMaxResultsIfNecessary(Query query, @Nullable ScrollPosition scrollPosition) { | |||
|
|||
if (scrollPosition instanceof OffsetScrollPosition offset) { | |||
if (scrollPosition instanceof OffsetScrollPosition offset && !offset.isInitial()) { | |||
query.setFirstResult(Math.toIntExact(offset.getOffset())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be +1 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should, guess we're lacking a test for that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope the test was there but the testsetup should have changed
Depends on: spring-projects/spring-data-commons#3072