Remove redundant type arguments
Change-Id: Ice5cadb0d4e73760db5355953240c3688e10cdc0
This commit is contained in:
parent
1ff5ae9244
commit
4e22200be9
@ -394,7 +394,7 @@ public class GerritServer implements AutoCloseable {
|
|||||||
daemon.setEnableHttpd(desc.httpd());
|
daemon.setEnableHttpd(desc.httpd());
|
||||||
daemon.setLuceneModule(LuceneIndexModule.singleVersionAllLatest(0, isSlave(baseConfig)));
|
daemon.setLuceneModule(LuceneIndexModule.singleVersionAllLatest(0, isSlave(baseConfig)));
|
||||||
daemon.setDatabaseForTesting(
|
daemon.setDatabaseForTesting(
|
||||||
ImmutableList.<Module>of(
|
ImmutableList.of(
|
||||||
new InMemoryTestingDatabaseModule(cfg, site, inMemoryRepoManager),
|
new InMemoryTestingDatabaseModule(cfg, site, inMemoryRepoManager),
|
||||||
new AbstractModule() {
|
new AbstractModule() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,7 +84,7 @@ public class CommentDetail {
|
|||||||
|
|
||||||
private static List<Comment> get(Map<Integer, List<Comment>> m, int i) {
|
private static List<Comment> get(Map<Integer, List<Comment>> m, int i) {
|
||||||
List<Comment> r = m.get(i);
|
List<Comment> r = m.get(i);
|
||||||
return r != null ? orderComments(r) : Collections.<Comment>emptyList();
|
return r != null ? orderComments(r) : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +40,7 @@ public class ParameterizedString {
|
|||||||
private ParameterizedString(Constant c) {
|
private ParameterizedString(Constant c) {
|
||||||
pattern = c.text;
|
pattern = c.text;
|
||||||
rawPattern = c.text;
|
rawPattern = c.text;
|
||||||
patternOps = Collections.<Format>singletonList(c);
|
patternOps = Collections.singletonList(c);
|
||||||
parameters = Collections.emptyList();
|
parameters = Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ public class DynamicSet<T> implements Iterable<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static <T> DynamicSet<T> emptySet() {
|
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;
|
private final CopyOnWriteArrayList<AtomicReference<Extension<T>>> items;
|
||||||
|
@ -31,14 +31,14 @@ public class CheckResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static CheckResult trusted() {
|
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) {
|
static CheckResult create(Status status, String... problems) {
|
||||||
List<String> problemList =
|
List<String> problemList =
|
||||||
problems.length > 0
|
problems.length > 0
|
||||||
? Collections.unmodifiableList(Arrays.asList(problems))
|
? Collections.unmodifiableList(Arrays.asList(problems))
|
||||||
: Collections.<String>emptyList();
|
: Collections.emptyList();
|
||||||
return new CheckResult(status, problemList);
|
return new CheckResult(status, problemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ public abstract class QueryProcessor<T> {
|
|||||||
return requestedFields;
|
return requestedFields;
|
||||||
}
|
}
|
||||||
Index<?, T> index = indexes.getSearchIndex();
|
Index<?, T> index = indexes.getSearchIndex();
|
||||||
return index != null ? index.getSchema().getStoredFields().keySet() : ImmutableSet.<String>of();
|
return index != null ? index.getSchema().getStoredFields().keySet() : ImmutableSet.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,7 +136,7 @@ public abstract class MetricMaker {
|
|||||||
* @return registration handle
|
* @return registration handle
|
||||||
*/
|
*/
|
||||||
public RegistrationHandle newTrigger(CallbackMetric<?> metric1, Runnable trigger) {
|
public RegistrationHandle newTrigger(CallbackMetric<?> metric1, Runnable trigger) {
|
||||||
return newTrigger(ImmutableSet.<CallbackMetric<?>>of(metric1), trigger);
|
return newTrigger(ImmutableSet.of(metric1), trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RegistrationHandle newTrigger(
|
public RegistrationHandle newTrigger(
|
||||||
|
@ -18,7 +18,6 @@ import com.google.common.base.Strings;
|
|||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.gerrit.common.Version;
|
import com.google.gerrit.common.Version;
|
||||||
import com.google.gerrit.metrics.CallbackMetric;
|
|
||||||
import com.google.gerrit.metrics.CallbackMetric0;
|
import com.google.gerrit.metrics.CallbackMetric0;
|
||||||
import com.google.gerrit.metrics.CallbackMetric1;
|
import com.google.gerrit.metrics.CallbackMetric1;
|
||||||
import com.google.gerrit.metrics.Description;
|
import com.google.gerrit.metrics.Description;
|
||||||
@ -135,7 +134,7 @@ public class ProcMetricModule extends MetricModule {
|
|||||||
|
|
||||||
MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
|
MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
|
||||||
metrics.newTrigger(
|
metrics.newTrigger(
|
||||||
ImmutableSet.<CallbackMetric<?>>of(
|
ImmutableSet.of(
|
||||||
heapCommitted, heapUsed, nonHeapCommitted, nonHeapUsed, objectPendingFinalizationCount),
|
heapCommitted, heapUsed, nonHeapCommitted, nonHeapUsed, objectPendingFinalizationCount),
|
||||||
() -> {
|
() -> {
|
||||||
try {
|
try {
|
||||||
|
@ -192,7 +192,7 @@ public class Init extends BaseInit {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getSkippedDownloads() {
|
protected List<String> getSkippedDownloads() {
|
||||||
return skippedDownloads != null ? skippedDownloads : Collections.<String>emptyList();
|
return skippedDownloads != null ? skippedDownloads : Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,8 +46,7 @@ public class IndexModuleOnInit extends AbstractModule {
|
|||||||
static final String INDEX_MANAGER = "IndexModuleOnInit/IndexManager";
|
static final String INDEX_MANAGER = "IndexModuleOnInit/IndexManager";
|
||||||
|
|
||||||
private static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
|
private static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
|
||||||
ImmutableList.<SchemaDefinitions<?>>of(
|
ImmutableList.of(AccountSchemaDefinitions.INSTANCE, GroupSchemaDefinitions.INSTANCE);
|
||||||
AccountSchemaDefinitions.INSTANCE, GroupSchemaDefinitions.INSTANCE);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
@ -76,7 +75,7 @@ public class IndexModuleOnInit extends AbstractModule {
|
|||||||
|
|
||||||
bind(new TypeLiteral<Map<String, Integer>>() {})
|
bind(new TypeLiteral<Map<String, Integer>>() {})
|
||||||
.annotatedWith(Names.named(SingleVersionModule.SINGLE_VERSIONS))
|
.annotatedWith(Names.named(SingleVersionModule.SINGLE_VERSIONS))
|
||||||
.toInstance(ImmutableMap.<String, Integer>of());
|
.toInstance(ImmutableMap.of());
|
||||||
bind(LifecycleListener.class)
|
bind(LifecycleListener.class)
|
||||||
.annotatedWith(Names.named(INDEX_MANAGER))
|
.annotatedWith(Names.named(INDEX_MANAGER))
|
||||||
.to(SingleVersionListener.class);
|
.to(SingleVersionListener.class);
|
||||||
@ -85,8 +84,7 @@ public class IndexModuleOnInit extends AbstractModule {
|
|||||||
@Provides
|
@Provides
|
||||||
Collection<IndexDefinition<?, ?, ?>> getIndexDefinitions(
|
Collection<IndexDefinition<?, ?, ?>> getIndexDefinitions(
|
||||||
AccountIndexDefinition accounts, GroupIndexDefinition groups) {
|
AccountIndexDefinition accounts, GroupIndexDefinition groups) {
|
||||||
Collection<IndexDefinition<?, ?, ?>> result =
|
Collection<IndexDefinition<?, ?, ?>> result = ImmutableList.of(accounts, groups);
|
||||||
ImmutableList.<IndexDefinition<?, ?, ?>>of(accounts, groups);
|
|
||||||
Set<String> expected =
|
Set<String> expected =
|
||||||
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
|
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
|
||||||
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();
|
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();
|
||||||
|
@ -107,17 +107,15 @@ public class BatchProgramModule extends FactoryModule {
|
|||||||
|
|
||||||
// We're just running through each change
|
// We're just running through each change
|
||||||
// once, so don't worry about cache removal.
|
// once, so don't worry about cache removal.
|
||||||
bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {})
|
bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {}).toInstance(DynamicSet.emptySet());
|
||||||
.toInstance(DynamicSet.<CacheRemovalListener>emptySet());
|
bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {}).toInstance(DynamicMap.emptyMap());
|
||||||
bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {})
|
|
||||||
.toInstance(DynamicMap.<Cache<?, ?>>emptyMap());
|
|
||||||
bind(new TypeLiteral<List<CommentLinkInfo>>() {})
|
bind(new TypeLiteral<List<CommentLinkInfo>>() {})
|
||||||
.toProvider(CommentLinkProvider.class)
|
.toProvider(CommentLinkProvider.class)
|
||||||
.in(SINGLETON);
|
.in(SINGLETON);
|
||||||
bind(new TypeLiteral<DynamicMap<ChangeQueryProcessor.ChangeAttributeFactory>>() {})
|
bind(new TypeLiteral<DynamicMap<ChangeQueryProcessor.ChangeAttributeFactory>>() {})
|
||||||
.toInstance(DynamicMap.<ChangeQueryProcessor.ChangeAttributeFactory>emptyMap());
|
.toInstance(DynamicMap.emptyMap());
|
||||||
bind(new TypeLiteral<DynamicMap<RestView<CommitResource>>>() {})
|
bind(new TypeLiteral<DynamicMap<RestView<CommitResource>>>() {})
|
||||||
.toInstance(DynamicMap.<RestView<CommitResource>>emptyMap());
|
.toInstance(DynamicMap.emptyMap());
|
||||||
bind(String.class)
|
bind(String.class)
|
||||||
.annotatedWith(CanonicalWebUrl.class)
|
.annotatedWith(CanonicalWebUrl.class)
|
||||||
.toProvider(CanonicalWebUrlProvider.class);
|
.toProvider(CanonicalWebUrlProvider.class);
|
||||||
@ -126,9 +124,8 @@ public class BatchProgramModule extends FactoryModule {
|
|||||||
.toProvider(DisableReverseDnsLookupProvider.class)
|
.toProvider(DisableReverseDnsLookupProvider.class)
|
||||||
.in(SINGLETON);
|
.in(SINGLETON);
|
||||||
bind(Realm.class).to(FakeRealm.class);
|
bind(Realm.class).to(FakeRealm.class);
|
||||||
bind(IdentifiedUser.class).toProvider(Providers.<IdentifiedUser>of(null));
|
bind(IdentifiedUser.class).toProvider(Providers.of(null));
|
||||||
bind(ReplacePatchSetSender.Factory.class)
|
bind(ReplacePatchSetSender.Factory.class).toProvider(Providers.of(null));
|
||||||
.toProvider(Providers.<ReplacePatchSetSender.Factory>of(null));
|
|
||||||
bind(CurrentUser.class).to(IdentifiedUser.class);
|
bind(CurrentUser.class).to(IdentifiedUser.class);
|
||||||
factory(MergeUtil.Factory.class);
|
factory(MergeUtil.Factory.class);
|
||||||
factory(PatchSetInserter.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
|
// As Reindex is a batch program, don't assume the index is available for
|
||||||
// the change cache.
|
// the change cache.
|
||||||
bind(SearchingChangeCacheImpl.class).toProvider(Providers.<SearchingChangeCacheImpl>of(null));
|
bind(SearchingChangeCacheImpl.class).toProvider(Providers.of(null));
|
||||||
|
|
||||||
bind(new TypeLiteral<ImmutableSet<GroupReference>>() {})
|
bind(new TypeLiteral<ImmutableSet<GroupReference>>() {})
|
||||||
.annotatedWith(AdministrateServerGroups.class)
|
.annotatedWith(AdministrateServerGroups.class)
|
||||||
.toInstance(ImmutableSet.<GroupReference>of());
|
.toInstance(ImmutableSet.of());
|
||||||
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
|
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
|
||||||
.annotatedWith(GitUploadPackGroups.class)
|
.annotatedWith(GitUploadPackGroups.class)
|
||||||
.toInstance(Collections.<AccountGroup.UUID>emptySet());
|
.toInstance(Collections.emptySet());
|
||||||
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
|
bind(new TypeLiteral<Set<AccountGroup.UUID>>() {})
|
||||||
.annotatedWith(GitReceivePackGroups.class)
|
.annotatedWith(GitReceivePackGroups.class)
|
||||||
.toInstance(Collections.<AccountGroup.UUID>emptySet());
|
.toInstance(Collections.emptySet());
|
||||||
|
|
||||||
install(new BatchGitModule());
|
install(new BatchGitModule());
|
||||||
install(new DefaultPermissionBackendModule());
|
install(new DefaultPermissionBackendModule());
|
||||||
@ -174,8 +171,8 @@ public class BatchProgramModule extends FactoryModule {
|
|||||||
install(new DefaultSubmitRule.Module());
|
install(new DefaultSubmitRule.Module());
|
||||||
install(new IgnoreSelfApprovalRule.Module());
|
install(new IgnoreSelfApprovalRule.Module());
|
||||||
|
|
||||||
bind(ChangeJson.Factory.class).toProvider(Providers.<ChangeJson.Factory>of(null));
|
bind(ChangeJson.Factory.class).toProvider(Providers.of(null));
|
||||||
bind(EventUtil.class).toProvider(Providers.<EventUtil>of(null));
|
bind(EventUtil.class).toProvider(Providers.of(null));
|
||||||
bind(GitReferenceUpdated.class).toInstance(GitReferenceUpdated.DISABLED);
|
bind(GitReferenceUpdated.class).toInstance(GitReferenceUpdated.DISABLED);
|
||||||
bind(RevisionCreated.class).toInstance(RevisionCreated.DISABLED);
|
bind(RevisionCreated.class).toInstance(RevisionCreated.DISABLED);
|
||||||
bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
|
bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
|
||||||
|
@ -75,7 +75,7 @@ public class ApprovalCopier {
|
|||||||
Iterable<PatchSetApproval> getForPatchSet(
|
Iterable<PatchSetApproval> getForPatchSet(
|
||||||
ChangeNotes notes, PatchSet.Id psId, @Nullable RevWalk rw, @Nullable Config repoConfig)
|
ChangeNotes notes, PatchSet.Id psId, @Nullable RevWalk rw, @Nullable Config repoConfig)
|
||||||
throws OrmException {
|
throws OrmException {
|
||||||
return getForPatchSet(notes, psId, rw, repoConfig, Collections.<PatchSetApproval>emptyList());
|
return getForPatchSet(notes, psId, rw, repoConfig, Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterable<PatchSetApproval> getForPatchSet(
|
Iterable<PatchSetApproval> getForPatchSet(
|
||||||
|
@ -34,8 +34,7 @@ import java.sql.Timestamp;
|
|||||||
* state {@link ReviewerStateInternal#REMOVED} are ever exposed by this interface.
|
* state {@link ReviewerStateInternal#REMOVED} are ever exposed by this interface.
|
||||||
*/
|
*/
|
||||||
public class ReviewerSet {
|
public class ReviewerSet {
|
||||||
private static final ReviewerSet EMPTY =
|
private static final ReviewerSet EMPTY = new ReviewerSet(ImmutableTable.of());
|
||||||
new ReviewerSet(ImmutableTable.<ReviewerStateInternal, Account.Id, Timestamp>of());
|
|
||||||
|
|
||||||
public static ReviewerSet fromApprovals(Iterable<PatchSetApproval> approvals) {
|
public static ReviewerSet fromApprovals(Iterable<PatchSetApproval> approvals) {
|
||||||
PatchSetApproval first = null;
|
PatchSetApproval first = null;
|
||||||
|
@ -81,7 +81,7 @@ public class CapabilityCollection {
|
|||||||
}
|
}
|
||||||
configureDefaults(tmp, section);
|
configureDefaults(tmp, section);
|
||||||
if (!tmp.containsKey(GlobalCapability.ADMINISTRATE_SERVER) && !admins.isEmpty()) {
|
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();
|
ImmutableMap.Builder<String, ImmutableList<PermissionRule>> m = ImmutableMap.builder();
|
||||||
@ -123,7 +123,7 @@ public class CapabilityCollection {
|
|||||||
|
|
||||||
public ImmutableList<PermissionRule> getPermission(String permissionName) {
|
public ImmutableList<PermissionRule> getPermission(String permissionName) {
|
||||||
ImmutableList<PermissionRule> r = permissions.get(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) {
|
private void configureDefaults(Map<String, List<PermissionRule>> out, AccessSection section) {
|
||||||
|
@ -24,7 +24,7 @@ import java.util.Set;
|
|||||||
* <p>Different accounts systems (eg. LDAP, gerrit groups) provide concrete implementations.
|
* <p>Different accounts systems (eg. LDAP, gerrit groups) provide concrete implementations.
|
||||||
*/
|
*/
|
||||||
public interface GroupMembership {
|
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
|
* Returns {@code true} when the user this object was created for is a member of the specified
|
||||||
|
@ -402,7 +402,7 @@ class Helper {
|
|||||||
groupBase,
|
groupBase,
|
||||||
groupScope,
|
groupScope,
|
||||||
new ParameterizedString(groupMemberPattern),
|
new ParameterizedString(groupMemberPattern),
|
||||||
Collections.<String>emptySet());
|
Collections.emptySet());
|
||||||
if (groupMemberQuery.getParameters().isEmpty()) {
|
if (groupMemberQuery.getParameters().isEmpty()) {
|
||||||
throw new IllegalArgumentException("No variables in ldap.groupMemberPattern");
|
throw new IllegalArgumentException("No variables in ldap.groupMemberPattern");
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class CacheMetrics {
|
|||||||
F_NAME);
|
F_NAME);
|
||||||
|
|
||||||
Set<CallbackMetric<?>> cacheMetrics =
|
Set<CallbackMetric<?>> cacheMetrics =
|
||||||
ImmutableSet.<CallbackMetric<?>>of(memEnt, memHit, memEvict, perDiskEnt, perDiskHit);
|
ImmutableSet.of(memEnt, memHit, memEvict, perDiskEnt, perDiskHit);
|
||||||
|
|
||||||
metrics.newTrigger(
|
metrics.newTrigger(
|
||||||
cacheMetrics,
|
cacheMetrics,
|
||||||
|
@ -90,7 +90,7 @@ public class ReviewerJson {
|
|||||||
|
|
||||||
public List<ReviewerInfo> format(ReviewerResource rsrc)
|
public List<ReviewerInfo> format(ReviewerResource rsrc)
|
||||||
throws OrmException, PermissionBackendException {
|
throws OrmException, PermissionBackendException {
|
||||||
return format(ImmutableList.<ReviewerResource>of(rsrc));
|
return format(ImmutableList.of(rsrc));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReviewerInfo format(ReviewerInfo out, Account.Id reviewerAccountId, ChangeData cd)
|
public ReviewerInfo format(ReviewerInfo out, Account.Id reviewerAccountId, ChangeData cd)
|
||||||
|
@ -64,8 +64,7 @@ public class SearchingChangeCacheImpl implements GitReferenceUpdatedListener {
|
|||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
if (slave) {
|
if (slave) {
|
||||||
bind(SearchingChangeCacheImpl.class)
|
bind(SearchingChangeCacheImpl.class).toProvider(Providers.of(null));
|
||||||
.toProvider(Providers.<SearchingChangeCacheImpl>of(null));
|
|
||||||
} else {
|
} else {
|
||||||
cache(ID_CACHE, Project.NameKey.class, new TypeLiteral<List<CachedChange>>() {})
|
cache(ID_CACHE, Project.NameKey.class, new TypeLiteral<List<CachedChange>>() {})
|
||||||
.maximumWeight(0)
|
.maximumWeight(0)
|
||||||
|
@ -252,7 +252,7 @@ public class ReplaceOp implements BatchUpdateOp {
|
|||||||
}
|
}
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
PatchSet prevPs = psUtil.current(notes);
|
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());
|
ChangeData cd = changeDataFactory.create(ctx.getNotes());
|
||||||
|
@ -76,7 +76,7 @@ public class IndexModule extends LifecycleModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
|
public static final ImmutableCollection<SchemaDefinitions<?>> ALL_SCHEMA_DEFS =
|
||||||
ImmutableList.<SchemaDefinitions<?>>of(
|
ImmutableList.of(
|
||||||
AccountSchemaDefinitions.INSTANCE,
|
AccountSchemaDefinitions.INSTANCE,
|
||||||
ChangeSchemaDefinitions.INSTANCE,
|
ChangeSchemaDefinitions.INSTANCE,
|
||||||
GroupSchemaDefinitions.INSTANCE,
|
GroupSchemaDefinitions.INSTANCE,
|
||||||
@ -160,7 +160,7 @@ public class IndexModule extends LifecycleModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collection<IndexDefinition<?, ?, ?>> result =
|
Collection<IndexDefinition<?, ?, ?>> result =
|
||||||
ImmutableList.<IndexDefinition<?, ?, ?>>of(accounts, groups, changes, projects);
|
ImmutableList.of(accounts, groups, changes, projects);
|
||||||
Set<String> expected =
|
Set<String> expected =
|
||||||
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
|
FluentIterable.from(ALL_SCHEMA_DEFS).transform(SchemaDefinitions::getName).toSet();
|
||||||
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();
|
Set<String> actual = FluentIterable.from(result).transform(IndexDefinition::getName).toSet();
|
||||||
|
@ -121,6 +121,6 @@ public class AccountIndexerImpl implements AccountIndexer {
|
|||||||
return indexes.getWriteIndexes();
|
return indexes.getWriteIndexes();
|
||||||
}
|
}
|
||||||
|
|
||||||
return index != null ? Collections.singleton(index) : ImmutableSet.<AccountIndex>of();
|
return index != null ? Collections.singleton(index) : ImmutableSet.of();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ import java.util.Set;
|
|||||||
public class IndexedChangeQuery extends IndexedQuery<Change.Id, ChangeData>
|
public class IndexedChangeQuery extends IndexedQuery<Change.Id, ChangeData>
|
||||||
implements ChangeDataSource, Matchable<ChangeData> {
|
implements ChangeDataSource, Matchable<ChangeData> {
|
||||||
public static QueryOptions oneResult() {
|
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(
|
public static QueryOptions createOptions(
|
||||||
|
@ -459,7 +459,7 @@ class ChangeNotesParser {
|
|||||||
throws ConfigInvalidException {
|
throws ConfigInvalidException {
|
||||||
String line = parseOneFooter(commit, footerKey);
|
String line = parseOneFooter(commit, footerKey);
|
||||||
if (line == null) {
|
if (line == null) {
|
||||||
throw expectedOneFooter(footerKey, Collections.<String>emptyList());
|
throw expectedOneFooter(footerKey, Collections.emptyList());
|
||||||
}
|
}
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class NoteDbModule extends FactoryModule {
|
|||||||
} else {
|
} else {
|
||||||
bind(new TypeLiteral<Cache<ChangeNotesCache.Key, ChangeNotesState>>() {})
|
bind(new TypeLiteral<Cache<ChangeNotesCache.Key, ChangeNotesState>>() {})
|
||||||
.annotatedWith(Names.named(ChangeNotesCache.CACHE_NAME))
|
.annotatedWith(Names.named(ChangeNotesCache.CACHE_NAME))
|
||||||
.toInstance(CacheBuilder.newBuilder().<ChangeNotesCache.Key, ChangeNotesState>build());
|
.toInstance(CacheBuilder.newBuilder().build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ class RevisionNoteMap<T extends RevisionNote<? extends Comment>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static <T extends RevisionNote<? extends Comment>> RevisionNoteMap<T> emptyMap() {
|
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) {
|
private RevisionNoteMap(NoteMap noteMap, ImmutableMap<RevId, T> revisionNotes) {
|
||||||
|
@ -114,7 +114,7 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
|
|||||||
for (Class<? extends Annotation> annotoation : annotations) {
|
for (Class<? extends Annotation> annotoation : annotations) {
|
||||||
String descr = classObjToClassDescr.get(annotoation);
|
String descr = classObjToClassDescr.get(annotoation);
|
||||||
Collection<ClassData> discoverdData = rawMap.get(descr);
|
Collection<ClassData> discoverdData = rawMap.get(descr);
|
||||||
Collection<ClassData> values = firstNonNull(discoverdData, Collections.<ClassData>emptySet());
|
Collection<ClassData> values = firstNonNull(discoverdData, Collections.emptySet());
|
||||||
|
|
||||||
result.put(
|
result.put(
|
||||||
annotoation,
|
annotoation,
|
||||||
@ -144,7 +144,7 @@ public class JarScanner implements PluginContentScanner, AutoCloseable {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassData def = new ClassData(Collections.<String>emptySet());
|
ClassData def = new ClassData(Collections.emptySet());
|
||||||
try {
|
try {
|
||||||
new ClassReader(read(jarFile, entry)).accept(def, SKIP_ALL);
|
new ClassReader(read(jarFile, entry)).accept(def, SKIP_ALL);
|
||||||
} catch (RuntimeException err) {
|
} catch (RuntimeException err) {
|
||||||
|
@ -95,7 +95,7 @@ public class IsWatchedByPredicate extends AndPredicate<ChangeData> {
|
|||||||
if (user.isIdentifiedUser()) {
|
if (user.isIdentifiedUser()) {
|
||||||
return user.asIdentifiedUser().state().getProjectWatches().keySet();
|
return user.asIdentifiedUser().state().getProjectWatches().keySet();
|
||||||
}
|
}
|
||||||
return Collections.<ProjectWatchKey>emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static List<Predicate<ChangeData>> none() {
|
protected static List<Predicate<ChangeData>> none() {
|
||||||
|
@ -109,7 +109,7 @@ public class AddSshKey
|
|||||||
}
|
}
|
||||||
|
|
||||||
user.getUserName().ifPresent(sshKeyCache::evict);
|
user.getUserName().ifPresent(sshKeyCache::evict);
|
||||||
return Response.<SshKeyInfo>created(GetSshKeys.newSshKeyInfo(sshKey));
|
return Response.created(GetSshKeys.newSshKeyInfo(sshKey));
|
||||||
} catch (InvalidSshKeyException e) {
|
} catch (InvalidSshKeyException e) {
|
||||||
throw new BadRequestException(e.getMessage());
|
throw new BadRequestException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class PutHttpPassword implements RestModifyView<AccountResource, HttpPass
|
|||||||
ExternalId.createWithPassword(
|
ExternalId.createWithPassword(
|
||||||
extId.key(), extId.accountId(), extId.email(), newPassword)));
|
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)
|
@UsedAt(UsedAt.Project.PLUGIN_SERVICEUSER)
|
||||||
|
@ -76,7 +76,7 @@ public class GetMergeList implements RestReadView<RevisionResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (commit.getParentCount() < 2) {
|
if (commit.getParentCount() < 2) {
|
||||||
return createResponse(rsrc, ImmutableList.<CommitInfo>of());
|
return createResponse(rsrc, ImmutableList.of());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RevCommit> commits = MergeListBuilder.build(rw, commit, uninterestingParent);
|
List<RevCommit> commits = MergeListBuilder.build(rw, commit, uninterestingParent);
|
||||||
|
@ -55,7 +55,7 @@ public class PostHashtags
|
|||||||
SetHashtagsOp op = hashtagsFactory.create(input);
|
SetHashtagsOp op = hashtagsFactory.create(input);
|
||||||
bu.addOp(req.getId(), op);
|
bu.addOp(req.getId(), op);
|
||||||
bu.execute();
|
bu.execute();
|
||||||
return Response.<ImmutableSortedSet<String>>ok(op.getUpdatedHashtags());
|
return Response.ok(op.getUpdatedHashtags());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ public class CreateGroup
|
|||||||
args.initialMembers =
|
args.initialMembers =
|
||||||
ownerUuid == null
|
ownerUuid == null
|
||||||
? Collections.singleton(self.get().getAccountId())
|
? Collections.singleton(self.get().getAccountId())
|
||||||
: Collections.<Account.Id>emptySet();
|
: Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -72,7 +72,7 @@ public class PutDescription implements RestModifyView<GroupResource, Description
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Strings.isNullOrEmpty(input.description)
|
return Strings.isNullOrEmpty(input.description)
|
||||||
? Response.<String>none()
|
? Response.none()
|
||||||
: Response.ok(input.description);
|
: Response.ok(input.description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public class PutDescription implements RestModifyView<ProjectResource, Descripti
|
|||||||
md.getRepository().setGitwebDescription(project.getDescription());
|
md.getRepository().setGitwebDescription(project.getDescription());
|
||||||
|
|
||||||
return Strings.isNullOrEmpty(project.getDescription())
|
return Strings.isNullOrEmpty(project.getDescription())
|
||||||
? Response.<String>none()
|
? Response.none()
|
||||||
: Response.ok(project.getDescription());
|
: Response.ok(project.getDescription());
|
||||||
} catch (RepositoryNotFoundException notFound) {
|
} catch (RepositoryNotFoundException notFound) {
|
||||||
throw new ResourceNotFoundException(resource.getName());
|
throw new ResourceNotFoundException(resource.getName());
|
||||||
|
@ -61,14 +61,12 @@ public class ChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ChangeSet(Iterable<ChangeData> changes, Iterable<ChangeData> hiddenChanges) {
|
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());
|
nonVisibleChanges = index(hiddenChanges, changeData.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChangeSet(ChangeData change, boolean visible) {
|
public ChangeSet(ChangeData change, boolean visible) {
|
||||||
this(
|
this(visible ? ImmutableList.of(change) : ImmutableList.of(), ImmutableList.of(change));
|
||||||
visible ? ImmutableList.of(change) : ImmutableList.<ChangeData>of(),
|
|
||||||
ImmutableList.of(change));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmutableSet<Change.Id> ids() {
|
public ImmutableSet<Change.Id> ids() {
|
||||||
|
@ -164,7 +164,7 @@ public class CherryPick extends SubmitStrategy {
|
|||||||
ctx.getUpdate(psId),
|
ctx.getUpdate(psId),
|
||||||
psId,
|
psId,
|
||||||
newCommit,
|
newCommit,
|
||||||
prevPs != null ? prevPs.getGroups() : ImmutableList.<String>of(),
|
prevPs != null ? prevPs.getGroups() : ImmutableList.of(),
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
ctx.getChange().setCurrentPatchSet(patchSetInfo);
|
ctx.getChange().setCurrentPatchSet(patchSetInfo);
|
||||||
|
@ -233,7 +233,7 @@ public class RebaseSubmitStrategy extends SubmitStrategy {
|
|||||||
ctx.getUpdate(newPatchSetId),
|
ctx.getUpdate(newPatchSetId),
|
||||||
newPatchSetId,
|
newPatchSetId,
|
||||||
newCommit,
|
newCommit,
|
||||||
prevPs != null ? prevPs.getGroups() : ImmutableList.<String>of(),
|
prevPs != null ? prevPs.getGroups() : ImmutableList.of(),
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class SubmitStrategyListener implements BatchUpdateListener {
|
|||||||
args.rw,
|
args.rw,
|
||||||
args.canMergeFlag,
|
args.canMergeFlag,
|
||||||
args.mergeTip.getCurrentTip(),
|
args.mergeTip.getCurrentTip(),
|
||||||
initialTip == null ? ImmutableSet.<RevCommit>of() : ImmutableSet.of(initialTip));
|
initialTip == null ? ImmutableSet.of() : ImmutableSet.of(initialTip));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
import org.apache.mina.transport.socket.SocketSessionConfig;
|
import org.apache.mina.transport.socket.SocketSessionConfig;
|
||||||
import org.apache.sshd.common.BaseBuilder;
|
import org.apache.sshd.common.BaseBuilder;
|
||||||
import org.apache.sshd.common.NamedFactory;
|
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.cipher.Cipher;
|
||||||
import org.apache.sshd.common.compression.BuiltinCompressions;
|
import org.apache.sshd.common.compression.BuiltinCompressions;
|
||||||
import org.apache.sshd.common.compression.Compression;
|
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.mac.Mac;
|
||||||
import org.apache.sshd.common.random.Random;
|
import org.apache.sshd.common.random.Random;
|
||||||
import org.apache.sshd.common.random.SingletonRandomFactory;
|
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.session.Session;
|
||||||
import org.apache.sshd.common.util.buffer.Buffer;
|
import org.apache.sshd.common.util.buffer.Buffer;
|
||||||
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
|
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.gss.UserAuthGSSFactory;
|
||||||
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
|
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
|
||||||
import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory;
|
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.command.CommandFactory;
|
||||||
import org.apache.sshd.server.forward.ForwardingFilter;
|
import org.apache.sshd.server.forward.ForwardingFilter;
|
||||||
import org.apache.sshd.server.global.CancelTcpipForwardHandler;
|
import org.apache.sshd.server.global.CancelTcpipForwardHandler;
|
||||||
@ -293,7 +290,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
setGlobalRequestHandlers(
|
setGlobalRequestHandlers(
|
||||||
Arrays.<RequestHandler<ConnectionService>>asList(
|
Arrays.asList(
|
||||||
new KeepAliveHandler(),
|
new KeepAliveHandler(),
|
||||||
new NoMoreSessionsHandler(),
|
new NoMoreSessionsHandler(),
|
||||||
new TcpipForwardHandler(),
|
new TcpipForwardHandler(),
|
||||||
@ -654,7 +651,7 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initSubsystems() {
|
private void initSubsystems() {
|
||||||
setSubsystemFactories(Collections.<NamedFactory<Command>>emptyList());
|
setSubsystemFactories(Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initUserAuth(
|
private void initUserAuth(
|
||||||
|
@ -238,7 +238,7 @@ public class UploadArchive extends AbstractGitCommand {
|
|||||||
options.level9)
|
options.level9)
|
||||||
.indexOf(true);
|
.indexOf(true);
|
||||||
if (value >= 0) {
|
if (value >= 0) {
|
||||||
return ImmutableMap.<String, Object>of("level", Integer.valueOf(value));
|
return ImmutableMap.of("level", Integer.valueOf(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
|
@ -95,7 +95,7 @@ public class TestChanges {
|
|||||||
.load(),
|
.load(),
|
||||||
user,
|
user,
|
||||||
TimeUtil.nowTs(),
|
TimeUtil.nowTs(),
|
||||||
Ordering.<String>natural());
|
Ordering.natural());
|
||||||
|
|
||||||
ChangeNotes notes = update.getNotes();
|
ChangeNotes notes = update.getNotes();
|
||||||
boolean hasPatchSets = notes.getPatchSets() != null && !notes.getPatchSets().isEmpty();
|
boolean hasPatchSets = notes.getPatchSets() != null && !notes.getPatchSets().isEmpty();
|
||||||
|
@ -1931,7 +1931,7 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
addExternalIdEmail(admin, PushCertificateIdent.parse(key.getFirstUserId()).getEmailAddress());
|
addExternalIdEmail(admin, PushCertificateIdent.parse(key.getFirstUserId()).getEmailAddress());
|
||||||
toAdd.add(key.getPublicKeyArmored());
|
toAdd.add(key.getPublicKeyArmored());
|
||||||
}
|
}
|
||||||
gApi.accounts().self().putGpgKeys(toAdd, ImmutableList.<String>of());
|
gApi.accounts().self().putGpgKeys(toAdd, ImmutableList.of());
|
||||||
assertKeys(keys);
|
assertKeys(keys);
|
||||||
accountIndexedCounter.assertReindexOf(admin);
|
accountIndexedCounter.assertReindexOf(admin);
|
||||||
}
|
}
|
||||||
@ -2869,13 +2869,13 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
private Map<String, GpgKeyInfo> addGpgKey(String armored) throws Exception {
|
private Map<String, GpgKeyInfo> addGpgKey(String armored) throws Exception {
|
||||||
Map<String, GpgKeyInfo> gpgKeys =
|
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());
|
accountIndexedCounter.assertReindexOf(gApi.accounts().self().get());
|
||||||
return gpgKeys;
|
return gpgKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, GpgKeyInfo> addGpgKeyNoReindex(String armored) throws Exception {
|
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 {
|
private void assertUser(AccountInfo info, TestAccount account) throws Exception {
|
||||||
|
@ -366,8 +366,7 @@ public class SubmitResolvingMergeCommitIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PushOneCommit.Result createChange(String subject) throws Exception {
|
protected PushOneCommit.Result createChange(String subject) throws Exception {
|
||||||
return createChange(
|
return createChange(testRepo, subject, "", "", Collections.emptyList(), "refs/for/master");
|
||||||
testRepo, subject, "", "", Collections.<RevCommit>emptyList(), "refs/for/master");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PushOneCommit.Result createChange(String subject, List<RevCommit> parents)
|
private PushOneCommit.Result createChange(String subject, List<RevCommit> parents)
|
||||||
|
@ -154,6 +154,6 @@ public class DeleteTagsIT extends AbstractDaemonTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void assertTagsDeleted() throws Exception {
|
private void assertTagsDeleted() throws Exception {
|
||||||
assertTags(ImmutableList.<String>of());
|
assertTags(ImmutableList.of());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -608,7 +608,7 @@ public class GetRelatedIT extends AbstractDaemonTest {
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateChange(ChangeContext ctx) throws OrmException {
|
public boolean updateChange(ChangeContext ctx) throws OrmException {
|
||||||
PatchSet ps = psUtil.get(ctx.getNotes(), psId);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -58,7 +58,7 @@ public class FieldPredicateTest extends PredicateTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCopy() {
|
public void testCopy() {
|
||||||
final OperatorPredicate<String> f = f("author", "alice");
|
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()));
|
assertSame(f, f.copy(f.getChildren()));
|
||||||
|
|
||||||
exception.expect(IllegalArgumentException.class);
|
exception.expect(IllegalArgumentException.class);
|
||||||
|
@ -113,7 +113,7 @@ public class NotPredicateTest extends PredicateTest {
|
|||||||
assertEquals(sb, n.copy(sb).getChildren());
|
assertEquals(sb, n.copy(sb).getChildren());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
n.copy(Collections.<Predicate>emptyList());
|
n.copy(Collections.emptyList());
|
||||||
fail("Expected IllegalArgumentException");
|
fail("Expected IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
assertEquals("Expected exactly one child", e.getMessage());
|
assertEquals("Expected exactly one child", e.getMessage());
|
||||||
|
@ -44,7 +44,7 @@ public class LibrariesTest extends GerritBaseTests {
|
|||||||
return new LibraryDownloader(ui, site, remover);
|
return new LibraryDownloader(ui, site, remover);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Collections.<String>emptyList(),
|
Collections.emptyList(),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
assertNotNull(lib.mysqlDriver);
|
assertNotNull(lib.mysqlDriver);
|
||||||
|
@ -208,6 +208,6 @@ public class LabelNormalizerTest extends GerritBaseTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static List<PatchSetApproval> list(PatchSetApproval... psas) {
|
private static List<PatchSetApproval> list(PatchSetApproval... psas) {
|
||||||
return ImmutableList.<PatchSetApproval>copyOf(psas);
|
return ImmutableList.copyOf(psas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static QueryOptions options(int start, int limit) {
|
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 {
|
private Set<Change.Status> status(String query) throws QueryParseException {
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
package com.google.gerrit.server.index.change;
|
package com.google.gerrit.server.index.change;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.gerrit.index.FieldDef;
|
|
||||||
import com.google.gerrit.index.QueryOptions;
|
import com.google.gerrit.index.QueryOptions;
|
||||||
import com.google.gerrit.index.Schema;
|
import com.google.gerrit.index.Schema;
|
||||||
import com.google.gerrit.index.query.FieldBundle;
|
import com.google.gerrit.index.query.FieldBundle;
|
||||||
@ -30,8 +29,7 @@ import org.junit.Ignore;
|
|||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
public class FakeChangeIndex implements ChangeIndex {
|
public class FakeChangeIndex implements ChangeIndex {
|
||||||
static final Schema<ChangeData> V1 =
|
static final Schema<ChangeData> V1 = new Schema<>(1, ImmutableList.of(ChangeField.STATUS));
|
||||||
new Schema<>(1, ImmutableList.<FieldDef<ChangeData, ?>>of(ChangeField.STATUS));
|
|
||||||
|
|
||||||
static final Schema<ChangeData> V2 =
|
static final Schema<ChangeData> V2 =
|
||||||
new Schema<>(2, ImmutableList.of(ChangeField.STATUS, ChangeField.PATH, ChangeField.UPDATED));
|
new Schema<>(2, ImmutableList.of(ChangeField.STATUS, ChangeField.PATH, ChangeField.UPDATED));
|
||||||
|
@ -138,7 +138,7 @@ public abstract class AbstractChangeNotesTest extends GerritBaseTests {
|
|||||||
bind(AllUsersName.class).toProvider(AllUsersNameProvider.class);
|
bind(AllUsersName.class).toProvider(AllUsersNameProvider.class);
|
||||||
bind(String.class).annotatedWith(GerritServerId.class).toInstance("gerrit");
|
bind(String.class).annotatedWith(GerritServerId.class).toInstance("gerrit");
|
||||||
bind(GitRepositoryManager.class).toInstance(repoManager);
|
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(Config.class).annotatedWith(GerritServerConfig.class).toInstance(testConfig);
|
||||||
bind(String.class)
|
bind(String.class)
|
||||||
.annotatedWith(AnonymousCowardName.class)
|
.annotatedWith(AnonymousCowardName.class)
|
||||||
|
@ -973,8 +973,8 @@ public class RefControlTest extends GerritBaseTests {
|
|||||||
private ProjectControl user(
|
private ProjectControl user(
|
||||||
ProjectConfig local, @Nullable String name, AccountGroup.UUID... memberOf) {
|
ProjectConfig local, @Nullable String name, AccountGroup.UUID... memberOf) {
|
||||||
return new ProjectControl(
|
return new ProjectControl(
|
||||||
Collections.<AccountGroup.UUID>emptySet(),
|
Collections.emptySet(),
|
||||||
Collections.<AccountGroup.UUID>emptySet(),
|
Collections.emptySet(),
|
||||||
sectionSorter,
|
sectionSorter,
|
||||||
changeControlFactory,
|
changeControlFactory,
|
||||||
permissionBackend,
|
permissionBackend,
|
||||||
|
@ -1409,9 +1409,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
ReviewInput.CommentInput commentInput = new ReviewInput.CommentInput();
|
ReviewInput.CommentInput commentInput = new ReviewInput.CommentInput();
|
||||||
commentInput.line = 1;
|
commentInput.line = 1;
|
||||||
commentInput.message = "inline";
|
commentInput.message = "inline";
|
||||||
input.comments =
|
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(commentInput));
|
||||||
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
|
|
||||||
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(commentInput));
|
|
||||||
gApi.changes().id(change.getId().get()).current().review(input);
|
gApi.changes().id(change.getId().get()).current().review(input);
|
||||||
|
|
||||||
Map<String, List<CommentInfo>> comments =
|
Map<String, List<CommentInfo>> comments =
|
||||||
@ -1600,7 +1598,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
Change change4 = insert(repo, ins4);
|
Change change4 = insert(repo, ins4);
|
||||||
ReviewInput ri4 = new ReviewInput();
|
ReviewInput ri4 = new ReviewInput();
|
||||||
ri4.message = "toplevel";
|
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);
|
gApi.changes().id(change4.getId().get()).current().review(ri4);
|
||||||
|
|
||||||
ChangeInserter ins5 = newChangeWithTopic(repo, "feature5");
|
ChangeInserter ins5 = newChangeWithTopic(repo, "feature5");
|
||||||
@ -1672,9 +1670,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
|
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
|
||||||
comment.line = 1;
|
comment.line = 1;
|
||||||
comment.message = "inline";
|
comment.message = "inline";
|
||||||
input.comments =
|
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
|
||||||
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
|
|
||||||
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
|
|
||||||
gApi.changes().id(change1.getId().get()).current().review(input);
|
gApi.changes().id(change1.getId().get()).current().review(input);
|
||||||
|
|
||||||
input = new ReviewInput();
|
input = new ReviewInput();
|
||||||
@ -1839,9 +1835,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
|
ReviewInput.CommentInput comment = new ReviewInput.CommentInput();
|
||||||
comment.line = 1;
|
comment.line = 1;
|
||||||
comment.message = "inline";
|
comment.message = "inline";
|
||||||
input.comments =
|
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
|
||||||
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
|
|
||||||
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
|
|
||||||
gApi.changes().id(change2.getId().get()).current().review(input);
|
gApi.changes().id(change2.getId().get()).current().review(input);
|
||||||
|
|
||||||
assertQuery("from:" + userId.get(), change2, change1);
|
assertQuery("from:" + userId.get(), change2, change1);
|
||||||
@ -3103,9 +3097,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
comment.line = 1;
|
comment.line = 1;
|
||||||
comment.message = message;
|
comment.message = message;
|
||||||
comment.unresolved = unresolved;
|
comment.unresolved = unresolved;
|
||||||
input.comments =
|
input.comments = ImmutableMap.of(Patch.COMMIT_MSG, ImmutableList.of(comment));
|
||||||
ImmutableMap.<String, List<ReviewInput.CommentInput>>of(
|
|
||||||
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.CommentInput>of(comment));
|
|
||||||
gApi.changes().id(changeId).current().review(input);
|
gApi.changes().id(changeId).current().review(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user