Skip to content

Commit

Permalink
Add @nullable to setLocale in MockHttpServletResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen authored and lxbzmy committed Mar 26, 2022
1 parent b3d5840 commit 633d4fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ public void reset() {
}

@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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ public void reset() {
}

@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;
}
Expand Down

0 comments on commit 633d4fd

Please sign in to comment.