Remove redundant specification of type arguments
Change-Id: I375d8df4a3c565b14aa5dca96dcc71e2521f4f02
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java b/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
index 413e724..79c1d36 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
@@ -53,7 +53,7 @@
public void add(PatchSet.Id psId) {
if (changes == null) {
- changes = new ArrayList<Change>();
+ changes = new ArrayList<>();
}
changes.add(new Batch.Change(psId));
}
@@ -88,7 +88,7 @@
public Destination getDestination(Branch.NameKey branch) {
if (destinations == null) {
- destinations = new ArrayList<Destination>();
+ destinations = new ArrayList<>();
}
Destination dest = getExistingDestination(branch);
if (dest == null) {
@@ -102,7 +102,7 @@
protected Destination getExistingDestination(Branch.NameKey branch) {
if (destinations == null) {
- destinations = new ArrayList<Destination>();
+ destinations = new ArrayList<>();
}
for (Destination dest : destinations) {
if (dest.project.equals(branch.getParentKey().get()) && dest.ref.equals(branch.get())) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCleaner.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCleaner.java
index fe5c795..5c8d640 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCleaner.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCleaner.java
@@ -111,7 +111,7 @@
this.list = list;
this.userProvider = userProvider;
- list.query = new ArrayList<String>();
+ list.query = new ArrayList<>();
list.query.add("is:expired");
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/ListBatches.java b/src/main/java/com/googlesource/gerrit/plugins/batch/ListBatches.java
index 778d72f..b997d75 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/ListBatches.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/ListBatches.java
@@ -82,7 +82,7 @@
pred = queryBuilder.parse(Joiner.on(" ").join(query));
includeBatchInfo = true;
}
- List<Batch> batches = new ArrayList<Batch>();
+ List<Batch> batches = new ArrayList<>();
for (Batch batch : store.find(includeBatchInfo)) {
if (pred == null || pred.asMatchable().match(batch)) {
batches.add(batch);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/FastForwardOptions.java b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/FastForwardOptions.java
index 3c8c5f9..7f034d7 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/FastForwardOptions.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/FastForwardOptions.java
@@ -38,8 +38,7 @@
public FastForwardMode getFastForwardMode() throws UnloggedFailure {
if (selected == null) {
- EnumMap<FastForwardMode, Boolean> valuesByMode =
- new EnumMap<FastForwardMode, Boolean>(FastForwardMode.class);
+ EnumMap<FastForwardMode, Boolean> valuesByMode = new EnumMap<>(FastForwardMode.class);
valuesByMode.put(FastForwardMode.FF, ff);
valuesByMode.put(FastForwardMode.NO_FF, noff);
valuesByMode.put(FastForwardMode.FF_ONLY, ffOnly);
@@ -62,7 +61,7 @@
}
protected static Set<String> toStrings(EnumSet<FastForwardMode> modes) {
- Set<String> out = new HashSet<String>();
+ Set<String> out = new HashSet<>();
for (FastForwardMode mode : modes) {
out.add(mode.getName());
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/query/BatchQueryBuilder.java b/src/main/java/com/googlesource/gerrit/plugins/batch/query/BatchQueryBuilder.java
index 53f1b6f..43ae707 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/query/BatchQueryBuilder.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/query/BatchQueryBuilder.java
@@ -51,7 +51,7 @@
}
protected static final QueryBuilder.Definition<Batch, BatchQueryBuilder> mydef =
- new QueryBuilder.Definition<Batch, BatchQueryBuilder>(BatchQueryBuilder.class);
+ new QueryBuilder.Definition<>(BatchQueryBuilder.class);
public static final long DEFAULT_SECONDS = TimeUnit.SECONDS.convert(3, TimeUnit.DAYS);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
index f615ae3..8adf607 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
@@ -39,6 +39,7 @@
parseCommandLine(impl);
impl.display(out);
}
- }, AccessPath.SSH_COMMAND);
+ },
+ AccessPath.SSH_COMMAND);
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
index a18b35b..bfc2f6b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
@@ -69,7 +69,7 @@
public boolean close;
protected LinkedHashMap<PatchSet.Id, PatchSetArgument> patchSetArgumentsByPatchSet =
- new LinkedHashMap<PatchSet.Id, PatchSetArgument>();
+ new LinkedHashMap<>();
@Argument(
index = 0,
@@ -89,8 +89,7 @@
@Inject protected ReviewDb db;
@Inject protected IdentifiedUser user;
@Inject protected GitRepositoryManager repoManager;
- protected Map<PatchSet.Id, List<ObjectId>> parentsByPsarg =
- new HashMap<PatchSet.Id, List<ObjectId>>();
+ protected Map<PatchSet.Id, List<ObjectId>> parentsByPsarg = new HashMap<>();
@Override
public void run() throws Exception {
@@ -200,17 +199,16 @@
}
protected class Destination {
- List<PatchSetArgument> remaining = new ArrayList<PatchSetArgument>();
- Set<ObjectId> sources = new HashSet<ObjectId>();
+ List<PatchSetArgument> remaining = new ArrayList<>();
+ Set<ObjectId> sources = new HashSet<>();
Destination(Branch.NameKey branch) throws IOException, NoSuchRefException {
sources.add(getTip(branch));
}
}
- protected Map<Branch.NameKey, Destination> destinationsByBranches =
- new HashMap<Branch.NameKey, Destination>();
- protected List<PatchSetArgument> resolved = new ArrayList<PatchSetArgument>();
+ protected Map<Branch.NameKey, Destination> destinationsByBranches = new HashMap<>();
+ protected List<PatchSetArgument> resolved = new ArrayList<>();
protected Resolver(Iterable<PatchSetArgument> psargs)
throws Exception, IOException, OrmException, NoSuchRefException,
@@ -288,7 +286,7 @@
protected List<ObjectId> loadParents(PatchSetArgument psarg) throws IOException {
try (Repository repo = repoManager.openRepository(psarg.change.getProject());
RevWalk revWalk = new RevWalk(repo)) {
- List<ObjectId> parents = new ArrayList<ObjectId>();
+ List<ObjectId> parents = new ArrayList<>();
ObjectId id = ObjectId.fromString(psarg.patchSet.getRevision().get());
RevCommit c = revWalk.parseCommit(id);
for (RevCommit parent : c.getParents()) {