Bind ProjectDeletionAction and CacheDeleteHandler explicitly
The ProjectDelectionAction and its CacheDeleteHandler classes were
implicitly bound at their first outer-level container class
in a non-controlled injector.
In same cases, e.g. when the pull-replication plugin was loaded
before the delete-project and was accessible at top-level class
loader, Guice was generating a just-in-time binding in the parent
class loader that would have then conflicted with the explicit
binding performed in the delete-project plugin.
See below an example of the resulting exception:
1) [Guice/JitBindingAlreadySet]: A just-in-time binding to CacheDeleteHandler was already configured on a parent injector.
at PluginModule.configure(PluginModule.java:49)
1 error
CacheDeleteHandler: "com.googlesource.gerrit.plugins.deleteproject.cache.CacheDeleteHandler"
PluginModule: "com.googlesource.gerrit.plugins.deleteproject.PluginModule"
Binding the classes explicitly to the injector that is loading
the plugin, prevents Guice from creating just-in-time binding at
unexpected hierarchy levels.
Change-Id: I11192677a3af752719df3b37c84856a976290d7c
2 files changed