Fix compilaion error

I0adf995e1 broke compilation.

Change-Id: I0103c4e348733fc9f07ebe4fb0d749e2136d9a6a
This commit is contained in:
David Ostrovsky
2014-10-16 22:41:49 +02:00
parent d7494ad254
commit 835c3f9510
3 changed files with 17 additions and 4 deletions

View File

@@ -65,8 +65,12 @@ class AutoRegisterModules {
this.env = env; this.env = env;
this.scanner = scanner; this.scanner = scanner;
this.classLoader = classLoader; this.classLoader = classLoader;
this.sshGen = env.hasSshModule() ? env.newSshModuleGenerator() : ModuleGenerator.NOP; this.sshGen = env.hasSshModule()
this.httpGen = env.hasHttpModule() ? env.newHttpModuleGenerator() : ModuleGenerator.NOP; ? env.newSshModuleGenerator()
: new ModuleGenerator.NOP();
this.httpGen = env.hasHttpModule()
? env.newHttpModuleGenerator()
: new HttpModuleGenerator.NOP();
} }
AutoRegisterModules discover() throws InvalidPluginException { AutoRegisterModules discover() throws InvalidPluginException {

View File

@@ -14,6 +14,15 @@
package com.google.gerrit.server.plugins; package com.google.gerrit.server.plugins;
public interface HttpModuleGenerator extends ModuleGenerator { public interface HttpModuleGenerator extends ModuleGenerator {
void export(String javascript); void export(String javascript);
static class NOP extends ModuleGenerator.NOP
implements HttpModuleGenerator {
@Override
public void export(String javascript) {
// do nothing
}
}
} }

View File

@@ -27,7 +27,7 @@ public interface ModuleGenerator {
Module create() throws InvalidPluginException; Module create() throws InvalidPluginException;
public static final ModuleGenerator NOP = new ModuleGenerator() { static class NOP implements ModuleGenerator {
@Override @Override
public void setPluginName(String name) { public void setPluginName(String name) {
@@ -48,5 +48,5 @@ public interface ModuleGenerator {
public Module create() throws InvalidPluginException { public Module create() throws InvalidPluginException {
return null; return null;
} }
}; }
} }