Skip to content
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

Latest changes on DefaultPage behaviour breaks io.micronaut.data.model.Page.map #2989

Closed
bzolivereckle opened this issue Jun 21, 2024 · 0 comments · Fixed by #2991
Closed
Assignees
Labels
type: bug Something isn't working

Comments

@bzolivereckle
Copy link

Expected Behavior

The iteration over the map is processed for all elements and returns an empty page if page has no elements.

Actual Behaviour

If the page is empty the map method throws an

java.lang.IllegalStateException: Page does not contain total count. It is likely that the Pageable needs to be modified to request this information.
 at io.micronaut.data.model.DefaultPage.getTotalSize(DefaultPage.java:68)
 at io.micronaut.data.model.Page.map(Page.java:99)

Steps To Reproduce

 val page = Page.empty()
 val mapped = page.map{ it }

Environment Information

JDK 21
Windows

Example Application

No response

Version

4.5.0

@graemerocher graemerocher added the type: bug Something isn't working label Jun 21, 2024
@graemerocher graemerocher moved this to Todo in 4.5.1 Release Jun 21, 2024
@bzolivereckle bzolivereckle changed the title Latest changes on DefaultPage behavoiur breaks io.micronaut.data.model.Page.map Latest changes on DefaultPage behaviour breaks io.micronaut.data.model.Page.map Jun 21, 2024
@radovanradic radovanradic linked a pull request Jun 24, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Todo to Done in 4.5.1 Release Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants