Format all Java files with google-java-format 1.6
Change-Id: I72742c3212b8b62d2b3ef000547f5b0174f29f11
diff --git a/src/main/java/com/googlesource/gerrit/plugins/motd/DisplayMotd.java b/src/main/java/com/googlesource/gerrit/plugins/motd/DisplayMotd.java
index 06fcf14..83912a2 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/DisplayMotd.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/DisplayMotd.java
@@ -19,15 +19,13 @@
import com.google.gerrit.server.git.validators.UploadValidationListener;
import com.google.gerrit.server.validators.ValidationException;
import com.google.inject.Inject;
-
-import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.UploadPack;
-
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collection;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.UploadPack;
class DisplayMotd implements UploadValidationListener {
private final CurrentUser user;
@@ -40,9 +38,14 @@
}
@Override
- public void onPreUpload(Repository repository, Project project,
- String remote, UploadPack up, Collection<? extends ObjectId> wants,
- Collection<? extends ObjectId> haves) throws ValidationException {
+ public void onPreUpload(
+ Repository repository,
+ Project project,
+ String remote,
+ UploadPack up,
+ Collection<? extends ObjectId> wants,
+ Collection<? extends ObjectId> haves)
+ throws ValidationException {
PrintWriter pw = new PrintWriter(up.getMessageOutputStream());
if (config.getMotd() != null) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/motd/Module.java b/src/main/java/com/googlesource/gerrit/plugins/motd/Module.java
index d5b019d..c9b9dd2 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/Module.java
@@ -16,20 +16,17 @@
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.extensions.registration.DynamicSet;
+import com.google.gerrit.server.git.validators.UploadValidationListener;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.internal.UniqueAnnotations;
-import com.google.gerrit.server.git.validators.UploadValidationListener;
-
class Module extends AbstractModule {
@Override
protected void configure() {
- DynamicSet.bind(binder(), UploadValidationListener.class).to(
- DisplayMotd.class);
+ DynamicSet.bind(binder(), UploadValidationListener.class).to(DisplayMotd.class);
bind(OnStartStop.class).in(Scopes.SINGLETON);
- bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to(
- OnStartStop.class);
+ bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to(OnStartStop.class);
bind(MotdConfig.class).to(MotdFileBasedConfig.class);
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/motd/MotdConfig.java b/src/main/java/com/googlesource/gerrit/plugins/motd/MotdConfig.java
index 82b3615..0fbfaf9 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/MotdConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/MotdConfig.java
@@ -22,5 +22,4 @@
String getMotd();
boolean isEmpty();
-
}
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 af4c6ab..222aab6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/motd/MotdFileBasedConfig.java
@@ -19,7 +19,11 @@
import com.google.gerrit.server.config.SitePaths;
import com.google.inject.Inject;
import com.google.inject.Singleton;
-
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
import org.apache.commons.net.util.SubnetUtils;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.storage.file.FileBasedConfig;
@@ -27,12 +31,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
@Singleton
public class MotdFileBasedConfig implements MotdConfig {
static final Logger log = LoggerFactory.getLogger(MotdFileBasedConfig.class);
@@ -42,8 +40,7 @@
private final FileBasedConfig config;
@Inject
- public MotdFileBasedConfig(final SitePaths site)
- throws ConfigInvalidException, IOException {
+ public MotdFileBasedConfig(final SitePaths site) throws ConfigInvalidException, IOException {
this.cfgPath = new File(site.etc_dir.toFile(), "motd.config");
log.info("Loading configuration from " + cfgPath);
this.config = new FileBasedConfig(cfgPath, FS.DETECTED);
@@ -62,24 +59,22 @@
private List<Subnet> allSubnets() throws ConfigInvalidException, IOException {
if (!config.getFile().exists()) {
- log.warn("Config file " + config.getFile()
- + " does not exist; not providing messages");
+ log.warn("Config file " + config.getFile() + " does not exist; not providing messages");
return Collections.emptyList();
}
if (config.getFile().length() == 0) {
- log.info("Config file " + config.getFile()
- + " is empty; not providing messages");
+ log.info("Config file " + config.getFile() + " is empty; not providing messages");
return Collections.emptyList();
}
try {
config.load();
} catch (ConfigInvalidException e) {
- throw new ConfigInvalidException(String.format(
- "Config file %s is invalid: %s", config.getFile(), e.getMessage()), e);
+ throw new ConfigInvalidException(
+ String.format("Config file %s is invalid: %s", config.getFile(), e.getMessage()), e);
} catch (IOException e) {
- throw new IOException(String.format("Cannot read %s: %s",
- config.getFile(), e.getMessage()), e);
+ throw new IOException(
+ String.format("Cannot read %s: %s", config.getFile(), e.getMessage()), e);
}
String[] motdLines = config.getStringList("gerrit", null, "motd");
@@ -88,8 +83,7 @@
ImmutableList.Builder<Subnet> subnetlist = ImmutableList.builder();
for (SubnetConfig c : allSubnets(config)) {
if (c.getMotd().isEmpty()) {
- log.warn("Subnet configuration for " + c.getSubnet()
- + " has no message");
+ log.warn("Subnet configuration for " + c.getSubnet() + " has no message");
continue;
}