Merge "Fix ModifiedButNotUsed error flagged by error prone"
This commit is contained in:
@@ -49,10 +49,8 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DeleteReviewerOp implements BatchUpdateOp {
|
||||
@@ -134,12 +132,10 @@ public class DeleteReviewerOp implements BatchUpdateOp {
|
||||
msg.append("Removed reviewer " + reviewer.account().fullName());
|
||||
StringBuilder removedVotesMsg = new StringBuilder();
|
||||
removedVotesMsg.append(" with the following votes:\n\n");
|
||||
List<PatchSetApproval> del = new ArrayList<>();
|
||||
boolean votesRemoved = false;
|
||||
for (PatchSetApproval a : approvals(ctx, reviewerId)) {
|
||||
// Check if removing this vote is OK
|
||||
removeReviewerControl.checkRemoveReviewer(ctx.getNotes(), ctx.getUser(), a);
|
||||
del.add(a);
|
||||
if (a.patchSetId().equals(currPs.id()) && a.value() != 0) {
|
||||
oldApprovals.put(a.label(), a.value());
|
||||
removedVotesMsg
|
||||
|
||||
@@ -21,7 +21,6 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.vladsch.flexmark.Extension;
|
||||
import com.vladsch.flexmark.ast.Block;
|
||||
import com.vladsch.flexmark.ast.Heading;
|
||||
import com.vladsch.flexmark.ast.Node;
|
||||
@@ -36,7 +35,6 @@ import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.eclipse.jgit.util.RawParseUtils;
|
||||
@@ -95,11 +93,6 @@ public class MarkdownFormatter {
|
||||
options, MarkdownFormatterHeader.HeadingExtension.create())
|
||||
.toMutable();
|
||||
|
||||
ArrayList<Extension> extensions = new ArrayList<>();
|
||||
for (Extension extension : optionsExt.get(com.vladsch.flexmark.parser.Parser.EXTENSIONS)) {
|
||||
extensions.add(extension);
|
||||
}
|
||||
|
||||
return optionsExt;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import static com.google.common.base.Preconditions.checkState;
|
||||
import static org.eclipse.jgit.lib.Constants.OBJ_BLOB;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.gerrit.entities.Account;
|
||||
import com.google.gerrit.entities.Change;
|
||||
import com.google.gerrit.entities.Comment;
|
||||
@@ -37,7 +36,6 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
||||
import org.eclipse.jgit.lib.CommitBuilder;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
@@ -191,7 +189,6 @@ public class ChangeDraftUpdate extends AbstractChangeUpdate {
|
||||
RevWalk rw, ObjectInserter ins, ObjectId curr, CommitBuilder cb)
|
||||
throws ConfigInvalidException, IOException {
|
||||
RevisionNoteMap<ChangeRevisionNote> rnm = getRevisionNoteMap(rw, curr);
|
||||
Set<ObjectId> updatedCommits = Sets.newHashSetWithExpectedSize(rnm.revisionNotes.size());
|
||||
RevisionNoteBuilder.Cache cache = new RevisionNoteBuilder.Cache(rnm);
|
||||
|
||||
for (Comment c : put) {
|
||||
@@ -207,7 +204,6 @@ public class ChangeDraftUpdate extends AbstractChangeUpdate {
|
||||
Map<ObjectId, RevisionNoteBuilder> builders = cache.getBuilders();
|
||||
boolean touchedAnyRevs = false;
|
||||
for (Map.Entry<ObjectId, RevisionNoteBuilder> e : builders.entrySet()) {
|
||||
updatedCommits.add(e.getKey());
|
||||
ObjectId id = e.getKey();
|
||||
byte[] data = e.getValue().build(noteUtil.getChangeNoteJson());
|
||||
if (!Arrays.equals(data, e.getValue().baseRaw)) {
|
||||
|
||||
Reference in New Issue
Block a user