From 256f9f4afd6e866c1ba7f01c17f2e2f383dc280e Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Fri, 17 Jan 2014 23:57:16 +0100 Subject: [PATCH] Plugin API: Add method for adding reviewers with string as argument This change simplifies adding reviewers. Change-Id: I5ec0b5d22f7f3a41fbadf889e8b4c82be5a52e5c --- .../google/gerrit/extensions/api/changes/ChangeApi.java | 1 + .../google/gerrit/server/api/changes/ChangeApiImpl.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/ChangeApi.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/ChangeApi.java index 9aa9d48417..e28c4242d9 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/ChangeApi.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/api/changes/ChangeApi.java @@ -33,4 +33,5 @@ public interface ChangeApi { ChangeApi revert(RevertInput in) throws RestApiException; void addReviewer(AddReviewerInput in) throws RestApiException; + void addReviewer(String in) throws RestApiException; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeApiImpl.java b/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeApiImpl.java index bb231e6c0b..64d8172683 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeApiImpl.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeApiImpl.java @@ -137,6 +137,13 @@ class ChangeApiImpl implements ChangeApi { } } + @Override + public void addReviewer(String reviewer) throws RestApiException { + AddReviewerInput in = new AddReviewerInput(); + in.reviewer = reviewer; + addReviewer(in); + } + @Override public void addReviewer(AddReviewerInput in) throws RestApiException { try {