Skip to content

Commit

Permalink
refactor(apollo-portal/NamespaceService): Replace CopyOnWriteArrayLis…
Browse files Browse the repository at this point in the history
…t with Collections.synchronizedList
  • Loading branch information
klboke committed Jul 24, 2022
1 parent e67d2a5 commit c9de54d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -174,7 +174,7 @@ public List<NamespaceBO> findNamespaceBOs(String appId, Env env, String clusterN
}

List<NamespaceBO> namespaceBOs = Collections.synchronizedList(new LinkedList<>());
List<String> exceptionNamespaces = new CopyOnWriteArrayList<>();
List<String> exceptionNamespaces = Collections.synchronizedList(new LinkedList<>());
CountDownLatch latch = new CountDownLatch(namespaces.size());
for (NamespaceDTO namespace : namespaces) {
executorService.submit(() -> {
Expand Down

0 comments on commit c9de54d

Please sign in to comment.