in src/main/java/com/github/reviewassistant/reviewassistant/ReviewAssistant.java [109:153]
public ReviewAssistant(
PatchListCache patchListCache,
AccountCache accountCache,
GerritApi gApi,
Emails emails,
PluginConfigFactory cfg,
@PluginName String pluginName,
@Assisted RevCommit commit,
@Assisted Change change,
@Assisted PatchSet ps,
@Assisted Repository repo,
@Assisted Project.NameKey projectName) {
this.accountCache = accountCache;
this.patchListCache = patchListCache;
this.commit = commit;
this.gApi = gApi;
this.emails = emails;
this.change = change;
this.ps = ps;
this.repo = repo;
this.projectName = projectName;
Config pluginConfig = null;
try {
pluginConfig = cfg.getProjectPluginConfigWithInheritance(projectName, pluginName);
} catch (NoSuchProjectException e) {
log.error(e.getMessage(), e);
}
if (pluginConfig != null) {
this.maxReviewers = pluginConfig.getInt("reviewers", "maxReviewers", DEFAULT_MAX_REVIEWERS);
this.loadBalancing =
pluginConfig.getBoolean(
"reviewers", "enableLoadBalancing", DEFAULT_ENABLE_LOAD_BALANCING);
this.plusTwoAge = pluginConfig.getInt("reviewers", "plusTwoAge", DEFAULT_PLUS_TWO_AGE);
this.plusTwoLimit = pluginConfig.getInt("reviewers", "plusTwoLimit", DEFAULT_PLUS_TWO_LIMIT);
this.plusTwoRequired =
pluginConfig.getBoolean("reviewers", "plusTwoRequired", DEFAULT_PLUS_TWO_REQUIRED);
} else {
this.maxReviewers = DEFAULT_MAX_REVIEWERS;
this.loadBalancing = DEFAULT_ENABLE_LOAD_BALANCING;
this.plusTwoAge = DEFAULT_PLUS_TWO_AGE;
this.plusTwoLimit = DEFAULT_PLUS_TWO_LIMIT;
this.plusTwoRequired = DEFAULT_PLUS_TWO_REQUIRED;
}
}