Skip to content

MockHttpServletResponse.characterEncoding should not be @Nullable #27219

@sbrannen

Description

@sbrannen

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.

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions