cleanup with findbugs
This commit is contained in:
parent
c0f0705519
commit
efa08c3bf4
@ -9,7 +9,7 @@ weixin4j
|
||||
-------
|
||||
* **weixin4j-base**
|
||||
|
||||
`微信支付(刷卡/扫码/JS/APP/WAP/现金红包/企业付款)`
|
||||
`Http Client实现&微信支付(刷卡/扫码/JS/APP/WAP/现金红包/企业付款)`
|
||||
|
||||
* **weixin4j-mp**
|
||||
|
||||
|
||||
@ -551,7 +551,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
* response header.
|
||||
*/
|
||||
public boolean getAccessControlAllowCredentials() {
|
||||
return new Boolean(getFirst(ACCESS_CONTROL_ALLOW_CREDENTIALS));
|
||||
return Boolean.valueOf(getFirst(ACCESS_CONTROL_ALLOW_CREDENTIALS));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -134,7 +134,6 @@ public class SimpleHttpClient extends AbstractHttpClient implements HttpClient {
|
||||
HttpEntity httpEntity = request.getEntity();
|
||||
if (httpEntity != null) {
|
||||
connection.setUseCaches(false);
|
||||
if (httpEntity != null) {
|
||||
// Read Out Exception when connection.disconnect();
|
||||
/*
|
||||
* if (httpEntity.getContentLength() > 0l) {
|
||||
@ -144,8 +143,7 @@ public class SimpleHttpClient extends AbstractHttpClient implements HttpClient {
|
||||
* .getChunkSize() : 4096); }
|
||||
*/
|
||||
if (httpEntity.getContentLength() > 0l) {
|
||||
connection.setRequestProperty(
|
||||
HttpHeaders.CONTENT_LENGTH,
|
||||
connection.setRequestProperty(HttpHeaders.CONTENT_LENGTH,
|
||||
Long.toString(httpEntity.getContentLength()));
|
||||
}
|
||||
if (httpEntity.getContentType() != null) {
|
||||
@ -153,7 +151,6 @@ public class SimpleHttpClient extends AbstractHttpClient implements HttpClient {
|
||||
httpEntity.getContentType().getMimeType());
|
||||
}
|
||||
}
|
||||
}
|
||||
// connect
|
||||
connection.connect();
|
||||
// open stream
|
||||
|
||||
@ -107,7 +107,8 @@ public class Netty4HttpClient extends AbstractHttpClient {
|
||||
}
|
||||
}
|
||||
};
|
||||
InetSocketAddress address = useProxy ? (InetSocketAddress) params.getProxy().address() : new InetSocketAddress(
|
||||
InetSocketAddress address = useProxy ? (InetSocketAddress) params
|
||||
.getProxy().address() : new InetSocketAddress(
|
||||
InetAddress.getByName(uri.getHost()), getPort(uri));
|
||||
bootstrap.connect(address).syncUninterruptibly()
|
||||
.addListener(listener);
|
||||
@ -188,6 +189,7 @@ public class Netty4HttpClient extends AbstractHttpClient {
|
||||
Entry<String, List<String>> header = headerIterator.next();
|
||||
uriRequest.headers().set(header.getKey(), header.getValue());
|
||||
}
|
||||
uriRequest.headers().set(HttpHeaders.ACCEPT_CHARSET, "utf-8");
|
||||
uriRequest.headers().set(HttpHeaders.CONNECTION,
|
||||
io.netty.handler.codec.http.HttpHeaders.Values.CLOSE);
|
||||
return uriRequest;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user