From 6dbd9f92c0ddbb27edd8e25da47e2eb210907918 Mon Sep 17 00:00:00 2001 From: Patrick Hiesel Date: Thu, 6 Aug 2020 06:56:10 +0000 Subject: [PATCH] Revert "ProjectCacheImpl#guessRelevantGroupUUIDs remove indirection over ListProjects" This reverts commit f5025b67019e7b8f08a646a7601193075d827013. Reason for revert: Breaks Google infrastructure Change-Id: I311df9d7334e9771116da417eb6871396dc0ffa8 --- java/com/google/gerrit/server/project/ProjectCacheImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/com/google/gerrit/server/project/ProjectCacheImpl.java b/java/com/google/gerrit/server/project/ProjectCacheImpl.java index d2e108651a..663c9aacce 100644 --- a/java/com/google/gerrit/server/project/ProjectCacheImpl.java +++ b/java/com/google/gerrit/server/project/ProjectCacheImpl.java @@ -56,6 +56,7 @@ import com.google.inject.TypeLiteral; import com.google.inject.name.Named; import java.io.IOException; import java.time.Duration; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -223,7 +224,9 @@ public class ProjectCacheImpl implements ProjectCache { @Override public Set guessRelevantGroupUUIDs() { try (Timer0.Context ignored = guessRelevantGroupsLatency.start()) { - return byName.asMap().values().stream() + return all().stream() + .map(n -> byName.getIfPresent(n)) + .filter(Objects::nonNull) .flatMap(p -> p.getConfig().getAllGroupUUIDs().stream()) // getAllGroupUUIDs shouldn't really return null UUIDs, but harden // against them just in case there is a bug or corner case.