Skip to content

Commit f6e44ba

Browse files
committed
JSHttpClient second draft
1 parent 86a7901 commit f6e44ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sources/net.sf.j2s.java.core/src/javajs/http/JSHttpClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ public HttpResponse execute() throws IOException {
171171

172172
@Override
173173
public HttpResponse executeAsync(Consumer<? super HttpResponse> succeed,
174-
BiConsumer<? super HttpResponse, Throwable> fail, BiConsumer<? super HttpResponse, Throwable> always) {
174+
BiConsumer<? super HttpResponse, Throwable> fail,
175+
BiConsumer<? super HttpResponse, Throwable> always) {
175176
isAsync = (succeed != null || fail != null || always != null);
176177
this.succeed = succeed;
177178
this.fail = fail;
@@ -199,6 +200,7 @@ public void run() {
199200
return r;
200201
}
201202

203+
202204
@SuppressWarnings("resource")
203205
public Response fulfillGet() throws Exception {
204206
URI uri = getUri();
@@ -280,7 +282,7 @@ public class Response implements HttpResponse {
280282
private int state = 0;
281283

282284
ByteArrayInputStream inputStream;
283-
285+
284286
private Throwable exception;
285287

286288
/**
@@ -333,7 +335,6 @@ public void accept(byte[] t) {
333335

334336
/**
335337
* Make the proper callback, depending upon response code and exception state.
336-
*
337338
* @param ok
338339
*/
339340
protected void doCallback(boolean ok) {

0 commit comments

Comments
 (0)