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 committed Jul 29, 2021
1 parent 96ee8a3 commit 5b3f11c
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 5b3f11c

Please sign in to comment.