Merge branch 'stable-2.11'
* stable-2.11:
OnStartStop: Remove unused config member variable
MotdFileBasedConfig: Remove declaration of unthrown exception
Supports multi-line MOTD messages
Change-Id: I1ad2fee9ed30604897a47f9f24d7864895338aab
diff --git a/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java b/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java
index 67355d5..af4c6ab 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java
@@ -116,8 +116,7 @@
return motd;
}
- private static List<SubnetConfig> allSubnets(FileBasedConfig cfg)
- throws ConfigInvalidException {
+ private static List<SubnetConfig> allSubnets(FileBasedConfig cfg) {
Set<String> names = cfg.getSubsections("subnet");
List<SubnetConfig> result = Lists.newArrayListWithCapacity(names.size());
for (String name : names) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/motd/OnStartStop.java b/src/main/java/com/googlesource/gerrit/plugins/motd/OnStartStop.java
index 8581180..f4c354b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/OnStartStop.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/OnStartStop.java
@@ -18,21 +18,21 @@
import com.google.inject.Inject;
class OnStartStop implements LifecycleListener {
- private final MotdConfig config;
-
@Inject
- OnStartStop(MotdConfig config) {
- // Set up a config so we load the config at startup.
- this.config = config;
+ OnStartStop(@SuppressWarnings("unused") MotdConfig config) {
+ // Do nothing.
+ // The config is unused. We only need to get it injected so it's
+ // loaded on startup rather than lazily when it's referenced for
+ // the first time.
}
@Override
public void start() {
- /* do nothing */
+ // Do nothing.
}
@Override
public void stop() {
- /* do nothing */
+ // Do nothing.
}
}