Fix suggest reviewers when requested without limit option

According to documentation default limit is used when limit is not
passed (rest-api-changes.txt):
"If result limit is not passed, then the default 10 is used."

Without this change, limit field got not initialized properly when
in an empty result in any case.

Change-Id: I2fddcd589cb9c39d73499e6eaa927cacd21d33d7
This commit is contained in:
Urs Wolfer
2014-09-20 13:02:07 +02:00
committed by Dave Borowitz
parent 3862ba2897
commit ad060ec871
2 changed files with 16 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ public class SuggestReviewers implements RestReadView<ChangeResource> {
this.reviewerSuggestionCache = reviewerSuggestionCache;
this.maxSuggestedReviewers =
cfg.getInt("suggest", "maxSuggestedReviewers", DEFAULT_MAX_SUGGESTED);
this.limit = this.maxSuggestedReviewers;
this.fullTextMaxMatches =
cfg.getInt("suggest", "fullTextSearchMaxMatches",
DEFAULT_MAX_MATCHES);