Simplify if/else.
This commit is contained in:
parent
400771a1a7
commit
956b8194ff
|
@ -84,10 +84,8 @@ public final class SimpleBody {
|
||||||
if (bodyAsBytes != null) {
|
if (bodyAsBytes != null) {
|
||||||
final Charset charset = (contentType != null ? contentType : ContentType.DEFAULT_TEXT).getCharset();
|
final Charset charset = (contentType != null ? contentType : ContentType.DEFAULT_TEXT).getCharset();
|
||||||
return new String(bodyAsBytes, charset != null ? charset : StandardCharsets.US_ASCII);
|
return new String(bodyAsBytes, charset != null ? charset : StandardCharsets.US_ASCII);
|
||||||
} else if (bodyAsText != null) {
|
|
||||||
return bodyAsText;
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return bodyAsText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue