diff --git a/java/com/google/gerrit/server/permissions/SectionSortCache.java b/java/com/google/gerrit/server/permissions/SectionSortCache.java index c51bb80762..63f350fc61 100644 --- a/java/com/google/gerrit/server/permissions/SectionSortCache.java +++ b/java/com/google/gerrit/server/permissions/SectionSortCache.java @@ -31,7 +31,14 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Caches the order AccessSections should be sorted for evaluation. */ +/** + * Caches the order AccessSections should be sorted for evaluation. + * + *
Access specifications for a more specific ref (eg. refs/heads/master rather than refs/heads/*) + * take precedence in ACL evaluations. So for each combination of (ref, list of access specs) we + * have to order the access specs by their distance from the ref to be matched. This is expensive, + * so cache the sorted ordering. + */ @Singleton public class SectionSortCache { private static final Logger log = LoggerFactory.getLogger(SectionSortCache.class);