YongGoose commented on code in PR #7684:
URL: https://github.com/apache/incubator-seata/pull/7684#discussion_r2434743834


##########
common/src/main/java/org/apache/seata/common/http/Http1HttpExecutor.java:
##########
@@ -54,6 +58,25 @@ public class HttpClientUtil {
 
     private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
 
+    public static volatile Http1HttpExecutor instance;
+
+    /**
+     * Gets instance.
+     *
+     * @return the instance
+     */
+    public static Http1HttpExecutor getInstance() {
+
+        if (instance == null) {
+            synchronized (Http1HttpExecutor.class) {
+                if (instance == null) {
+                    instance = new Http1HttpExecutor();
+                }
+            }
+        }
+        return instance;
+    }

Review Comment:
   `HTTP_CLIENT_MAP` is already managed as a `static final` field.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to