Fix suggestion of default reviewers by reviewers plugin

The reviewers plugin passes null as changeNotes to the
ReviewersUtil#suggestReviewers method which led to a
NullPointerException.

Mark changesNotes as Nullable and expect that it can be null.

Change-Id: I6d1656ed7e44719130dd2da393906518b2833245
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2018-03-29 08:58:13 +02:00
parent 2ca92a63df
commit ff31a7fdb3
2 changed files with 17 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ import static java.util.stream.Collectors.toList;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.extensions.registration.DynamicMap;
import com.google.gerrit.index.query.Predicate;
@@ -100,7 +101,7 @@ public class ReviewerRecommender {
}
public List<Account.Id> suggestReviewers(
ChangeNotes changeNotes,
@Nullable ChangeNotes changeNotes,
SuggestReviewers suggestReviewers,
ProjectState projectState,
List<Account.Id> candidateList)