Use @Nullable consistently in indexer implementations

Reorder the args in GroupIndexerImpl a bit so that it's the same order
as in AccountIndexerImpl and ProjectIndexerImpl.

Change-Id: Ic7734bbf26030496dee83cbb341bc34f3e2c34ef
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-11-22 09:46:58 +01:00
parent 986fb0be35
commit f65f96baec
4 changed files with 19 additions and 18 deletions

View File

@@ -50,8 +50,8 @@ public class AccountIndexerImpl implements AccountIndexer {
private final StalenessChecker stalenessChecker; private final StalenessChecker stalenessChecker;
private final ListeningExecutorService batchExecutor; private final ListeningExecutorService batchExecutor;
private final boolean autoReindexIfStale; private final boolean autoReindexIfStale;
private final AccountIndexCollection indexes; @Nullable private final AccountIndexCollection indexes;
private final AccountIndex index; @Nullable private final AccountIndex index;
@AssistedInject @AssistedInject
AccountIndexerImpl( AccountIndexerImpl(
@@ -77,7 +77,7 @@ public class AccountIndexerImpl implements AccountIndexer {
StalenessChecker stalenessChecker, StalenessChecker stalenessChecker,
@IndexExecutor(BATCH) ListeningExecutorService batchExecutor, @IndexExecutor(BATCH) ListeningExecutorService batchExecutor,
@GerritServerConfig Config config, @GerritServerConfig Config config,
@Assisted AccountIndex index) { @Assisted @Nullable AccountIndex index) {
this.byIdCache = byIdCache; this.byIdCache = byIdCache;
this.indexedListener = indexedListener; this.indexedListener = indexedListener;
this.stalenessChecker = stalenessChecker; this.stalenessChecker = stalenessChecker;

View File

@@ -21,6 +21,7 @@ import com.google.common.util.concurrent.Atomics;
import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.extensions.events.ChangeIndexedListener; import com.google.gerrit.extensions.events.ChangeIndexedListener;
import com.google.gerrit.extensions.registration.DynamicSet; import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.index.Index; import com.google.gerrit.index.Index;
@@ -81,8 +82,8 @@ public class ChangeIndexer {
return Futures.makeChecked(Futures.allAsList(futures), IndexUtils.MAPPER); return Futures.makeChecked(Futures.allAsList(futures), IndexUtils.MAPPER);
} }
private final ChangeIndexCollection indexes; @Nullable private final ChangeIndexCollection indexes;
private final ChangeIndex index; @Nullable private final ChangeIndex index;
private final SchemaFactory<ReviewDb> schemaFactory; private final SchemaFactory<ReviewDb> schemaFactory;
private final NotesMigration notesMigration; private final NotesMigration notesMigration;
private final ChangeNotes.Factory changeNotesFactory; private final ChangeNotes.Factory changeNotesFactory;

View File

@@ -48,26 +48,26 @@ public class GroupIndexerImpl implements GroupIndexer {
private final GroupCache groupCache; private final GroupCache groupCache;
private final DynamicSet<GroupIndexedListener> indexedListener; private final DynamicSet<GroupIndexedListener> indexedListener;
private final GroupIndexCollection indexes;
private final StalenessChecker stalenessChecker; private final StalenessChecker stalenessChecker;
private final boolean autoReindexIfStale;
private final GroupIndex index;
private final ListeningExecutorService batchExecutor; private final ListeningExecutorService batchExecutor;
private final boolean autoReindexIfStale;
@Nullable private final GroupIndexCollection indexes;
@Nullable private final GroupIndex index;
@AssistedInject @AssistedInject
GroupIndexerImpl( GroupIndexerImpl(
GroupCache groupCache, GroupCache groupCache,
DynamicSet<GroupIndexedListener> indexedListener, DynamicSet<GroupIndexedListener> indexedListener,
StalenessChecker stalenessChecker, StalenessChecker stalenessChecker,
@GerritServerConfig Config config,
@IndexExecutor(BATCH) ListeningExecutorService batchExecutor, @IndexExecutor(BATCH) ListeningExecutorService batchExecutor,
@GerritServerConfig Config config,
@Assisted GroupIndexCollection indexes) { @Assisted GroupIndexCollection indexes) {
this.groupCache = groupCache; this.groupCache = groupCache;
this.indexedListener = indexedListener; this.indexedListener = indexedListener;
this.indexes = indexes;
this.stalenessChecker = stalenessChecker; this.stalenessChecker = stalenessChecker;
this.autoReindexIfStale = autoReindexIfStale(config);
this.batchExecutor = batchExecutor; this.batchExecutor = batchExecutor;
this.autoReindexIfStale = autoReindexIfStale(config);
this.indexes = indexes;
this.index = null; this.index = null;
} }
@@ -76,15 +76,15 @@ public class GroupIndexerImpl implements GroupIndexer {
GroupCache groupCache, GroupCache groupCache,
DynamicSet<GroupIndexedListener> indexedListener, DynamicSet<GroupIndexedListener> indexedListener,
StalenessChecker stalenessChecker, StalenessChecker stalenessChecker,
@GerritServerConfig Config config,
@IndexExecutor(BATCH) ListeningExecutorService batchExecutor, @IndexExecutor(BATCH) ListeningExecutorService batchExecutor,
@Assisted GroupIndex index) { @GerritServerConfig Config config,
@Assisted @Nullable GroupIndex index) {
this.groupCache = groupCache; this.groupCache = groupCache;
this.indexedListener = indexedListener; this.indexedListener = indexedListener;
this.indexes = null;
this.stalenessChecker = stalenessChecker; this.stalenessChecker = stalenessChecker;
this.autoReindexIfStale = autoReindexIfStale(config);
this.batchExecutor = batchExecutor; this.batchExecutor = batchExecutor;
this.autoReindexIfStale = autoReindexIfStale(config);
this.indexes = null;
this.index = index; this.index = index;
} }

View File

@@ -37,8 +37,8 @@ public class ProjectIndexerImpl implements ProjectIndexer {
private final ProjectCache projectCache; private final ProjectCache projectCache;
private final DynamicSet<ProjectIndexedListener> indexedListener; private final DynamicSet<ProjectIndexedListener> indexedListener;
private final ProjectIndexCollection indexes; @Nullable private final ProjectIndexCollection indexes;
private final ProjectIndex index; @Nullable private final ProjectIndex index;
@AssistedInject @AssistedInject
ProjectIndexerImpl( ProjectIndexerImpl(
@@ -55,7 +55,7 @@ public class ProjectIndexerImpl implements ProjectIndexer {
ProjectIndexerImpl( ProjectIndexerImpl(
ProjectCache projectCache, ProjectCache projectCache,
DynamicSet<ProjectIndexedListener> indexedListener, DynamicSet<ProjectIndexedListener> indexedListener,
@Assisted ProjectIndex index) { @Assisted @Nullable ProjectIndex index) {
this.projectCache = projectCache; this.projectCache = projectCache;
this.indexedListener = indexedListener; this.indexedListener = indexedListener;
this.indexes = null; this.indexes = null;