Refactor array usage to list for RepositoryConfig and GroupSetProvider
Have getOwnerGroups return a list of strings rather than an array in RepositoryConfig. Replace string array usage with a list for the GroupSetProvider constructor, to simplify the life of its caller(s) now using the aforementioned list-returning getOwnerGroups. Update the impacted RepositoryConfigTest tests accordingly. That includes a minor refactoring in testAllBasePath, for consistency purposes. Change-Id: I540dae480a37c3bbb144fef48a95ba4ff29a019f
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package com.google.gerrit.server.config;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.gerrit.extensions.client.SubmitType;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.inject.Inject;
|
||||
@@ -46,9 +47,9 @@ public class RepositoryConfig {
|
||||
DEFAULT_SUBMIT_TYPE_NAME, SubmitType.MERGE_IF_NECESSARY);
|
||||
}
|
||||
|
||||
public String[] getOwnerGroups(Project.NameKey project) {
|
||||
return cfg.getStringList(SECTION_NAME, findSubSection(project.get()),
|
||||
OWNER_GROUP_NAME);
|
||||
public List<String> getOwnerGroups(Project.NameKey project) {
|
||||
return ImmutableList.copyOf(cfg.getStringList(SECTION_NAME,
|
||||
findSubSection(project.get()), OWNER_GROUP_NAME));
|
||||
}
|
||||
|
||||
public Path getBasePath(Project.NameKey project) {
|
||||
|
||||
Reference in New Issue
Block a user