Consistently pass NotifyResolver.Result instead of separate args

Change-Id: I457fa6cc45002a88440e33adf609b52f8610b9eb
This commit is contained in:
Dave Borowitz
2019-01-30 13:47:50 -08:00
parent 3949eea76e
commit 8e24b76649
33 changed files with 118 additions and 220 deletions

View File

@@ -24,6 +24,7 @@ import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.GpgException;
import com.google.gerrit.server.account.AccountState;
import com.google.gerrit.server.change.NotifyResolver;
import com.google.gerrit.server.patch.PatchListNotAvailableException;
import com.google.gerrit.server.patch.PatchListObjectTooLargeException;
import com.google.gerrit.server.permissions.PermissionBackendException;
@@ -46,7 +47,7 @@ public class RevisionCreated {
PatchSet patchSet,
AccountState uploader,
Timestamp when,
NotifyHandling notify) {}
NotifyResolver.Result notify) {}
};
private final PluginSetContext<RevisionCreatedListener> listeners;
@@ -68,7 +69,7 @@ public class RevisionCreated {
PatchSet patchSet,
AccountState uploader,
Timestamp when,
NotifyHandling notify) {
NotifyResolver.Result notify) {
if (listeners.isEmpty()) {
return;
}
@@ -79,7 +80,7 @@ public class RevisionCreated {
util.revisionInfo(change.getProject(), patchSet),
util.accountInfo(uploader),
when,
notify);
notify.handling());
listeners.runEach(l -> l.onRevisionCreated(event));
} catch (PatchListObjectTooLargeException e) {
logger.atWarning().log("Couldn't fire event: %s", e.getMessage());