reta commented on code in PR #3656:
URL: https://github.com/apache/cxf/pull/3656#discussion_r4429164963


##########
systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/AbstractFailoverTest.java:
##########
@@ -295,9 +298,13 @@ protected void strategyTestWebClient(String 
inactiveReplica,
                                 boolean expectRandom) throws Exception {
         boolean randomized = false;
         String prevEndpoint = null;
+        WebClient bookStore = null;
         for (int i = 0; i < 20; i++) {
+            if (bookStore != null) {
+                bookStore.close();
+            }
             feature.getTargetSelector().close();
-            WebClient bookStore = getWebClient(inactiveReplica, feature);
+            bookStore = getWebClient(inactiveReplica, feature);

Review Comment:
   We could use try-with-resources here?:
   
   ```
   try (WebClient bookStore = getWebClient(inactiveReplica, feature)) {
    ...
   }
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to