removed redundant null checks.
Fixed bug in Streams.copy where it was not honoring the closeInput and closeOutput parameters. Suppressed spurious unused warnings
This commit is contained in:
parent
2b1f3eec15
commit
1a4bea7334
|
@ -69,9 +69,7 @@ public final class RequestSender {
|
||||||
String contentLength = String.valueOf(requestBodyContents.length());
|
String contentLength = String.valueOf(requestBodyContents.length());
|
||||||
setHeader(conn, "Content-Length", contentLength, true);
|
setHeader(conn, "Content-Length", contentLength, true);
|
||||||
addRequestParams(conn, request.getHeaders());
|
addRequestParams(conn, request.getHeaders());
|
||||||
if (requestBodyContents != null) {
|
|
||||||
Streams.copy(requestBodyContents, conn.getOutputStream(), false);
|
Streams.copy(requestBodyContents, conn.getOutputStream(), false);
|
||||||
}
|
|
||||||
|
|
||||||
// Initiate the sending of the request.
|
// Initiate the sending of the request.
|
||||||
conn.connect();
|
conn.connect();
|
||||||
|
|
|
@ -68,9 +68,7 @@ public final class RestRequestSender {
|
||||||
String contentLength = String.valueOf(requestBodyContents.length());
|
String contentLength = String.valueOf(requestBodyContents.length());
|
||||||
setHeader(conn, "Content-Length", contentLength, true);
|
setHeader(conn, "Content-Length", contentLength, true);
|
||||||
addRequestParams(conn, request.getHeaders());
|
addRequestParams(conn, request.getHeaders());
|
||||||
if (requestBodyContents != null) {
|
|
||||||
Streams.copy(requestBodyContents, conn.getOutputStream(), false);
|
Streams.copy(requestBodyContents, conn.getOutputStream(), false);
|
||||||
}
|
|
||||||
|
|
||||||
// Initiate the sending of the request.
|
// Initiate the sending of the request.
|
||||||
conn.connect();
|
conn.connect();
|
||||||
|
|
|
@ -37,8 +37,8 @@ final class Streams {
|
||||||
dst.write(buf, 0, count);
|
dst.write(buf, 0, count);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
src.close();
|
if (closeInput) src.close();
|
||||||
dst.close();
|
if (closeOutput) dst.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,9 @@ import com.google.gson.webservice.definition.WebServiceResponse.Builder;
|
||||||
|
|
||||||
public class WebServiceCallServerBuilder {
|
public class WebServiceCallServerBuilder {
|
||||||
|
|
||||||
public WebServiceCallServerBuilder(WebServiceCallSpec callSpec,
|
public WebServiceCallServerBuilder(
|
||||||
WebServiceRequest wsRequest, Builder responseBuilder) {
|
@SuppressWarnings("unused") WebServiceCallSpec callSpec,
|
||||||
|
@SuppressWarnings("unused") WebServiceRequest wsRequest,
|
||||||
|
@SuppressWarnings("unused") Builder responseBuilder) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user