Skip to content

Commit ff4b1fa

Browse files
committed
minor clean up
1 parent 7778201 commit ff4b1fa

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

api/src/main/java/org/asynchttpclient/ResponseBase.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ protected Charset calculateCharset(Charset charset) {
3232
if (charset == null) {
3333
String contentType = getContentType();
3434
if (contentType != null)
35-
charset = parseCharset(contentType); // parseCharset can return null
35+
charset = parseCharset(contentType); // parseCharset can return
36+
// null
3637
}
3738
return charset != null ? charset : DEFAULT_CHARSET;
3839
}
@@ -128,11 +129,12 @@ public boolean hasResponseBody() {
128129
@Override
129130
public String toString() {
130131
try {
131-
return "ResponseBase{" +
132-
"statusCode=" + getStatusCode() +
133-
", headers=" + getHeaders() +
134-
", body='" + getResponseBody() + '\'' +
135-
'}';
132+
return new StringBuilder()//
133+
.append(getClass().getSimpleName()).append(" {\n")//
134+
.append("\tstatusCode=").append(getStatusCode()).append("\n")//
135+
.append("\theaders=").append(getHeaders()).append("\n")//
136+
.append("\tbody=\n").append(getResponseBody()).append("\n")//
137+
.append("}").toString();
136138
} catch (IOException e) {
137139
throw new RuntimeException("IOException occurred while trying to print response body", e);
138140
}

0 commit comments

Comments
 (0)