Add @Nullable to setLocale in MockHttpServletResponse

See gh-26493
This commit is contained in:
Sam Brannen 2021-07-29 14:47:31 +02:00
parent 96ee8a3bc7
commit 5b3f11c543
2 changed files with 8 additions and 2 deletions

View File

@ -358,7 +358,10 @@ public class MockHttpServletResponse implements HttpServletResponse {
}
@Override
public void setLocale(Locale locale) {
public void setLocale(@Nullable Locale locale) {
// Although the Javadoc for javax.servlet.ServletResponse.setLocale(Locale) does not
// state how a null value for the supplied Locale should be handled, both Tomcat and
// Jetty simply ignore a null value. So we do the same here.
if (locale == null) {
return;
}

View File

@ -358,7 +358,10 @@ public class MockHttpServletResponse implements HttpServletResponse {
}
@Override
public void setLocale(Locale locale) {
public void setLocale(@Nullable Locale locale) {
// Although the Javadoc for javax.servlet.ServletResponse.setLocale(Locale) does not
// state how a null value for the supplied Locale should be handled, both Tomcat and
// Jetty simply ignore a null value. So we do the same here.
if (locale == null) {
return;
}