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

requestTotal is lost when subsequent methods are invoked #521

Conversation

njr-11
Copy link
Contributor

@njr-11 njr-11 commented Mar 5, 2024

While I was bringing in the requestTotal updates, I spotted a bug where a value of false is lost when additional builder methods are invoked. For example, if you write PageRequest.ofSize(20).requestTotal(false).page(5), the page method reverts the requestTotal value back to its default of true. This is happening because of a constructor in Pagination that defaults the value to true which all of these fluent builder-style methods are using rather than supplying the current value of requestTotal. I added a unit test confirming this is broken, and fixed the issue by removing the extra constructor so that we force all methods to either explicitly supply or default the value as is done for all other record components.

@njr-11 njr-11 added the bug Something isn't working label Mar 5, 2024
@njr-11 njr-11 added this to the Jakarta Data 1.0 milestone Mar 5, 2024
@gavinking
Copy link
Contributor

Oops, I suck :-(

@otaviojava otaviojava merged commit 005bce1 into jakartaee:main Mar 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants