use of com.google.gerrit.server.validators.AssigneeValidationListener in project gerrit by GerritCodeReview.
the class SetAssigneeOp method updateChange.
@Override
public boolean updateChange(ChangeContext ctx) throws OrmException, RestApiException {
change = ctx.getChange();
if (newAssignee.getAccountId().equals(change.getAssignee())) {
return false;
}
try {
for (AssigneeValidationListener validator : validationListeners) {
validator.validateAssignee(change, newAssignee.getAccount());
}
} catch (ValidationException e) {
throw new ResourceConflictException(e.getMessage());
}
if (change.getAssignee() != null) {
oldAssignee = userFactory.create(change.getAssignee());
}
ChangeUpdate update = ctx.getUpdate(change.currentPatchSetId());
// notedb
update.setAssignee(newAssignee.getAccountId());
// reviewdb
change.setAssignee(newAssignee.getAccountId());
addMessage(ctx, update);
return true;
}
Aggregations