mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 15:07:27 +00:00
Simplify if/else.
This commit is contained in:
parent
400771a1a7
commit
956b8194ff
@ -84,10 +84,8 @@ public String getBodyText() {
|
||||
if (bodyAsBytes != null) {
|
||||
final Charset charset = (contentType != null ? contentType : ContentType.DEFAULT_TEXT).getCharset();
|
||||
return new String(bodyAsBytes, charset != null ? charset : StandardCharsets.US_ASCII);
|
||||
} else if (bodyAsText != null) {
|
||||
return bodyAsText;
|
||||
} else {
|
||||
return null;
|
||||
return bodyAsText;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user