Skip to content

Commit c9de54d

Browse files
committed
refactor(apollo-portal/NamespaceService): Replace CopyOnWriteArrayList with Collections.synchronizedList
1 parent e67d2a5 commit c9de54d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
import com.google.common.collect.Maps;
4343
import com.google.common.collect.Sets;
4444
import com.google.gson.Gson;
45+
import java.util.Collections;
4546
import java.util.HashMap;
4647
import java.util.LinkedList;
4748
import java.util.List;
4849
import java.util.Map;
4950
import java.util.Set;
50-
import java.util.concurrent.CopyOnWriteArrayList;
5151
import java.util.concurrent.CountDownLatch;
5252
import java.util.concurrent.ExecutorService;
5353
import java.util.concurrent.Executors;
@@ -174,7 +174,7 @@ public List<NamespaceBO> findNamespaceBOs(String appId, Env env, String clusterN
174174
}
175175

176176
List<NamespaceBO> namespaceBOs = Collections.synchronizedList(new LinkedList<>());
177-
List<String> exceptionNamespaces = new CopyOnWriteArrayList<>();
177+
List<String> exceptionNamespaces = Collections.synchronizedList(new LinkedList<>());
178178
CountDownLatch latch = new CountDownLatch(namespaces.size());
179179
for (NamespaceDTO namespace : namespaces) {
180180
executorService.submit(() -> {

0 commit comments

Comments
 (0)