Fix nullability warnings and javadoc-triggered package cycles

This commit is contained in:
Juergen Hoeller
2019-07-17 22:34:07 +02:00
parent 56eadff34f
commit 94e3210ae7
10 changed files with 48 additions and 38 deletions

View File

@@ -231,11 +231,10 @@ public class MockHttpServletResponse implements HttpServletResponse {
* @since 5.2
* @see #getContentAsString()
*/
public String getContentAsString(Charset fallbackCharset) throws UnsupportedEncodingException {
return isCharset() ?
return (isCharset() && this.characterEncoding != null ?
this.content.toString(this.characterEncoding) :
this.content.toString(fallbackCharset.name());
this.content.toString(fallbackCharset.name()));
}
@Override