Fix IndexCollection propagation into plugin guice injectors

This fixes a regression caused by: I3c4616d08e. As the consequence
index collection instances were not correctly propagated into plugin's
Guice injectors. A test is added in singleusergroup plugin to avoid such
breakages in future.

Bug: Issue 8398
Change-Id: I87e29a798a83b03f9daa2cfe4708d89becae201e
This commit is contained in:
Paladox 2018-02-19 14:29:24 +00:00 committed by David Ostrovsky
parent 6582ae4d4a
commit cd127535f7
2 changed files with 3 additions and 2 deletions

View File

@ -34,6 +34,7 @@ import com.google.gerrit.extensions.registration.RegistrationHandle;
import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
import com.google.gerrit.extensions.systemstatus.ServerInformation;
import com.google.gerrit.extensions.webui.WebUiPlugin;
import com.google.gerrit.index.IndexCollection;
import com.google.gerrit.metrics.MetricMaker;
import com.google.gerrit.server.util.PluginRequestContext;
import com.google.gerrit.server.util.RequestContext;
@ -568,7 +569,7 @@ public class PluginGuiceEnvironment {
Class<?> type = key.getTypeLiteral().getRawType();
if (LifecycleListener.class.isAssignableFrom(type)
// This is needed for secondary index to work from plugin listeners
&& !is("com.google.gerrit.server.index.IndexCollection", type)) {
&& !IndexCollection.class.isAssignableFrom(type)) {
return false;
}
if (StartPluginListener.class.isAssignableFrom(type)) {

@ -1 +1 @@
Subproject commit 73cfc73077d249a5d92ae3d31f1949b816bd98c3
Subproject commit 94e9edbba44b5e8c42e7764af924d3ea20835bf2