Skip to content

Use Pageable.unpaged(sort) for sorted unpaged pageable #2865

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

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Jun 18, 2023

Fix

java.lang.UnsupportedOperationException
	at org.springframework.data.domain.Unpaged.getPageNumber(Unpaged.java)
	at org.springframework.data.web.ReactivePageableHandlerMethodArgumentResolver.resolveArgumentValue(ReactivePageableHandlerMethodArgumentResolver.java)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 18, 2023
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 19, 2023
@odrotbohm odrotbohm force-pushed the main branch 2 times, most recently from fe5e80e to 98f20a4 Compare August 2, 2023 15:20
@mp911de mp911de force-pushed the main branch 2 times, most recently from 0122d1b to 5070a0f Compare August 21, 2023 12:07
@themadprofessor
Copy link

Would it be possible to handle sorted unpaged pagables as well?

Fix
java.lang.UnsupportedOperationException
	at org.springframework.data.domain.Unpaged.getPageNumber(Unpaged.java)
	at org.springframework.data.web.ReactivePageableHandlerMethodArgumentResolver.resolveArgumentValue(ReactivePageableHandlerMethodArgumentResolver.java)
@quaff quaff changed the title Skip applying Sort if Pageable is unpaged Use Pageable.unpaged(sort) for sorted unpaged pageable Mar 20, 2024
@quaff
Copy link
Contributor Author

quaff commented Mar 20, 2024

Would it be possible to handle sorted unpaged pagables as well?

Thanks for your suggestion, I've updated the PR.

odrotbohm pushed a commit that referenced this pull request May 14, 2024
The (Reactive)PageableHandlerMethodArgumentResolver now falls back to a unpaged Pageable instance with a resolved sort if the the resolved Pageable is unpaged.

Fixes: GH-3094
Original pull request: GH-2865
odrotbohm added a commit that referenced this pull request May 14, 2024
Ternary ifs and less nesting.

Related: GH-3094
Original pull request: GH-2865
odrotbohm pushed a commit that referenced this pull request May 14, 2024
The (Reactive)PageableHandlerMethodArgumentResolver now falls back to a unpaged Pageable instance with a resolved sort if the the resolved Pageable is unpaged.

Fixes: GH-3094
Original pull request: GH-2865
odrotbohm added a commit that referenced this pull request May 14, 2024
Ternary ifs and less nesting.

Related: GH-3094
Original pull request: GH-2865
@odrotbohm
Copy link
Member

That's been polished and merged. Thanks!

@odrotbohm odrotbohm closed this May 14, 2024
@odrotbohm odrotbohm removed the type: bug A general bug label May 14, 2024
natedanner pushed a commit to natedanner/spring-projects__spring-data-commons that referenced this pull request May 20, 2024
The (Reactive)PageableHandlerMethodArgumentResolver now falls back to a unpaged Pageable instance with a resolved sort if the the resolved Pageable is unpaged.

Fixes: spring-projectsGH-3094
Original pull request: spring-projectsGH-2865
natedanner pushed a commit to natedanner/spring-projects__spring-data-commons that referenced this pull request May 20, 2024
Ternary ifs and less nesting.

Related: spring-projectsGH-3094
Original pull request: spring-projectsGH-2865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PageableHandlerMethodArgumentResolver should fall back to unpaged Pageable if necessary
5 participants