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

MockHttpServletResponse.characterEncoding should not be @Nullable #27219

Closed
sbrannen opened this issue Jul 28, 2021 · 0 comments
Closed

MockHttpServletResponse.characterEncoding should not be @Nullable #27219

sbrannen opened this issue Jul 28, 2021 · 0 comments
Assignees
Labels
in: test Issues in the test module type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Jul 28, 2021

According to the Servlet spec, getCharacterEncoding() should never return null. Consequently, MockHttpServletResponse.characterEncoding should not be @Nullable.

Similarly, MockHttpServletResponse.reset() should set the characterEncoding to WebUtils.DEFAULT_CHARACTER_ENCODING instead of null.

Ensuring that characterEncoding is never null will also help to simplify the implementation of several methods in MockHttpServletResponse that currently have non-null checks for the characterEncoding.

@sbrannen sbrannen added in: test Issues in the test module type: bug A general bug labels Jul 28, 2021
@sbrannen sbrannen added this to the 5.3.10 milestone Jul 28, 2021
@sbrannen sbrannen self-assigned this Jul 28, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jul 28, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jul 28, 2021
@sbrannen sbrannen changed the title MockHttpServletResponse.characterEncoding should not be @Nullable MockHttpServletResponse.characterEncoding should not be @Nullable Jul 29, 2021
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this issue Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant