Merge changes from topic "merge-9ec0b9a" into stable-3.0

* changes:
  Merge branch 'stable-2.16' into stable-3.0
  ChangeNotificationsIT: Fix eclipse warning(s) about static use


* submodules:
* Update plugins/replication from branch 'stable-3.0'
  to 890967ffc4d4c16fbbeaa1a84d7f09f839c139c0
  - Merge branch 'stable-2.16' into stable-3.0
    
    * stable-2.16:
      Make constants final
    
    Change-Id: I4dd63e123cf895dbc28d1623a7272a004fd87579
    
  - Make constants final
    
    Change-Id: I12605d9aee56fa8738ce4fb03f0fdd316312d6e8
    * Update plugins/reviewnotes from branch 'stable-3.0'
  to be5037839d987a319dac2236e9c1221d4d31848d
  - Merge branch 'stable-2.16' into stable-3.0
    
    * stable-2.16:
      CreateReviewNotes: Use UTF_8 constant from StandardCharsets
    
    Change-Id: I499c81f625949ced7764a84eaab24b7fd6848161
    
  - CreateReviewNotes: Use UTF_8 constant from StandardCharsets
    
    Change-Id: Ice5c61b77b8cd2c86201746560d160736550260f
This commit is contained in:
David Pursehouse
2020-02-19 23:44:27 +00:00
committed by Gerrit Code Review
54 changed files with 230 additions and 263 deletions

View File

@@ -755,7 +755,9 @@ Gerrit core does not support the renaming of projects.
If the link:https://gerrit-review.googlesource.com/admin/repos/plugins/rename-project[rename-project]
plugin is installed, projects can be renamed using the
link:https://gerrit.googlesource.com/plugins/rename-project/+/refs/heads/master/src/main/resources/Documentation/cmd-rename.md[rename-project]
ssh command. Find details about prerequisites in the
ssh command.
Find details about prerequisites in the
link:https://gerrit.googlesource.com/plugins/rename-project/+/refs/heads/master/src/main/resources/Documentation/about.md[plugin documentation].
If you don't want to use the rename-project plugin you can perform the following steps as

View File

@@ -315,6 +315,9 @@ public abstract class AbstractNotificationTest extends AbstractDaemonTest {
}
protected class StagedUsers {
public static final String REVIEWER_BY_EMAIL = "reviewerByEmail@example.com";
public static final String CC_BY_EMAIL = "ccByEmail@example.com";
public final TestAccount owner;
public final TestAccount author;
public final TestAccount uploader;
@@ -323,8 +326,6 @@ public abstract class AbstractNotificationTest extends AbstractDaemonTest {
public final TestAccount starrer;
public final TestAccount assignee;
public final TestAccount watchingProjectOwner;
public final String reviewerByEmail = "reviewerByEmail@example.com";
public final String ccerByEmail = "ccByEmail@example.com";
private final Map<NotifyType, TestAccount> watchers = new HashMap<>();
private final Map<String, TestAccount> accountsByEmail = new HashMap<>();
@@ -425,9 +426,9 @@ public abstract class AbstractNotificationTest extends AbstractDaemonTest {
ReviewInput in =
ReviewInput.noScore()
.reviewer(reviewer.email())
.reviewer(reviewerByEmail)
.reviewer(REVIEWER_BY_EMAIL)
.reviewer(ccer.email(), ReviewerState.CC, false)
.reviewer(ccerByEmail, ReviewerState.CC, false);
.reviewer(CC_BY_EMAIL, ReviewerState.CC, false);
ReviewResult result = gApi.changes().id(r.getChangeId()).revision("current").review(in);
supportReviewersByEmail = true;
if (result.reviewers.values().stream().anyMatch(v -> v.error != null)) {

View File

@@ -90,16 +90,16 @@ public class PageLinks {
return ADMIN_PROJECTS + p.get();
}
public static String toProjectAcceess(Project.NameKey p) {
return "/admin/projects/" + p.get() + ",access";
public static String toProjectAccess(Project.NameKey p) {
return ADMIN_PROJECTS + p.get() + ",access";
}
public static String toProjectBranches(Project.NameKey p) {
return "/admin/projects/" + p.get() + ",branches";
return ADMIN_PROJECTS + p.get() + ",branches";
}
public static String toProjectTags(Project.NameKey p) {
return "/admin/projects/" + p.get() + ",tags";
return ADMIN_PROJECTS + p.get() + ",tags";
}
public static String toAccountQuery(String fullname, Status status) {

View File

@@ -126,7 +126,7 @@ public class LabelType {
maxNegative = Short.MIN_VALUE;
maxPositive = Short.MAX_VALUE;
if (values.size() > 0) {
if (!values.isEmpty()) {
if (values.get(0).getValue() < 0) {
maxNegative = values.get(0).getValue();
}

View File

@@ -392,7 +392,7 @@ abstract class AbstractElasticIndex<K, V> implements Index<K, V> {
@Override
public ResultSet<V> read() {
return readImpl((doc) -> AbstractElasticIndex.this.fromDocument(doc, opts.fields()));
return readImpl(doc -> AbstractElasticIndex.this.fromDocument(doc, opts.fields()));
}
@Override

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.elasticsearch.builders;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.time.format.DateTimeFormatter.ISO_INSTANT;
import com.fasterxml.jackson.core.JsonEncoding;
@@ -21,7 +22,6 @@ import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.json.JsonReadFeature;
import com.fasterxml.jackson.core.json.JsonWriteFeature;
import com.google.common.base.Charsets;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
@@ -139,7 +139,7 @@ public final class XContentBuilder implements Closeable {
public String string() {
close();
byte[] bytesArray = bos.toByteArray();
return new String(bytesArray, Charsets.UTF_8);
return new String(bytesArray, UTF_8);
}
private void writeValue(Object value) throws IOException {

View File

@@ -21,6 +21,7 @@ import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
public interface Accounts {
/**
@@ -138,7 +139,7 @@ public interface Accounts {
private int limit;
private int start;
private boolean suggest;
private EnumSet<ListAccountsOption> options = EnumSet.noneOf(ListAccountsOption.class);
private Set<ListAccountsOption> options = EnumSet.noneOf(ListAccountsOption.class);
/** Execute query and return a list of accounts. */
public abstract List<AccountInfo> get() throws RestApiException;
@@ -185,7 +186,7 @@ public interface Accounts {
}
/** Set options on the request, replacing existing options. */
public QueryRequest withOptions(EnumSet<ListAccountsOption> options) {
public QueryRequest withOptions(Set<ListAccountsOption> options) {
this.options = options;
return this;
}
@@ -206,7 +207,7 @@ public interface Accounts {
return suggest;
}
public EnumSet<ListAccountsOption> getOptions() {
public Set<ListAccountsOption> getOptions() {
return options;
}
}

View File

@@ -22,6 +22,7 @@ import com.google.gerrit.extensions.restapi.RawInput;
import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.EnumSet;
import java.util.Optional;
import java.util.Set;
/**
* An API for the change edit of a change. A change edit is similar to a patch set and will become
@@ -51,7 +52,7 @@ public interface ChangeEditApi {
return base;
}
public EnumSet<ChangeEditDetailOption> options() {
public Set<ChangeEditDetailOption> options() {
return options;
}
}

View File

@@ -24,6 +24,7 @@ import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
public interface Changes {
/**
@@ -78,7 +79,7 @@ public interface Changes {
private int limit;
private int start;
private boolean isNoLimit;
private EnumSet<ListChangesOption> options = EnumSet.noneOf(ListChangesOption.class);
private Set<ListChangesOption> options = EnumSet.noneOf(ListChangesOption.class);
private ListMultimap<String, String> pluginOptions = ArrayListMultimap.create();
public abstract List<ChangeInfo> get() throws RestApiException;
@@ -116,7 +117,7 @@ public interface Changes {
}
/** Set options on the request, replacing existing options. */
public QueryRequest withOptions(EnumSet<ListChangesOption> options) {
public QueryRequest withOptions(Set<ListChangesOption> options) {
this.options = options;
return this;
}
@@ -149,7 +150,7 @@ public interface Changes {
return start;
}
public EnumSet<ListChangesOption> getOptions() {
public Set<ListChangesOption> getOptions() {
return options;
}

View File

@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface Groups {
/**
@@ -166,7 +167,7 @@ public interface Groups {
return this;
}
public EnumSet<ListGroupsOption> getOptions() {
public Set<ListGroupsOption> getOptions() {
return options;
}
@@ -224,7 +225,7 @@ public interface Groups {
private String query;
private int limit;
private int start;
private EnumSet<ListGroupsOption> options = EnumSet.noneOf(ListGroupsOption.class);
private Set<ListGroupsOption> options = EnumSet.noneOf(ListGroupsOption.class);
/** Execute query and returns the matched groups as list. */
public abstract List<GroupInfo> get() throws RestApiException;
@@ -266,7 +267,7 @@ public interface Groups {
}
/** Set options on the request, replacing existing options. */
public QueryRequest withOptions(EnumSet<ListGroupsOption> options) {
public QueryRequest withOptions(Set<ListGroupsOption> options) {
this.options = options;
return this;
}
@@ -283,7 +284,7 @@ public interface Groups {
return start;
}
public EnumSet<ListGroupsOption> getOptions() {
public Set<ListGroupsOption> getOptions() {
return options;
}
}

View File

@@ -32,7 +32,7 @@ public class TestSubmitRuleInfo {
public static class None {
private None() {}
public static None INSTANCE = new None();
public static final None INSTANCE = new None();
}
@Override

View File

@@ -192,7 +192,7 @@ class OpenIdServiceImpl {
// We might already have this account on file. Look for it.
//
try {
return accountManager.lookup(aReq.getIdentity()) == null;
return !accountManager.lookup(aReq.getIdentity()).isPresent();
} catch (AccountException e) {
logger.atWarning().withCause(e).log("Cannot determine if user account exists");
return true;
@@ -333,7 +333,7 @@ class OpenIdServiceImpl {
areq.setEmailAddress(fetchRsp.getAttributeValue("Email"));
}
if (openIdDomains != null && openIdDomains.size() > 0) {
if (openIdDomains != null && !openIdDomains.isEmpty()) {
// Administrator limited email domains, which can be used for OpenID.
// Login process will only work if the passed email matches one
// of these domains.

View File

@@ -96,9 +96,9 @@ class GitwebServlet extends HttpServlet {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final String PROJECT_LIST_ACTION = "project_list";
private static final int BUFFER_SIZE = 8192;
private final Set<String> deniedActions;
private final int bufferSize = 8192;
private final Path gitwebCgi;
private final URI gitwebUrl;
private final LocalDiskRepositoryManager repoManager;
@@ -506,11 +506,11 @@ class GitwebServlet extends HttpServlet {
proc.getOutputStream().close();
}
try (InputStream in = new BufferedInputStream(proc.getInputStream(), bufferSize)) {
try (InputStream in = new BufferedInputStream(proc.getInputStream(), BUFFER_SIZE)) {
readCgiHeaders(rsp, in);
try (OutputStream out = rsp.getOutputStream()) {
final byte[] buf = new byte[bufferSize];
final byte[] buf = new byte[BUFFER_SIZE];
int n;
while ((n = in.read(buf)) > 0) {
out.write(buf, 0, n);
@@ -645,7 +645,7 @@ class GitwebServlet extends HttpServlet {
() -> {
try {
try {
final byte[] buf = new byte[bufferSize];
final byte[] buf = new byte[BUFFER_SIZE];
int remaining = contentLength;
while (0 < remaining) {
final int max = Math.max(buf.length, remaining);

View File

@@ -1316,7 +1316,7 @@ public class RestApiServlet extends HttpServlet {
for (String p : Splitter.on('/').split(path)) {
out.add(IdString.fromUrl(p));
}
if (out.size() > 0 && out.get(out.size() - 1).isEmpty()) {
if (!out.isEmpty() && out.get(out.size() - 1).isEmpty()) {
out.remove(out.size() - 1);
}
return out;

View File

@@ -549,7 +549,7 @@ public class LuceneChangeIndex implements ChangeIndex {
private void decodeReviewedBy(ListMultimap<String, IndexableField> doc, ChangeData cd) {
Collection<IndexableField> reviewedBy = doc.get(REVIEWEDBY_FIELD);
if (reviewedBy.size() > 0) {
if (!reviewedBy.isEmpty()) {
Set<Account.Id> accounts = Sets.newHashSetWithExpectedSize(reviewedBy.size());
for (IndexableField r : reviewedBy) {
int id = r.numericValue().intValue();

View File

@@ -69,7 +69,7 @@ public class RawMailParser {
}
// Add From, To and Cc
if (mimeMessage.getFrom() != null && mimeMessage.getFrom().size() > 0) {
if (mimeMessage.getFrom() != null && !mimeMessage.getFrom().isEmpty()) {
Mailbox from = mimeMessage.getFrom().get(0);
messageBuilder.from(new Address(from.getName(), from.getAddress()));
}

View File

@@ -14,7 +14,6 @@
package com.google.gerrit.metrics.proc;
import com.google.common.base.Supplier;
import com.google.gerrit.metrics.CallbackMetric1;
import com.google.gerrit.metrics.Description;
import com.google.gerrit.metrics.Description.Units;
@@ -34,23 +33,13 @@ public class JGitMetricModule extends MetricModule {
new Description("Bytes of memory retained in JGit block cache.")
.setGauge()
.setUnit(Units.BYTES),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getOpenByteCount();
}
});
WindowCacheStats.getStats()::getOpenByteCount);
metrics.newCallbackMetric(
"jgit/block_cache/open_files",
Long.class,
new Description("File handles held open by JGit block cache.").setGauge().setUnit("fds"),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getOpenFileCount();
}
});
WindowCacheStats.getStats()::getOpenFileCount);
metrics.newCallbackMetric(
"jgit/block_cache/avg_load_time",
@@ -58,99 +47,55 @@ public class JGitMetricModule extends MetricModule {
new Description("Average time to load a cache entry for JGit block cache.")
.setGauge()
.setUnit(Units.NANOSECONDS),
new Supplier<Double>() {
@Override
public Double get() {
return WindowCacheStats.getStats().getAverageLoadTime();
}
});
WindowCacheStats.getStats()::getAverageLoadTime);
metrics.newCallbackMetric(
"jgit/block_cache/eviction_count",
Long.class,
new Description("Cache evictions for JGit block cache.").setGauge(),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getEvictionCount();
}
});
WindowCacheStats.getStats()::getEvictionCount);
metrics.newCallbackMetric(
"jgit/block_cache/eviction_ratio",
Double.class,
new Description("Cache eviction ratio for JGit block cache.").setGauge(),
new Supplier<Double>() {
@Override
public Double get() {
return WindowCacheStats.getStats().getEvictionRatio();
}
});
WindowCacheStats.getStats()::getEvictionRatio);
metrics.newCallbackMetric(
"jgit/block_cache/hit_count",
Long.class,
new Description("Cache hits for JGit block cache.").setGauge(),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getHitCount();
}
});
WindowCacheStats.getStats()::getHitCount);
metrics.newCallbackMetric(
"jgit/block_cache/hit_ratio",
Double.class,
new Description("Cache hit ratio for JGit block cache.").setGauge(),
new Supplier<Double>() {
@Override
public Double get() {
return WindowCacheStats.getStats().getHitRatio();
}
});
WindowCacheStats.getStats()::getHitRatio);
metrics.newCallbackMetric(
"jgit/block_cache/load_failure_count",
Long.class,
new Description("Failed cache loads for JGit block cache.").setGauge(),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getLoadFailureCount();
}
});
WindowCacheStats.getStats()::getLoadFailureCount);
metrics.newCallbackMetric(
"jgit/block_cache/load_failure_ratio",
Double.class,
new Description("Failed cache load ratio for JGit block cache.").setGauge(),
new Supplier<Double>() {
@Override
public Double get() {
return WindowCacheStats.getStats().getLoadFailureRatio();
}
});
WindowCacheStats.getStats()::getLoadFailureRatio);
metrics.newCallbackMetric(
"jgit/block_cache/load_success_count",
Long.class,
new Description("Successfull cache loads for JGit block cache.").setGauge(),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getLoadSuccessCount();
}
});
WindowCacheStats.getStats()::getLoadSuccessCount);
metrics.newCallbackMetric(
"jgit/block_cache/miss_count",
Long.class,
new Description("Cache misses for JGit block cache.").setGauge(),
new Supplier<Long>() {
@Override
public Long get() {
return WindowCacheStats.getStats().getMissCount();
}
});
WindowCacheStats.getStats()::getMissCount);
metrics.newCallbackMetric(
"jgit/block_cache/miss_ratio",

View File

@@ -69,7 +69,7 @@ public class Section {
all.addAll(Arrays.asList(flags.cfg.getStringList(section, subsection, name)));
if (value != null) {
if (all.size() == 0 || all.size() == 1) {
if (all.isEmpty() || all.size() == 1) {
flags.cfg.setString(section, subsection, name, value);
} else {
all.set(0, value);
@@ -78,7 +78,7 @@ public class Section {
} else if (all.size() == 1) {
flags.cfg.unset(section, subsection, name);
} else if (all.size() != 0) {
} else if (!all.isEmpty()) {
all.remove(0);
flags.cfg.setStringList(section, subsection, name, all);
}

View File

@@ -459,8 +459,8 @@ public class AccountManager {
}
if (filteredExtIdsByScheme.size() > 1
|| !filteredExtIdsByScheme.stream()
.anyMatch(e -> e.key().equals(who.getExternalIdKey()))) {
|| filteredExtIdsByScheme.stream()
.noneMatch(e -> e.key().equals(who.getExternalIdKey()))) {
u.deleteExternalIds(filteredExtIdsByScheme);
}
});

View File

@@ -37,8 +37,8 @@ public class AccountsConsistencyChecker {
for (AccountState accountState : accounts.all()) {
Account account = accountState.getAccount();
if (account.getPreferredEmail() != null) {
if (!accountState.getExternalIds().stream()
.anyMatch(e -> account.getPreferredEmail().equals(e.email()))) {
if (accountState.getExternalIds().stream()
.noneMatch(e -> account.getPreferredEmail().equals(e.email()))) {
addError(
String.format(
"Account '%s' has no external ID for its preferred email '%s'",

View File

@@ -31,10 +31,10 @@ import java.util.Set;
@Singleton
public class CacheMetrics {
private static final Field<String> F_NAME = Field.ofString("cache_name");
@Inject
public CacheMetrics(MetricMaker metrics, DynamicMap<Cache<?, ?>> cacheMap) {
Field<String> F_NAME = Field.ofString("cache_name");
CallbackMetric1<String, Long> memEnt =
metrics.newCallbackMetric(
"caches/memory_cached",

View File

@@ -25,12 +25,12 @@ import org.eclipse.jgit.lib.Config;
@Singleton
public class ChangeCleanupConfig {
private static String SECTION = "changeCleanup";
private static String KEY_ABANDON_AFTER = "abandonAfter";
private static String KEY_ABANDON_IF_MERGEABLE = "abandonIfMergeable";
private static String KEY_ABANDON_MESSAGE = "abandonMessage";
private static String KEY_CLEANUP_ACCOUNT_PATCH_REVIEW = "cleanupAccountPatchReview";
private static String DEFAULT_ABANDON_MESSAGE =
private static final String SECTION = "changeCleanup";
private static final String KEY_ABANDON_AFTER = "abandonAfter";
private static final String KEY_ABANDON_IF_MERGEABLE = "abandonIfMergeable";
private static final String KEY_ABANDON_MESSAGE = "abandonMessage";
private static final String KEY_CLEANUP_ACCOUNT_PATCH_REVIEW = "cleanupAccountPatchReview";
private static final String DEFAULT_ABANDON_MESSAGE =
"Auto-Abandoned due to inactivity, see "
+ "${URL}\n"
+ "\n"

View File

@@ -34,10 +34,10 @@ public class TrackingFootersProvider implements Provider<TrackingFooters> {
private static final int MAX_LENGTH = 10;
private static String TRACKING_ID_TAG = "trackingid";
private static String FOOTER_TAG = "footer";
private static String SYSTEM_TAG = "system";
private static String REGEX_TAG = "match";
private static final String TRACKING_ID_TAG = "trackingid";
private static final String FOOTER_TAG = "footer";
private static final String SYSTEM_TAG = "system";
private static final String REGEX_TAG = "match";
private final List<TrackingFooter> trackingFooters = new ArrayList<>();
@Inject

View File

@@ -22,7 +22,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -42,7 +41,7 @@ import org.apache.lucene.store.RAMDirectory;
public class QueryDocumentationExecutor {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static Map<String, Float> WEIGHTS =
private static final ImmutableMap<String, Float> WEIGHTS =
ImmutableMap.of(
Constants.TITLE_FIELD, 2.0f,
Constants.DOC_FIELD, 1.0f);

View File

@@ -230,7 +230,7 @@ public class StreamEventsApiListener
}
String[] hashtagArray(Collection<String> hashtags) {
if (hashtags != null && hashtags.size() > 0) {
if (hashtags != null && !hashtags.isEmpty()) {
return Sets.newHashSet(hashtags).toArray(new String[hashtags.size()]);
}
return null;

View File

@@ -141,7 +141,7 @@ public class GroupCollector {
checkState(!done, "visit() called after getGroups()");
Set<RevCommit> interestingParents = getInterestingParents(c);
if (interestingParents.size() == 0) {
if (interestingParents.isEmpty()) {
// All parents are uninteresting: treat this commit as the root of a new
// group of related changes.
groups.put(c, c.name());

View File

@@ -49,11 +49,11 @@ public class NotifyConfig implements Comparable<NotifyConfig> {
return types.contains(type) || types.contains(NotifyType.ALL);
}
public EnumSet<NotifyType> getNotify() {
public Set<NotifyType> getNotify() {
return types;
}
public void setTypes(EnumSet<NotifyType> newTypes) {
public void setTypes(Set<NotifyType> newTypes) {
types = EnumSet.copyOf(newTypes);
}

View File

@@ -33,7 +33,7 @@ public class TabFile {
String parse(String str);
}
public static Parser TRIM = String::trim;
public static final Parser TRIM = String::trim;
protected static class Row {
public String left;

View File

@@ -2205,7 +2205,7 @@ class ReceiveCommits {
return Collections.emptyList();
}
if (changes.size() == 0) {
if (changes.isEmpty()) {
if (!isValidChangeId(p.changeKey.get())) {
reject(magicBranch.cmd, "invalid Change-Id");
return Collections.emptyList();

View File

@@ -77,7 +77,7 @@ public class ChangeIndexRewriter implements IndexRewriter<ChangeData> {
* @return the maximal set of statuses that any changes matching the input predicates may have,
* based on examining boolean and {@link ChangeStatusPredicate}s.
*/
public static EnumSet<Change.Status> getPossibleStatus(Predicate<ChangeData> in) {
public static Set<Change.Status> getPossibleStatus(Predicate<ChangeData> in) {
EnumSet<Change.Status> s = extractStatus(in);
return s != null ? s : EnumSet.allOf(Change.Status.class);
}

View File

@@ -45,9 +45,10 @@ import org.eclipse.jgit.transport.ReceiveCommand;
public class DeleteZombieCommentsRefs {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final String EMPTY_TREE_ID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
private final String DRAFT_REFS_PREFIX = "refs/draft-comments";
private final int CHUNK_SIZE = 100; // log progress after deleting every CHUNK_SIZE refs
private static final String EMPTY_TREE_ID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
private static final String DRAFT_REFS_PREFIX = "refs/draft-comments";
private static final int CHUNK_SIZE = 100; // log progress after deleting every CHUNK_SIZE refs
private final GitRepositoryManager repoManager;
private final AllUsersName allUsers;
private final int cleanupPercentage;

View File

@@ -501,12 +501,12 @@ public abstract class PermissionBackend {
public Set<LabelPermission.WithValue> testLabels(Collection<LabelType> types)
throws PermissionBackendException {
requireNonNull(types, "LabelType");
return test(types.stream().flatMap((t) -> valuesOf(t).stream()).collect(toSet()));
return test(types.stream().flatMap(t -> valuesOf(t).stream()).collect(toSet()));
}
private static Set<LabelPermission.WithValue> valuesOf(LabelType label) {
return label.getValues().stream()
.map((v) -> new LabelPermission.WithValue(label, v))
.map(v -> new LabelPermission.WithValue(label, v))
.collect(toSet());
}
}

View File

@@ -27,7 +27,7 @@ import java.util.HashSet;
/** Provides transformations to get and set BooleanProjectConfigs from the API. */
public class BooleanProjectConfigTransformations {
private static ImmutableMap<BooleanProjectConfig, Mapper> MAPPER =
private static final ImmutableMap<BooleanProjectConfig, Mapper> MAPPER =
ImmutableMap.<BooleanProjectConfig, Mapper>builder()
.put(
BooleanProjectConfig.USE_CONTRIBUTOR_AGREEMENTS,

View File

@@ -238,7 +238,7 @@ public class ProjectsConsistencyChecker {
predicates.add(new CommitPredicate(commit.name()));
}
if (predicates.size() > 0) {
if (!predicates.isEmpty()) {
// Execute the query with the remaining predicates that were collected.
autoCloseableChanges.addAll(
executeQueryAndAutoCloseChanges(
@@ -265,13 +265,12 @@ public class ProjectsConsistencyChecker {
List<ChangeData> queryResult =
retryHelper.execute(
ActionType.INDEX_QUERY,
() -> {
// Execute the query.
return changeQueryProvider
.get()
.setRequestedFields(ChangeField.CHANGE, ChangeField.PATCH_SET)
.query(and(basePredicate, or(predicates)));
},
() ->
// Execute the query.
changeQueryProvider
.get()
.setRequestedFields(ChangeField.CHANGE, ChangeField.PATCH_SET)
.query(and(basePredicate, or(predicates))),
StorageException.class::isInstance);
// Result for this query that we want to return to the client.

View File

@@ -72,7 +72,7 @@ public class InternalAccountQuery extends InternalQuery<AccountState, InternalAc
List<AccountState> accountStates = byExternalId(externalId);
if (accountStates.size() == 1) {
return accountStates.get(0);
} else if (accountStates.size() > 0) {
} else if (!accountStates.isEmpty()) {
StringBuilder msg = new StringBuilder();
msg.append("Ambiguous external ID ").append(externalId).append(" for accounts: ");
Joiner.on(", ")

View File

@@ -35,9 +35,7 @@ public class AndChangeSource extends AndSource<ChangeData> implements ChangeData
@Override
public boolean hasChange() {
return source != null
&& source instanceof ChangeDataSource
&& ((ChangeDataSource) source).hasChange();
return source instanceof ChangeDataSource && ((ChangeDataSource) source).hasChange();
}
@Override

View File

@@ -70,7 +70,7 @@ public class DeleteExternalIds implements RestModifyView<AccountResource, List<S
permissionBackend.currentUser().check(GlobalPermission.ACCESS_DATABASE);
}
if (extIds == null || extIds.size() == 0) {
if (extIds == null || extIds.isEmpty()) {
throw new BadRequestException("external IDs are required");
}

View File

@@ -253,7 +253,7 @@ public class GetDiff implements RestReadView<FileResource> {
throw new IllegalStateException("unknown change type: " + ps.getChangeType());
}
if (ps.getPatchHeader().size() > 0) {
if (!ps.getPatchHeader().isEmpty()) {
result.diffHeader = ps.getPatchHeader();
}
result.content = content.lines;

View File

@@ -43,7 +43,7 @@ import org.kohsuke.args4j.Option;
public class GetPatch implements RestReadView<RevisionResource> {
private final GitRepositoryManager repoManager;
private final String FILE_NOT_FOUND = "File not found: %s.";
private static final String FILE_NOT_FOUND = "File not found: %s.";
@Option(name = "--zip")
private boolean zip;

View File

@@ -289,7 +289,7 @@ public class PostReview
Account.Id id = revision.getUser().getAccountId();
boolean ccOrReviewer = false;
if (input.labels != null && !input.labels.isEmpty()) {
ccOrReviewer = input.labels.values().stream().filter(v -> v != 0).findFirst().isPresent();
ccOrReviewer = input.labels.values().stream().anyMatch(v -> v != 0);
}
if (!ccOrReviewer) {

View File

@@ -232,7 +232,7 @@ public class ReviewerRecommender {
// (weighted 10d), number of comments (weighted 0.5d) and number of owned
// changes (weighted 1d).
Map<Account.Id, MutableDouble> reviewers = new LinkedHashMap<>();
if (candidates.size() == 0) {
if (candidates.isEmpty()) {
return reviewers;
}
List<Predicate<ChangeData>> predicates = new ArrayList<>();

View File

@@ -45,6 +45,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import org.kohsuke.args4j.Option;
public class SubmittedTogether implements RestReadView<ChangeResource> {
@@ -95,12 +96,12 @@ public class SubmittedTogether implements RestReadView<ChangeResource> {
this.sorter = sorter;
}
public SubmittedTogether addListChangesOption(EnumSet<ListChangesOption> o) {
public SubmittedTogether addListChangesOption(Set<ListChangesOption> o) {
jsonOpt.addAll(o);
return this;
}
public SubmittedTogether addSubmittedTogetherOption(EnumSet<SubmittedTogetherOption> o) {
public SubmittedTogether addSubmittedTogetherOption(Set<SubmittedTogetherOption> o) {
options.addAll(o);
return this;
}

View File

@@ -125,8 +125,8 @@ public class GetSummary implements RestReadView<ConfigResource> {
long mTotal = r.totalMemory();
long mInuse = mTotal - mFree;
int jgitOpen = WindowCacheStats.getOpenFiles();
long jgitBytes = WindowCacheStats.getOpenBytes();
long jgitOpen = WindowCacheStats.getStats().getOpenFileCount();
long jgitBytes = WindowCacheStats.getStats().getOpenByteCount();
MemSummaryInfo memSummaryInfo = new MemSummaryInfo();
memSummaryInfo.total = bytes(mTotal);
@@ -134,7 +134,7 @@ public class GetSummary implements RestReadView<ConfigResource> {
memSummaryInfo.free = bytes(mFree);
memSummaryInfo.buffers = bytes(jgitBytes);
memSummaryInfo.max = bytes(mMax);
memSummaryInfo.openFiles = toInteger(jgitOpen);
memSummaryInfo.openFiles = Long.valueOf(jgitOpen);
return memSummaryInfo;
}
@@ -257,7 +257,7 @@ public class GetSummary implements RestReadView<ConfigResource> {
public String free;
public String buffers;
public String max;
public Integer openFiles;
public Long openFiles;
}
public static class ThreadSummaryInfo {

View File

@@ -85,7 +85,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
private final Groups groups;
private final GroupResolver groupResolver;
private EnumSet<ListGroupsOption> options = EnumSet.noneOf(ListGroupsOption.class);
private Set<ListGroupsOption> options = EnumSet.noneOf(ListGroupsOption.class);
private boolean visibleToAll;
private Account.Id user;
private boolean owned;
@@ -234,7 +234,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
this.groupResolver = groupResolver;
}
public void setOptions(EnumSet<ListGroupsOption> options) {
public void setOptions(Set<ListGroupsOption> options) {
this.options = options;
}

View File

@@ -348,7 +348,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
queries.add(String.format("(state:%s)", state.name()));
}
return Joiner.on(" AND ").join(queries).toString();
return Joiner.on(" AND ").join(queries);
}
private SortedMap<String, ProjectInfo> applyAsQuery(String query) throws BadRequestException {

View File

@@ -164,12 +164,7 @@ public class SetParent
throw new ResourceConflictException("cannot set parent to self");
}
if (Iterables.tryFind(
parent.tree(),
p -> {
return p.getNameKey().equals(project);
})
.isPresent()) {
if (Iterables.tryFind(parent.tree(), p -> p.getNameKey().equals(project)).isPresent()) {
throw new ResourceConflictException(
"cycle exists between " + project.get() + " and " + parent.getName());
}

View File

@@ -32,7 +32,7 @@ public abstract class RetryingRestCollectionModifyView<
@Override
public final O apply(P parentResource, I input)
throws AuthException, BadRequestException, ResourceConflictException, Exception {
return retryHelper.execute((updateFactory) -> applyImpl(updateFactory, parentResource, input));
return retryHelper.execute(updateFactory -> applyImpl(updateFactory, parentResource, input));
}
protected abstract O applyImpl(BatchUpdate.Factory updateFactory, P parentResource, I input)

View File

@@ -27,7 +27,7 @@ public abstract class RetryingRestModifyView<R extends RestResource, I, O>
@Override
public final O apply(R resource, I input) throws Exception {
return retryHelper.execute((updateFactory) -> applyImpl(updateFactory, resource, input));
return retryHelper.execute(updateFactory -> applyImpl(updateFactory, resource, input));
}
protected abstract O applyImpl(BatchUpdate.Factory updateFactory, R resource, I input)

View File

@@ -58,14 +58,14 @@ final class FlushCaches extends SshCommand {
protected void run() throws Failure {
try {
if (list) {
if (all || caches.size() > 0) {
if (all || !caches.isEmpty()) {
throw die("cannot use --list with --all or --cache");
}
doList();
return;
}
if (all && caches.size() > 0) {
if (all && !caches.isEmpty()) {
throw die("cannot combine --all and --cache");
} else if (!all && caches.size() == 1 && caches.contains("all")) {
caches.clear();

View File

@@ -290,6 +290,10 @@ final class ShowCaches extends SshCommand {
return i != null ? i : 0;
}
private static long nullToZero(Long i) {
return i != null ? i : 0;
}
private void sshSummary() {
IoAcceptor acceptor = daemon.getIoAcceptor();
if (acceptor == null) {

View File

@@ -101,7 +101,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("abandon", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -116,7 +116,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("abandon", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -132,7 +132,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("abandon", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -148,7 +148,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("abandon", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, other)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -162,7 +162,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("abandon", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -214,7 +214,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("abandon", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -235,7 +235,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("abandon", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ABANDONED_CHANGES)
.noOneElse();
@@ -281,7 +281,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -305,7 +305,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.owner, sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -330,7 +330,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.owner, sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -355,7 +355,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.owner, sc.reviewer, other)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -379,7 +379,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(email)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -435,7 +435,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
}
@@ -448,7 +448,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -472,7 +472,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(reviewer)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -530,7 +530,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to("nonexistent@example.com")
.cc(sc.reviewer)
.cc(sc.ccerByEmail, sc.reviewerByEmail)
.cc(StagedUsers.CC_BY_EMAIL, StagedUsers.REVIEWER_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -552,7 +552,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.cc("nonexistent@example.com")
.cc(sc.reviewer)
.cc(sc.ccerByEmail, sc.reviewerByEmail)
.cc(StagedUsers.CC_BY_EMAIL, StagedUsers.REVIEWER_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -638,7 +638,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -653,7 +653,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -668,7 +668,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -683,7 +683,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -699,7 +699,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -715,7 +715,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, other)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -729,7 +729,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -773,7 +773,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -799,7 +799,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -833,7 +833,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -847,7 +847,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -870,7 +870,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -885,7 +885,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -900,7 +900,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer, other)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -909,7 +909,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newchange", sc)
.to(other)
.cc(sc.reviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1079,7 +1079,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(extraReviewer)
.cc(extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1095,7 +1095,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(sc.owner, extraReviewer)
.cc(extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1111,7 +1111,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(sc.owner, extraReviewer)
.cc(extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1128,7 +1128,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(sc.owner, extraReviewer)
.cc(admin, extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1144,7 +1144,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(extraCcer)
.cc(sc.reviewer, sc.ccer, extraReviewer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1160,7 +1160,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(extraReviewer)
.cc(extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1219,7 +1219,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteReviewer", sc)
.to(extraReviewer)
.cc(extraCcer, sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1247,7 +1247,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
@Test
public void deleteReviewerByEmailFromWipChange() throws Exception {
StagedChange sc = stageWipChangeWithExtraReviewer();
gApi.changes().id(sc.changeId).reviewer(sc.reviewerByEmail).remove();
gApi.changes().id(sc.changeId).reviewer(StagedUsers.REVIEWER_BY_EMAIL).remove();
assertThat(sender).didNotSend();
}
@@ -1314,7 +1314,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("deleteVote", sc)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1332,7 +1332,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteVote", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1349,7 +1349,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteVote", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1367,7 +1367,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteVote", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, admin, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1383,7 +1383,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("deleteVote", sc)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1399,7 +1399,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("deleteVote", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1442,7 +1442,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("deleteVote", sc)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1458,7 +1458,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("deleteVote", sc)
.cc(sc.reviewer, sc.ccer, extraReviewer, extraCcer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -1520,7 +1520,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.named(name)
.sent("merged", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS, SUBMITTED_CHANGES)
.noOneElse();
@@ -1536,7 +1536,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("merged", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS, SUBMITTED_CHANGES)
.noOneElse();
@@ -1551,7 +1551,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("merged", sc)
.to(sc.owner)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS, SUBMITTED_CHANGES)
.noOneElse();
@@ -1566,7 +1566,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("merged", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS, SUBMITTED_CHANGES)
.noOneElse();
@@ -1581,7 +1581,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("merged", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1663,7 +1663,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1679,7 +1679,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.notTo(sc.owner) // TODO(logan): This shouldn't be sent *from* the owner.
.to(sc.reviewer, other)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1695,7 +1695,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.notTo(sc.owner) // TODO(logan): This shouldn't be sent *from* the owner.
.to(sc.reviewer, other)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1712,7 +1712,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.to(sc.reviewer)
.to(other)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1728,7 +1728,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.to(sc.reviewer)
.to(other)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1787,7 +1787,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1802,7 +1802,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1825,7 +1825,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer, newReviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1849,7 +1849,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer, newReviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1864,7 +1864,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1889,7 +1889,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1904,7 +1904,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.owner, sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1919,7 +1919,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.owner, sc.reviewer, other)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -1934,7 +1934,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.owner, sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -1948,7 +1948,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.owner, sc.reviewer)
.cc(sc.ccer, other)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -2014,7 +2014,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("newpatchset", sc)
.to(sc.reviewer)
.cc(sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(NEW_PATCHSETS)
.noOneElse();
@@ -2057,7 +2057,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("restore", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2071,7 +2071,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("restore", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2085,7 +2085,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("restore", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2100,7 +2100,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("restore", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2115,7 +2115,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("restore", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2130,7 +2130,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("restore", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2169,7 +2169,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("revert", sc)
.cc(sc.reviewer, sc.ccer, admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2194,7 +2194,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("revert", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2219,7 +2219,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("revert", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer, admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2244,7 +2244,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("revert", sc)
.to(sc.owner)
.cc(other, sc.reviewer, sc.ccer, admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2281,7 +2281,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.assignee);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2294,7 +2296,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.owner)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2306,7 +2310,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, admin, sc.assignee);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2319,7 +2325,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("setassignee", sc)
.cc(admin)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2331,7 +2339,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.owner);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -2345,7 +2355,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.assignee);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2359,7 +2371,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.owner);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.noOneElse();
assertThat(sender).didNotSend();
}
@@ -2370,7 +2384,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.assignee);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2382,7 +2398,9 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assign(sc, sc.owner, sc.assignee);
assertThat(sender)
.sent("setassignee", sc)
.cc(sc.reviewerByEmail, sc.ccerByEmail) // TODO(logan): This is probably not intended!
.cc(
StagedUsers.REVIEWER_BY_EMAIL,
StagedUsers.CC_BY_EMAIL) // TODO(logan): This is probably not intended!
.to(sc.assignee)
.noOneElse();
assertThat(sender).didNotSend();
@@ -2412,7 +2430,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
assertThat(sender)
.sent("comment", sc)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();
@@ -2428,7 +2446,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest {
.sent("comment", sc)
.to(sc.owner)
.cc(sc.reviewer, sc.ccer)
.cc(sc.reviewerByEmail, sc.ccerByEmail)
.cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL)
.bcc(sc.starrer)
.bcc(ALL_COMMENTS)
.noOneElse();