Fix compilaion error
I0adf995e1 broke compilation. Change-Id: I0103c4e348733fc9f07ebe4fb0d749e2136d9a6a
This commit is contained in:
@@ -65,8 +65,12 @@ class AutoRegisterModules {
|
||||
this.env = env;
|
||||
this.scanner = scanner;
|
||||
this.classLoader = classLoader;
|
||||
this.sshGen = env.hasSshModule() ? env.newSshModuleGenerator() : ModuleGenerator.NOP;
|
||||
this.httpGen = env.hasHttpModule() ? env.newHttpModuleGenerator() : ModuleGenerator.NOP;
|
||||
this.sshGen = env.hasSshModule()
|
||||
? env.newSshModuleGenerator()
|
||||
: new ModuleGenerator.NOP();
|
||||
this.httpGen = env.hasHttpModule()
|
||||
? env.newHttpModuleGenerator()
|
||||
: new HttpModuleGenerator.NOP();
|
||||
}
|
||||
|
||||
AutoRegisterModules discover() throws InvalidPluginException {
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
|
||||
package com.google.gerrit.server.plugins;
|
||||
|
||||
|
||||
public interface HttpModuleGenerator extends ModuleGenerator {
|
||||
void export(String javascript);
|
||||
|
||||
static class NOP extends ModuleGenerator.NOP
|
||||
implements HttpModuleGenerator {
|
||||
@Override
|
||||
public void export(String javascript) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface ModuleGenerator {
|
||||
|
||||
Module create() throws InvalidPluginException;
|
||||
|
||||
public static final ModuleGenerator NOP = new ModuleGenerator() {
|
||||
static class NOP implements ModuleGenerator {
|
||||
|
||||
@Override
|
||||
public void setPluginName(String name) {
|
||||
@@ -48,5 +48,5 @@ public interface ModuleGenerator {
|
||||
public Module create() throws InvalidPluginException {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user