Use native constructors instead of Guava to instantiate empty collections
It's not necessary to use Guava's helper methods when instantiating empty collections. Just use the native constructors. Change-Id: I7f454909b15924ee49e149edf9f053da9f718502
This commit is contained in:
@@ -18,7 +18,6 @@ import static com.googlecode.prolog_cafe.lang.PrologMachineCopy.save;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.client.RefNames;
|
||||
@@ -61,6 +60,7 @@ import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -283,7 +283,7 @@ public class RulesCache {
|
||||
predicateProviders, cl)));
|
||||
ctl.setEnabled(EnumSet.allOf(Prolog.Feature.class), false);
|
||||
|
||||
List<String> packages = Lists.newArrayList();
|
||||
List<String> packages = new ArrayList<>();
|
||||
packages.addAll(PACKAGE_LIST);
|
||||
for (PredicateProvider predicateProvider : predicateProviders) {
|
||||
packages.addAll(predicateProvider.getPackages());
|
||||
|
||||
@@ -16,7 +16,6 @@ package com.google.gerrit.rules;
|
||||
|
||||
import static com.google.gerrit.rules.StoredValue.create;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
@@ -45,6 +44,7 @@ import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public final class StoredValues {
|
||||
@@ -150,7 +150,7 @@ public final class StoredValues {
|
||||
new StoredValue<Map<Account.Id, IdentifiedUser>>() {
|
||||
@Override
|
||||
protected Map<Account.Id, IdentifiedUser> createValue(Prolog engine) {
|
||||
return Maps.newHashMap();
|
||||
return new HashMap<>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user