Skip to content

Commit a31e1cc

Browse files
authored
fix issues #359 (#360)
此前没有正确使用 try-with-resources 语法 Signed-off-by: EmmetZC <[email protected]>
1 parent c3ddd87 commit a31e1cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/main/java/com/wechat/pay/java/core/http/apache/ApacheHttpClientAdapter.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ protected String getHttpClientInfo() {
5555

5656
@Override
5757
public OriginalResponse innerExecute(HttpRequest wechatPayRequest) {
58-
try {
59-
CloseableHttpResponse apacheHttpResponse =
60-
apacheHttpClient.execute(buildApacheHttpRequest(wechatPayRequest));
58+
try (CloseableHttpResponse apacheHttpResponse =
59+
apacheHttpClient.execute(buildApacheHttpRequest(wechatPayRequest))) {
6160
return assembleOriginalResponse(wechatPayRequest, apacheHttpResponse);
6261
} catch (IOException e) {
6362
throw new HttpException(wechatPayRequest, e);

0 commit comments

Comments
 (0)