Remove @Inject from IndexCollection constructor
Ever since da0459d20c (Extract interfaces
for Index and IndexCollection, 2016-03-15), this is an abstract class so
annotating its constructor has no effect.
Annotate the constructors of its concrete subclasses instead.
Change-Id: I7eecdd794f26ebd34041f829617a25536161dc86
This commit is contained in:
@@ -14,10 +14,8 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.index;
|
package com.google.gerrit.server.index;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.gerrit.extensions.events.LifecycleListener;
|
import com.google.gerrit.extensions.events.LifecycleListener;
|
||||||
import com.google.inject.Inject;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -30,9 +28,7 @@ public abstract class IndexCollection<K, V, I extends Index<K, V>>
|
|||||||
private final CopyOnWriteArrayList<I> writeIndexes;
|
private final CopyOnWriteArrayList<I> writeIndexes;
|
||||||
private final AtomicReference<I> searchIndex;
|
private final AtomicReference<I> searchIndex;
|
||||||
|
|
||||||
@Inject
|
protected IndexCollection() {
|
||||||
@VisibleForTesting
|
|
||||||
public IndexCollection() {
|
|
||||||
this.writeIndexes = Lists.newCopyOnWriteArrayList();
|
this.writeIndexes = Lists.newCopyOnWriteArrayList();
|
||||||
this.searchIndex = new AtomicReference<>();
|
this.searchIndex = new AtomicReference<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,18 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.index.account;
|
package com.google.gerrit.server.index.account;
|
||||||
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.gerrit.reviewdb.client.Account;
|
import com.google.gerrit.reviewdb.client.Account;
|
||||||
import com.google.gerrit.server.account.AccountState;
|
import com.google.gerrit.server.account.AccountState;
|
||||||
import com.google.gerrit.server.index.IndexCollection;
|
import com.google.gerrit.server.index.IndexCollection;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class AccountIndexCollection extends
|
public class AccountIndexCollection extends
|
||||||
IndexCollection<Account.Id, AccountState, AccountIndex> {
|
IndexCollection<Account.Id, AccountState, AccountIndex> {
|
||||||
|
@Inject
|
||||||
|
@VisibleForTesting
|
||||||
|
public AccountIndexCollection() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,18 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.index.change;
|
package com.google.gerrit.server.index.change;
|
||||||
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.gerrit.reviewdb.client.Change;
|
import com.google.gerrit.reviewdb.client.Change;
|
||||||
import com.google.gerrit.server.index.IndexCollection;
|
import com.google.gerrit.server.index.IndexCollection;
|
||||||
import com.google.gerrit.server.query.change.ChangeData;
|
import com.google.gerrit.server.query.change.ChangeData;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ChangeIndexCollection extends
|
public class ChangeIndexCollection extends
|
||||||
IndexCollection<Change.Id, ChangeData, ChangeIndex> {
|
IndexCollection<Change.Id, ChangeData, ChangeIndex> {
|
||||||
|
@Inject
|
||||||
|
@VisibleForTesting
|
||||||
|
public ChangeIndexCollection() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user