From 77d24def3a5aafd0d10afd525734bba398cf48b2 Mon Sep 17 00:00:00 2001 From: JasonWong Date: Wed, 7 Oct 2020 14:12:29 +0800 Subject: [PATCH] [ISSUE# 2325] Use CopyOnWriteArrayList to avoid possible thread safety issues --- .../java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java b/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java index a237bf61..8b01ef56 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java @@ -19,7 +19,6 @@ package org.apache.rocketmq.broker.out; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; -import java.util.Vector; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; @@ -123,7 +122,7 @@ public class BrokerOuterAPI { final int timeoutMills, final boolean compressed) { - final List registerBrokerResultList = new Vector<>(); + final List registerBrokerResultList = new CopyOnWriteArrayList<>(); List nameServerAddressList = this.remotingClient.getNameServerAddressList(); if (nameServerAddressList != null && nameServerAddressList.size() > 0) { -- GitLab