-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Breaking change in ResponseEntity.getStatusCode() breaks lots of code #31600
Comments
Thanks for your feedback @Ed42 - this change was introduced in #28214. We realize this change is not transparent and this is why this was introduced in a major version. As you can see in the issue description, we took extra steps to minimize disruption in applications. Unfortunately, we cannot change this arrangement at this stage. We would love to get this feedback during the milestone phases. There is already a note in the upgrade wiki on Thanks! |
In Spring 5.x the Such a breaking change is a poor choice without some mechanism for backwards compatibility, as this means we now have to maintain two versions of the same code while we are transitioning to Spring Boot 3.x, Spring 6.x. |
I think this is unrealistic expectations. Spring Framework 5 and 6 have very different baselines: JDK8 vs JDK17, Javax vs Jakarta, etc. For a Spring dependent library, I would assume a major version in sync with the baseline requirements of Spring itself.
I'm not suggesting usage of milestone versions in production, but rather testing milestone versions locally with existing applications to prepare future upgrades and send timely feedback to the team. Without this, you're effectively relying on the rest of the community to do that work for you. In this case, we had no complaints about this for 1.5 year and at this point it's too late to make any significant change about that.
I'm sorry this is making things more complicated for you, we're always trying to provide the best upgrade experience to the community. Still, I'm not sure it's fair to expect your library to be compatible with two major generations of Spring. There is no Spring project that does this in our entire portfolio for this very reason. If we cannot make any breaking change in major versions, there is simply no other way to make them and move the project forward. Thanks for your feedback! |
Still not clear on the compelling use case that justifies breaking so much code. How, specifically, does breaking The way #28214 is written, it appears to be a theoretical concern. Are there any practical benefits to this change? Or is just another pedantic change foisted on 1000s of projects for academic reasons? Java developers already have a bad reputation. This just adds fuel to the fire ... :--) |
To add another data point, this change also broke us, not at compile time, but at runtime after deploying to an env. We depend on another library which depended on this, and now we need to go and find the maintainers of that other library, get them to re-write their code, publish a new version, then push a new version of our code. I realise that transitive library dependency is impossible to solve fully, but it can be mitigated significantly by being prudent about the types of breaking changes that imposed on users of a library. I'd argue in this case the same goal could have been met by adding a new method I realise it's too late this roll this one back, but I hope feedback like this is collected and used to inform future changes by the Spring teams. |
Affects:
Spring Framework 6.0.13
The change to
ResponseEntity.getStatusCode()
returning theHttpStatusCode
interface instead of theHttpStatus
implementation breaks all callers that were expectingHttpStatus
returns.Example error:
This break in backwards-compatibility has greatly impacted our migration to Spring Boot 3.x
The text was updated successfully, but these errors were encountered: