Remove redundant type arguments

Change-Id: Ice5cadb0d4e73760db5355953240c3688e10cdc0
This commit is contained in:
Dave Borowitz 2018-12-21 11:24:13 -08:00
parent 1ff5ae9244
commit 4e22200be9
55 changed files with 81 additions and 105 deletions

View File

@ -394,7 +394,7 @@ public class GerritServer implements AutoCloseable {
daemon.setEnableHttpd(desc.httpd());
daemon.setLuceneModule(LuceneIndexModule.singleVersionAllLatest(0, isSlave(baseConfig)));
daemon.setDatabaseForTesting(
ImmutableList.<Module>of(
ImmutableList.of(
new InMemoryTestingDatabaseModule(cfg, site, inMemoryRepoManager),
new AbstractModule() {
@Override

View File

@ -84,7 +84,7 @@ public class CommentDetail {
private static List<Comment> get(Map<Integer, List<Comment>> m, int i) {
List<Comment> r = m.get(i);
return r != null ? orderComments(r) : Collections.<Comment>emptyList();
return r != null ? orderComments(r) : Collections.emptyList();
}
/**

View File

@ -40,7 +40,7 @@ public class ParameterizedString {
private ParameterizedString(Constant c) {
pattern = c.text;
rawPattern = c.text;
patternOps = Collections.<Format>singletonList(c);
patternOps = Collections.singletonList(c);
parameters = Collections.emptyList();
}

View File

@ -135,7 +135,7 @@ public class DynamicSet<T> implements Iterable<T> {
}
public static <T> DynamicSet<T> emptySet() {
return new DynamicSet<>(Collections.<AtomicReference<Extension<T>>>emptySet());
return new DynamicSet<>(Collections.emptySet());
}
private final CopyOnWriteArrayList<AtomicReference<Extension<T>>> items;

View File

@ -31,14 +31,14 @@ public class CheckResult {
}
static CheckResult trusted() {
return new CheckResult(Status.TRUSTED, Collections.<String>emptyList());
return new CheckResult(Status.TRUSTED, Collections.emptyList());
}
static CheckResult create(Status status, String... problems) {
List<String> problemList =
problems.length > 0
? Collections.unmodifiableList(Arrays.asList(problems))
: Collections.<String>emptyList();
: Collections.emptyList();
return new CheckResult(status, problemList);
}

View File

@ -323,7 +323,7 @@ public abstract class QueryProcessor<T> {
return requestedFields;
}
Index<?, T> index = indexes.getSearchIndex();
return index != null ? index.getSchema().getStoredFields().keySet() : ImmutableSet.<String>of();
return index != null ? index.getSchema().getStoredFields().keySet() : ImmutableSet.of();
}
/**

View File

@ -136,7 +136,7 @@ public abstract class MetricMaker {
* @return registration handle
*/
public RegistrationHandle newTrigger(CallbackMetric<?> metric1, Runnable trigger) {
return newTrigger(ImmutableSet.<CallbackMetric<?>>of(metric1), trigger);
return newTrigger(ImmutableSet.of(metric1), trigger);
}
public RegistrationHandle newTrigger(

View File

@ -18,7 +18,6 @@ import com.google.common.base.Strings;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.Version;
import com.google.gerrit.metrics.CallbackMetric;
import com.google.gerrit.metrics.CallbackMetric0;
import com.google.gerrit.metrics.CallbackMetric1;
import com.google.gerrit.metrics.Description;
@ -135,7 +134,7 @@ public class ProcMetricModule extends MetricModule {
MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
metrics.newTrigger(
ImmutableSet.<CallbackMetric<?>>of(
ImmutableSet.of(
heapCommitted, heapUsed, nonHeapCommitted, nonHeapUsed, objectPendingFinalizationCount),
() -> {
try {

View File

@ -192,7 +192,7 @@ public class Init extends BaseInit {
@Override
protected List<String> getSkippedDownloads() {
return skippedDownloads != null ? skippedDownloads : Collections.<String>emptyList();
return skippedDownloads != null ? skippedDownloads : Collections.emptyList();
}
@Override

View File

@ -46,8 +46,7 @@ public class IndexModuleOnInit extends AbstractModule {
static final String INDEX_MANAGER = "IndexModuleOnInit/IndexManager";
private static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
ImmutableList.<SchemaDefinitions<?>>of(
AccountSchemaDefinitions.INSTANCE, GroupSchemaDefinitions.INSTANCE);
ImmutableList.of(AccountSchemaDefinitions.INSTANCE, GroupSchemaDefinitions.INSTANCE);
@Override
protected void configure() {
@ -76,7 +75,7 @@ public class IndexModuleOnInit extends AbstractModule {
bind(new TypeLiteral<Map<String, Integer>>() {})
.annotatedWith(Names.named(SingleVersionModule.SINGLE_VERSIONS))
.toInstance(ImmutableMap.<String, Integer>of());
.toInstance(ImmutableMap.of());
bind(LifecycleListener.class)
.annotatedWith(Names.named(INDEX_MANAGER))
.to(SingleVersionListener.class);
@ -85,8 +84,7 @@ public class IndexModuleOnInit extends AbstractModule {
@Provides
Collection<IndexDefinition<?, ?, ?>> getIndexDefinitions(
AccountIndexDefinition accounts, GroupIndexDefinition groups) {
Collection<IndexDefinition<?, ?, ?>> result =
ImmutableList.<IndexDefinition<?, ?, ?>>of(accounts, groups);
Collection<IndexDefinition<?, ?, ?>> result = ImmutableList.of(accounts, groups);
Set<String> expected =
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();

View File

@ -107,17 +107,15 @@ public class BatchProgramModule extends FactoryModule {
// We're just running through each change
// once, so don't worry about cache removal.
bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {})
.toInstance(DynamicSet.<CacheRemovalListener>emptySet());
bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {})
.toInstance(DynamicMap.<Cache<?, ?>>emptyMap());
bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {}).toInstance(DynamicSet.emptySet());
bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {}).toInstance(DynamicMap.emptyMap());
bind(new TypeLiteral<List<CommentLinkInfo>>() {})
.toProvider(CommentLinkProvider.class)
.in(SINGLETON);
bind(new TypeLiteral<DynamicMap<ChangeQueryProcessor.ChangeAttributeFactory>>() {})
.toInstance(DynamicMap.<ChangeQueryProcessor.ChangeAttributeFactory>emptyMap());
.toInstance(DynamicMap.emptyMap());
bind(new TypeLiteral<DynamicMap<RestView<CommitResource>>>() {})
.toInstance(DynamicMap.<RestView<CommitResource>>emptyMap());
.toInstance(DynamicMap.emptyMap());
bind(String.class)
.annotatedWith(CanonicalWebUrl.class)
.toProvider(CanonicalWebUrlProvider.class);
@ -126,9 +124,8 @@ public class BatchProgramModule extends FactoryModule {
.toProvider(DisableReverseDnsLookupProvider.class)
.in(SINGLETON);
bind(Realm.class).to(FakeRealm.class);
bind(IdentifiedUser.class).toProvider(Providers.<IdentifiedUser>of(null));
bind(ReplacePatchSetSender.Factory.class)
.toProvider(Providers.<ReplacePatchSetSender.Factory>of(null));
bind(IdentifiedUser.class).toProvider(Providers.of(null));
bind(ReplacePatchSetSender.Factory.class).toProvider(Providers.of(null));
bind(CurrentUser.class).to(IdentifiedUser.class);
factory(MergeUtil.Factory.class);
factory(PatchSetInserter.Factory.class);
@ -136,17 +133,17 @@ public class BatchProgramModule extends FactoryModule {
// As Reindex is a batch program, don't assume the index is available for
// the change cache.
bind(SearchingChangeCacheImpl.class).toProvider(Providers.<SearchingChangeCacheImpl>of(null));
bind(SearchingChangeCacheImpl.class).toProvider(Providers.of(null));
bind(new TypeLiteral<ImmutableSet<GroupReference>>() {})
.annotatedWith(AdministrateServerGroups.class)
.toInstance(ImmutableSet.<GroupReference>of());
.toInstance(ImmutableSet.of());
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
.annotatedWith(GitUploadPackGroups.class)
.toInstance(Collections.<AccountGroup.UUID>emptySet());
.toInstance(Collections.emptySet());
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
.annotatedWith(GitReceivePackGroups.class)
.toInstance(Collections.<AccountGroup.UUID>emptySet());
.toInstance(Collections.emptySet());
install(new BatchGitModule());
install(new DefaultPermissionBackendModule());
@ -174,8 +171,8 @@ public class BatchProgramModule extends FactoryModule {
install(new DefaultSubmitRule.Module());
install(new IgnoreSelfApprovalRule.Module());
bind(ChangeJson.Factory.class).toProvider(Providers.<ChangeJson.Factory>of(null));
bind(EventUtil.class).toProvider(Providers.<EventUtil>of(null));
bind(ChangeJson.Factory.class).toProvider(Providers.of(null));
bind(EventUtil.class).toProvider(Providers.of(null));
bind(GitReferenceUpdated.class).toInstance(GitReferenceUpdated.DISABLED);
bind(RevisionCreated.class).toInstance(RevisionCreated.DISABLED);
bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);

View File

@ -75,7 +75,7 @@ public class ApprovalCopier {
Iterable<PatchSetApproval> getForPatchSet(
ChangeNotes notes, PatchSet.Id psId, @Nullable RevWalk rw, @Nullable Config repoConfig)
throws OrmException {
return getForPatchSet(notes, psId, rw, repoConfig, Collections.<PatchSetApproval>emptyList());
return getForPatchSet(notes, psId, rw, repoConfig, Collections.emptyList());
}
Iterable<PatchSetApproval> getForPatchSet(

View File

@ -34,8 +34,7 @@ import java.sql.Timestamp;
* state {@link ReviewerStateInternal#REMOVED} are ever exposed by this interface.
*/
public class ReviewerSet {
private static final ReviewerSet EMPTY =
new ReviewerSet(ImmutableTable.<ReviewerStateInternal, Account.Id, Timestamp>of());
private static final ReviewerSet EMPTY = new ReviewerSet(ImmutableTable.of());
public static ReviewerSet fromApprovals(Iterable<PatchSetApproval> approvals) {
PatchSetApproval first = null;

View File

@ -81,7 +81,7 @@ public class CapabilityCollection {
}
configureDefaults(tmp, section);
if (!tmp.containsKey(GlobalCapability.ADMINISTRATE_SERVER) && !admins.isEmpty()) {
tmp.put(GlobalCapability.ADMINISTRATE_SERVER, ImmutableList.<PermissionRule>of());
tmp.put(GlobalCapability.ADMINISTRATE_SERVER, ImmutableList.of());
}
ImmutableMap.Builder<String, ImmutableList<PermissionRule>> m = ImmutableMap.builder();
@ -123,7 +123,7 @@ public class CapabilityCollection {
public ImmutableList<PermissionRule> getPermission(String permissionName) {
ImmutableList<PermissionRule> r = permissions.get(permissionName);
return r != null ? r : ImmutableList.<PermissionRule>of();
return r != null ? r : ImmutableList.of();
}
private void configureDefaults(Map<String, List<PermissionRule>> out, AccessSection section) {

View File

@ -24,7 +24,7 @@ import java.util.Set;
* <p>Different accounts systems (eg. LDAP, gerrit groups) provide concrete implementations.
*/
public interface GroupMembership {
GroupMembership EMPTY = new ListGroupMembership(Collections.<AccountGroup.UUID>emptySet());
GroupMembership EMPTY = new ListGroupMembership(Collections.emptySet());
/**
* Returns {@code true} when the user this object was created for is a member of the specified

View File

@ -402,7 +402,7 @@ class Helper {
groupBase,
groupScope,
new ParameterizedString(groupMemberPattern),
Collections.<String>emptySet());
Collections.emptySet());
if (groupMemberQuery.getParameters().isEmpty()) {
throw new IllegalArgumentException("No variables in ldap.groupMemberPattern");
}

View File

@ -67,7 +67,7 @@ public class CacheMetrics {
F_NAME);
Set<CallbackMetric<?>> cacheMetrics =
ImmutableSet.<CallbackMetric<?>>of(memEnt, memHit, memEvict, perDiskEnt, perDiskHit);
ImmutableSet.of(memEnt, memHit, memEvict, perDiskEnt, perDiskHit);
metrics.newTrigger(
cacheMetrics,

View File

@ -90,7 +90,7 @@ public class ReviewerJson {
public List<ReviewerInfo> format(ReviewerResource rsrc)
throws OrmException, PermissionBackendException {
return format(ImmutableList.<ReviewerResource>of(rsrc));
return format(ImmutableList.of(rsrc));
}
public ReviewerInfo format(ReviewerInfo out, Account.Id reviewerAccountId, ChangeData cd)

View File

@ -64,8 +64,7 @@ public class SearchingChangeCacheImpl implements GitReferenceUpdatedListener {
@Override
protected void configure() {
if (slave) {
bind(SearchingChangeCacheImpl.class)
.toProvider(Providers.<SearchingChangeCacheImpl>of(null));
bind(SearchingChangeCacheImpl.class).toProvider(Providers.of(null));
} else {
cache(ID_CACHE, Project.NameKey.class, new TypeLiteral<List<CachedChange>>() {})
.maximumWeight(0)

View File

@ -252,7 +252,7 @@ public class ReplaceOp implements BatchUpdateOp {
}
if (groups.isEmpty()) {
PatchSet prevPs = psUtil.current(notes);
groups = prevPs != null ? prevPs.getGroups() : ImmutableList.<String>of();
groups = prevPs != null ? prevPs.getGroups() : ImmutableList.of();
}
ChangeData cd = changeDataFactory.create(ctx.getNotes());

View File

@ -76,7 +76,7 @@ public class IndexModule extends LifecycleModule {
}
public static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
ImmutableList.<SchemaDefinitions<?>>of(
ImmutableList.of(
AccountSchemaDefinitions.INSTANCE,
ChangeSchemaDefinitions.INSTANCE,
GroupSchemaDefinitions.INSTANCE,
@ -160,7 +160,7 @@ public class IndexModule extends LifecycleModule {
}
Collection<IndexDefinition<?, ?, ?>> result =
ImmutableList.<IndexDefinition<?, ?, ?>>of(accounts, groups, changes, projects);
ImmutableList.of(accounts, groups, changes, projects);
Set<String> expected =
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();

View File

@ -121,6 +121,6 @@ public class AccountIndexerImpl implements AccountIndexer {
return indexes.getWriteIndexes();
}
return index != null ? Collections.singleton(index) : ImmutableSet.<AccountIndex>of();
return index != null ? Collections.singleton(index) : ImmutableSet.of();
}
}

View File

@ -52,7 +52,7 @@ import java.util.Set;
public class IndexedChangeQuery extends IndexedQuery<Change.Id, ChangeData>
implements ChangeDataSource, Matchable<ChangeData> {
public static QueryOptions oneResult() {
return createOptions(IndexConfig.createDefault(), 0, 1, ImmutableSet.<String>of());
return createOptions(IndexConfig.createDefault(), 0, 1, ImmutableSet.of());
}
public static QueryOptions createOptions(

View File

@ -459,7 +459,7 @@ class ChangeNotesParser {
throws ConfigInvalidException {
String line = parseOneFooter(commit, footerKey);
if (line == null) {
throw expectedOneFooter(footerKey, Collections.<String>emptyList());
throw expectedOneFooter(footerKey, Collections.emptyList());
}
return line;
}

View File

@ -50,7 +50,7 @@ public class NoteDbModule extends FactoryModule {
} else {
bind(new TypeLiteral<Cache<ChangeNotesCache.Key, ChangeNotesState>>() {})
.annotatedWith(Names.named(ChangeNotesCache.CACHE_NAME))
.toInstance(CacheBuilder.newBuilder().<ChangeNotesCache.Key, ChangeNotesState>build());
.toInstance(CacheBuilder.newBuilder().build());
}
}
}

View File

@ -64,7 +64,7 @@ class RevisionNoteMap<T extends RevisionNote<? extends Comment>> {
}
static <T extends RevisionNote<? extends Comment>> RevisionNoteMap<T> emptyMap() {
return new RevisionNoteMap<>(NoteMap.newEmptyMap(), ImmutableMap.<RevId, T>of());
return new RevisionNoteMap<>(NoteMap.newEmptyMap(), ImmutableMap.of());
}
private RevisionNoteMap(NoteMap noteMap, ImmutableMap<RevId, T> revisionNotes) {

View File

@ -114,7 +114,7 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
for (Class<? extends Annotation> annotoation : annotations) {
String descr = classObjToClassDescr.get(annotoation);
Collection<ClassData> discoverdData = rawMap.get(descr);
Collection<ClassData> values = firstNonNull(discoverdData, Collections.<ClassData>emptySet());
Collection<ClassData> values = firstNonNull(discoverdData, Collections.emptySet());
result.put(
annotoation,
@ -144,7 +144,7 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
continue;
}
ClassData def = new ClassData(Collections.<String>emptySet());
ClassData def = new ClassData(Collections.emptySet());
try {
new ClassReader(read(jarFile, entry)).accept(def, SKIP_ALL);
} catch (RuntimeException err) {

View File

@ -95,7 +95,7 @@ public class IsWatchedByPredicate extends AndPredicate<ChangeData> {
if (user.isIdentifiedUser()) {
return user.asIdentifiedUser().state().getProjectWatches().keySet();
}
return Collections.<ProjectWatchKey>emptySet();
return Collections.emptySet();
}
protected static List<Predicate<ChangeData>> none() {

View File

@ -109,7 +109,7 @@ public class AddSshKey
}
user.getUserName().ifPresent(sshKeyCache::evict);
return Response.<SshKeyInfo>created(GetSshKeys.newSshKeyInfo(sshKey));
return Response.created(GetSshKeys.newSshKeyInfo(sshKey));
} catch (InvalidSshKeyException e) {
throw new BadRequestException(e.getMessage());
}

View File

@ -117,7 +117,7 @@ public class PutHttpPassword implements RestModifyView<AccountResource, HttpPass
ExternalId.createWithPassword(
extId.key(), extId.accountId(), extId.email(), newPassword)));
return Strings.isNullOrEmpty(newPassword) ? Response.<String>none() : Response.ok(newPassword);
return Strings.isNullOrEmpty(newPassword) ? Response.none() : Response.ok(newPassword);
}
@UsedAt(UsedAt.Project.PLUGIN_SERVICEUSER)

View File

@ -76,7 +76,7 @@ public class GetMergeList implements RestReadView<RevisionResource> {
}
if (commit.getParentCount() < 2) {
return createResponse(rsrc, ImmutableList.<CommitInfo>of());
return createResponse(rsrc, ImmutableList.of());
}
List<RevCommit> commits = MergeListBuilder.build(rw, commit, uninterestingParent);

View File

@ -55,7 +55,7 @@ public class PostHashtags
SetHashtagsOp op = hashtagsFactory.create(input);
bu.addOp(req.getId(), op);
bu.execute();
return Response.<ImmutableSortedSet<String>>ok(op.getUpdatedHashtags());
return Response.ok(op.getUpdatedHashtags());
}
}

View File

@ -156,7 +156,7 @@ public class CreateGroup
args.initialMembers =
ownerUuid == null
? Collections.singleton(self.get().getAccountId())
: Collections.<Account.Id>emptySet();
: Collections.emptySet();
}
try {

View File

@ -72,7 +72,7 @@ public class PutDescription implements RestModifyView<GroupResource, Description
}
return Strings.isNullOrEmpty(input.description)
? Response.<String>none()
? Response.none()
: Response.ok(input.description);
}
}

View File

@ -88,7 +88,7 @@ public class PutDescription implements RestModifyView<ProjectResource, Descripti
md.getRepository().setGitwebDescription(project.getDescription());
return Strings.isNullOrEmpty(project.getDescription())
? Response.<String>none()
? Response.none()
: Response.ok(project.getDescription());
} catch (RepositoryNotFoundException notFound) {
throw new ResourceNotFoundException(resource.getName());

View File

@ -61,14 +61,12 @@ public class ChangeSet {
}
public ChangeSet(Iterable<ChangeData> changes, Iterable<ChangeData> hiddenChanges) {
changeData = index(changes, ImmutableList.<Change.Id>of());
changeData = index(changes, ImmutableList.of());
nonVisibleChanges = index(hiddenChanges, changeData.keySet());
}
public ChangeSet(ChangeData change, boolean visible) {
this(
visible ? ImmutableList.of(change) : ImmutableList.<ChangeData>of(),
ImmutableList.of(change));
this(visible ? ImmutableList.of(change) : ImmutableList.of(), ImmutableList.of(change));
}
public ImmutableSet<Change.Id> ids() {

View File

@ -164,7 +164,7 @@ public class CherryPick extends SubmitStrategy {
ctx.getUpdate(psId),
psId,
newCommit,
prevPs != null ? prevPs.getGroups() : ImmutableList.<String>of(),
prevPs != null ? prevPs.getGroups() : ImmutableList.of(),
null,
null);
ctx.getChange().setCurrentPatchSet(patchSetInfo);

View File

@ -233,7 +233,7 @@ public class RebaseSubmitStrategy extends SubmitStrategy {
ctx.getUpdate(newPatchSetId),
newPatchSetId,
newCommit,
prevPs != null ? prevPs.getGroups() : ImmutableList.<String>of(),
prevPs != null ? prevPs.getGroups() : ImmutableList.of(),
null,
null);
}

View File

@ -99,7 +99,7 @@ public class SubmitStrategyListener implements BatchUpdateListener {
args.rw,
args.canMergeFlag,
args.mergeTip.getCurrentTip(),
initialTip == null ? ImmutableSet.<RevCommit>of() : ImmutableSet.of(initialTip));
initialTip == null ? ImmutableSet.of() : ImmutableSet.of(initialTip));
}
}

View File

@ -66,7 +66,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.mina.transport.socket.SocketSessionConfig;
import org.apache.sshd.common.BaseBuilder;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.channel.RequestHandler;
import org.apache.sshd.common.cipher.Cipher;
import org.apache.sshd.common.compression.BuiltinCompressions;
import org.apache.sshd.common.compression.Compression;
@ -87,7 +86,6 @@ import org.apache.sshd.common.keyprovider.KeyPairProvider;
import org.apache.sshd.common.mac.Mac;
import org.apache.sshd.common.random.Random;
import org.apache.sshd.common.random.SingletonRandomFactory;
import org.apache.sshd.common.session.ConnectionService;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
@ -100,7 +98,6 @@ import org.apache.sshd.server.auth.gss.GSSAuthenticator;
import org.apache.sshd.server.auth.gss.UserAuthGSSFactory;
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.command.CommandFactory;
import org.apache.sshd.server.forward.ForwardingFilter;
import org.apache.sshd.server.global.CancelTcpipForwardHandler;
@ -293,7 +290,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
}
});
setGlobalRequestHandlers(
Arrays.<RequestHandler<ConnectionService>>asList(
Arrays.asList(
new KeepAliveHandler(),
new NoMoreSessionsHandler(),
new TcpipForwardHandler(),
@ -654,7 +651,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
}
private void initSubsystems() {
setSubsystemFactories(Collections.<NamedFactory<Command>>emptyList());
setSubsystemFactories(Collections.emptyList());
}
private void initUserAuth(

View File

@ -238,7 +238,7 @@ public class UploadArchive extends AbstractGitCommand {
options.level9)
.indexOf(true);
if (value >= 0) {
return ImmutableMap.<String, Object>of("level", Integer.valueOf(value));
return ImmutableMap.of("level", Integer.valueOf(value));
}
}
return Collections.emptyMap();

View File

@ -95,7 +95,7 @@ public class TestChanges {
.load(),
user,
TimeUtil.nowTs(),
Ordering.<String>natural());
Ordering.natural());
ChangeNotes notes = update.getNotes();
boolean hasPatchSets = notes.getPatchSets() != null && !notes.getPatchSets().isEmpty();

View File

@ -1931,7 +1931,7 @@ public class AccountIT extends AbstractDaemonTest {
addExternalIdEmail(admin, PushCertificateIdent.parse(key.getFirstUserId()).getEmailAddress());
toAdd.add(key.getPublicKeyArmored());
}
gApi.accounts().self().putGpgKeys(toAdd, ImmutableList.<String>of());
gApi.accounts().self().putGpgKeys(toAdd, ImmutableList.of());
assertKeys(keys);
accountIndexedCounter.assertReindexOf(admin);
}
@ -2869,13 +2869,13 @@ public class AccountIT extends AbstractDaemonTest {
private Map<String, GpgKeyInfo> addGpgKey(String armored) throws Exception {
Map<String, GpgKeyInfo> gpgKeys =
gApi.accounts().self().putGpgKeys(ImmutableList.of(armored), ImmutableList.<String>of());
gApi.accounts().self().putGpgKeys(ImmutableList.of(armored), ImmutableList.of());
accountIndexedCounter.assertReindexOf(gApi.accounts().self().get());
return gpgKeys;
}
private Map<String, GpgKeyInfo> addGpgKeyNoReindex(String armored) throws Exception {
return gApi.accounts().self().putGpgKeys(ImmutableList.of(armored), ImmutableList.<String>of());
return gApi.accounts().self().putGpgKeys(ImmutableList.of(armored), ImmutableList.of());
}
private void assertUser(AccountInfo info, TestAccount account) throws Exception {

View File

@ -366,8 +366,7 @@ public class SubmitResolvingMergeCommitIT extends AbstractDaemonTest {
@Override
protected PushOneCommit.Result createChange(String subject) throws Exception {
return createChange(
testRepo, subject, "", "", Collections.<RevCommit>emptyList(), "refs/for/master");
return createChange(testRepo, subject, "", "", Collections.emptyList(), "refs/for/master");
}
private PushOneCommit.Result createChange(String subject, List<RevCommit> parents)

View File

@ -154,6 +154,6 @@ public class DeleteTagsIT extends AbstractDaemonTest {
}
private void assertTagsDeleted() throws Exception {
assertTags(ImmutableList.<String>of());
assertTags(ImmutableList.of());
}
}

View File

@ -608,7 +608,7 @@ public class GetRelatedIT extends AbstractDaemonTest {
@Override
public boolean updateChange(ChangeContext ctx) throws OrmException {
PatchSet ps = psUtil.get(ctx.getNotes(), psId);
psUtil.setGroups(ctx.getUpdate(psId), ps, ImmutableList.<String>of());
psUtil.setGroups(ctx.getUpdate(psId), ps, ImmutableList.of());
return true;
}
});

View File

@ -58,7 +58,7 @@ public class FieldPredicateTest extends PredicateTest {
@Test
public void testCopy() {
final OperatorPredicate<String> f = f("author", "alice");
assertSame(f, f.copy(Collections.<Predicate<String>>emptyList()));
assertSame(f, f.copy(Collections.emptyList()));
assertSame(f, f.copy(f.getChildren()));
exception.expect(IllegalArgumentException.class);

View File

@ -113,7 +113,7 @@ public class NotPredicateTest extends PredicateTest {
assertEquals(sb, n.copy(sb).getChildren());
try {
n.copy(Collections.<Predicate>emptyList());
n.copy(Collections.emptyList());
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
assertEquals("Expected exactly one child", e.getMessage());

View File

@ -44,7 +44,7 @@ public class LibrariesTest extends GerritBaseTests {
return new LibraryDownloader(ui, site, remover);
}
},
Collections.<String>emptyList(),
Collections.emptyList(),
false);
assertNotNull(lib.mysqlDriver);

View File

@ -208,6 +208,6 @@ public class LabelNormalizerTest extends GerritBaseTests {
}
private static List<PatchSetApproval> list(PatchSetApproval... psas) {
return ImmutableList.<PatchSetApproval>copyOf(psas);
return ImmutableList.copyOf(psas);
}
}

View File

@ -255,7 +255,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
private static QueryOptions options(int start, int limit) {
return IndexedChangeQuery.createOptions(CONFIG, start, limit, ImmutableSet.<String>of());
return IndexedChangeQuery.createOptions(CONFIG, start, limit, ImmutableSet.of());
}
private Set<Change.Status> status(String query) throws QueryParseException {

View File

@ -15,7 +15,6 @@
package com.google.gerrit.server.index.change;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.index.FieldDef;
import com.google.gerrit.index.QueryOptions;
import com.google.gerrit.index.Schema;
import com.google.gerrit.index.query.FieldBundle;
@ -30,8 +29,7 @@ import org.junit.Ignore;
@Ignore
public class FakeChangeIndex implements ChangeIndex {
static final Schema<ChangeData> V1 =
new Schema<>(1, ImmutableList.<FieldDef<ChangeData, ?>>of(ChangeField.STATUS));
static final Schema<ChangeData> V1 = new Schema<>(1, ImmutableList.of(ChangeField.STATUS));
static final Schema<ChangeData> V2 =
new Schema<>(2, ImmutableList.of(ChangeField.STATUS, ChangeField.PATH, ChangeField.UPDATED));

View File

@ -138,7 +138,7 @@ public abstract class AbstractChangeNotesTest extends GerritBaseTests {
bind(AllUsersName.class).toProvider(AllUsersNameProvider.class);
bind(String.class).annotatedWith(GerritServerId.class).toInstance("gerrit");
bind(GitRepositoryManager.class).toInstance(repoManager);
bind(ProjectCache.class).toProvider(Providers.<ProjectCache>of(null));
bind(ProjectCache.class).toProvider(Providers.of(null));
bind(Config.class).annotatedWith(GerritServerConfig.class).toInstance(testConfig);
bind(String.class)
.annotatedWith(AnonymousCowardName.class)

View File

@ -973,8 +973,8 @@ public class RefControlTest extends GerritBaseTests {
private ProjectControl user(
ProjectConfig local, @Nullable String name, AccountGroup.UUID... memberOf) {
return new ProjectControl(
Collections.<AccountGroup.UUID>emptySet(),
Collections.<AccountGroup.UUID>emptySet(),
Collections.emptySet(),
Collections.emptySet(),
sectionSorter,
changeControlFactory,
permissionBackend,

View File

@ -1409,9 +1409,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
ReviewInput.CommentInput commentInput = new ReviewInput.CommentInput();
commentInput.line = 1;
commentInput.message = "inline";
input.comments =
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(commentInput));
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(commentInput));
gApi.changes().id(change.getId().get()).current().review(input);
Map<String, List<CommentInfo>> comments =
@ -1600,7 +1598,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
Change change4 = insert(repo, ins4);
ReviewInput ri4 = new ReviewInput();
ri4.message = "toplevel";
ri4.labels = ImmutableMap.<String, Short>of("Code-Review", (short) 1);
ri4.labels = ImmutableMap.of("Code-Review", (short) 1);
gApi.changes().id(change4.getId().get()).current().review(ri4);
ChangeInserter ins5 = newChangeWithTopic(repo, "feature5");
@ -1672,9 +1670,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
comment.line = 1;
comment.message = "inline";
input.comments =
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
gApi.changes().id(change1.getId().get()).current().review(input);
input = new ReviewInput();
@ -1839,9 +1835,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
comment.line = 1;
comment.message = "inline";
input.comments =
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
gApi.changes().id(change2.getId().get()).current().review(input);
assertQuery("from:" + userId.get(), change2, change1);
@ -3103,9 +3097,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
comment.line = 1;
comment.message = message;
comment.unresolved = unresolved;
input.comments =
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
gApi.changes().id(changeId).current().review(input);
}