You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2024/08/13 16:52:55 UTC

(cxf) branch main updated: [CXF-9046] Close response objects in perf client sample (#2008)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/main by this push:
     new 3901f921ca [CXF-9046] Close response objects in perf client sample (#2008)
3901f921ca is described below

commit 3901f921ca83dd2ba9e191a01b63fe85fef1baaa
Author: Jamie Goodyear <jg...@apache.org>
AuthorDate: Tue Aug 13 14:22:50 2024 -0230

    [CXF-9046] Close response objects in perf client sample (#2008)
    
    * [CXF-9046] Close response objects in perf client sample
    
    * POST is autoclosing
    
    * GET in autoclosing
---
 .../main/java/org/apache/cxf/performance/https/client/Client.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/distribution/src/main/release/samples/performance/jaxrs/src/main/java/org/apache/cxf/performance/https/client/Client.java b/distribution/src/main/release/samples/performance/jaxrs/src/main/java/org/apache/cxf/performance/https/client/Client.java
index 89a144d315..221abcc539 100644
--- a/distribution/src/main/release/samples/performance/jaxrs/src/main/java/org/apache/cxf/performance/https/client/Client.java
+++ b/distribution/src/main/release/samples/performance/jaxrs/src/main/java/org/apache/cxf/performance/https/client/Client.java
@@ -83,8 +83,9 @@ public final class Client extends TestCaseBase<WebClient> {
             switch (opid) {
                 case 0:
                     //GET
-                    Response respGet = webClient.get();
-                    Asserts.check(respGet.getStatus() == 200, "Get should have been OK");
+                    try (Response respGet = webClient.get()) {
+                        Asserts.check(respGet.getStatus() == 200, "Get should have been OK");
+                    }
                     break;
                 case 1:
                     //POST