Reformat with google-java-format Change-Id: I3549ad4dc44cbce17564f12df9df9a7dfc5e466e
diff --git a/github-plugin/src/main/java/com/google/gerrit/server/account/AccountImporter.java b/github-plugin/src/main/java/com/google/gerrit/server/account/AccountImporter.java index 7258346..a8f8155 100644 --- a/github-plugin/src/main/java/com/google/gerrit/server/account/AccountImporter.java +++ b/github-plugin/src/main/java/com/google/gerrit/server/account/AccountImporter.java
@@ -21,11 +21,10 @@ import com.google.gwtorm.server.OrmException; import com.google.inject.Inject; import com.google.inject.Provider; -import org.eclipse.jgit.errors.ConfigInvalidException; - import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.eclipse.jgit.errors.ConfigInvalidException; public class AccountImporter { private final Sequences sequences; @@ -33,8 +32,7 @@ @Inject public AccountImporter( - Sequences sequences, - @ServerInitiated Provider<AccountsUpdate> accountsUpdateProvider) { + Sequences sequences, @ServerInitiated Provider<AccountsUpdate> accountsUpdateProvider) { this.sequences = sequences; this.accountsUpdateProvider = accountsUpdateProvider; } @@ -45,9 +43,16 @@ List<ExternalId> extIds = new ArrayList<>(); extIds.add(ExternalId.createEmail(id, email)); extIds.add(ExternalId.create(ExternalId.SCHEME_GERRIT, login, id)); - AccountState accountUpdate = accountsUpdateProvider.get() - .insert("Create GitHub account for " + login, id, - u -> u.setFullName(MoreObjects.firstNonNull(name, login)).setPreferredEmail(email).addExternalIds(extIds)); + AccountState accountUpdate = + accountsUpdateProvider + .get() + .insert( + "Create GitHub account for " + login, + id, + u -> + u.setFullName(MoreObjects.firstNonNull(name, login)) + .setPreferredEmail(email) + .addExternalIds(extIds)); return accountUpdate.getAccount().getId(); } }
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/InitGitHub.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/InitGitHub.java index 4fdb9bb..828613e 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/InitGitHub.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/InitGitHub.java
@@ -68,7 +68,12 @@ github.string("GitHub Client ID", "clientId", null); github.passwordForKey("GitHub Client Secret", "clientSecret"); - AuthType authType = auth.select("Gerrit OAuth implementation", "type", AuthType.HTTP, EnumSet.of(AuthType.HTTP, AuthType.OAUTH)); + AuthType authType = + auth.select( + "Gerrit OAuth implementation", + "type", + AuthType.HTTP, + EnumSet.of(AuthType.HTTP, AuthType.OAUTH)); if (authType.equals(AuthType.HTTP)) { auth.string("HTTP Authentication Header", "httpHeader", "GITHUB_USER"); httpd.set("filterClass", "com.googlesource.gerrit.plugins.github.oauth.OAuthFilter");
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/CreateProjectStep.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/CreateProjectStep.java index e57b21d..e3006b6 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/CreateProjectStep.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/CreateProjectStep.java
@@ -182,7 +182,8 @@ project.setParentName(config.getBaseProject(getRepository().isPrivate())); project.setDescription(description); project.setSubmitType(SubmitType.MERGE_IF_NECESSARY); - project.setBooleanConfig(BooleanProjectConfig.USE_CONTRIBUTOR_AGREEMENTS, InheritableBoolean.INHERIT); + project.setBooleanConfig( + BooleanProjectConfig.USE_CONTRIBUTOR_AGREEMENTS, InheritableBoolean.INHERIT); project.setBooleanConfig(BooleanProjectConfig.USE_SIGNED_OFF_BY, InheritableBoolean.INHERIT); project.setBooleanConfig(BooleanProjectConfig.USE_CONTENT_MERGE, InheritableBoolean.INHERIT); project.setBooleanConfig(BooleanProjectConfig.REQUIRE_CHANGE_ID, InheritableBoolean.INHERIT);
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java index 050d439..f2313a0 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/git/PullRequestCreateChange.java
@@ -14,6 +14,8 @@ package com.googlesource.gerrit.plugins.github.git; +import static com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS; + import com.google.gerrit.common.errors.EmailException; import com.google.gerrit.extensions.restapi.RestApiException; import com.google.gerrit.index.query.QueryParseException; @@ -44,6 +46,9 @@ import com.google.gwtorm.server.OrmException; import com.google.inject.Inject; import com.google.inject.Provider; +import java.io.IOException; +import java.util.Collections; +import java.util.List; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.lib.ObjectId; @@ -56,12 +61,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -import static com.google.gerrit.reviewdb.client.RefNames.REFS_HEADS; - public class PullRequestCreateChange { private static final Logger LOG = LoggerFactory.getLogger(PullRequestCreateChange.class); private static final FooterKey CHANGE_ID = new FooterKey("Change-Id"); @@ -269,8 +268,7 @@ if (topic != null) { change.setTopic(topic); } - ChangeInserter ins = - changeInserterFactory.create(change.getId(), pullRequestCommit, refName); + ChangeInserter ins = changeInserterFactory.create(change.getId(), pullRequestCommit, refName); ins.setMessage(pullRequestMessage); bu.insertChange(ins);
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupsCache.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupsCache.java index 509c245..1f87013 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupsCache.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/group/GitHubGroupsCache.java
@@ -14,6 +14,8 @@ package com.googlesource.gerrit.plugins.github.group; +import static java.time.temporal.ChronoUnit.MINUTES; + import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableSet; @@ -28,21 +30,17 @@ import com.googlesource.gerrit.plugins.github.groups.OrganizationStructure; import com.googlesource.gerrit.plugins.github.oauth.GitHubLogin; import com.googlesource.gerrit.plugins.github.oauth.UserScopedProvider; -import org.kohsuke.github.GHTeam; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.FileNotFoundException; import java.io.IOException; import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.ExecutionException; - -import static java.time.temporal.ChronoUnit.MINUTES; +import org.kohsuke.github.GHTeam; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @Singleton public class GitHubGroupsCache {
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/Destination.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/Destination.java index 08f6368..78be76a 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/Destination.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/Destination.java
@@ -25,13 +25,12 @@ import com.google.gerrit.server.account.GroupBackend; import com.google.gerrit.server.account.GroupBackends; import com.google.gerrit.server.account.ListGroupMembership; -import org.eclipse.jgit.lib.Config; -import org.eclipse.jgit.transport.RemoteConfig; -import org.eclipse.jgit.transport.URIish; - import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.List; +import org.eclipse.jgit.lib.Config; +import org.eclipse.jgit.transport.RemoteConfig; +import org.eclipse.jgit.transport.URIish; public class Destination { private final RemoteConfig remote;
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/PluginVelocityRuntimeProvider.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/PluginVelocityRuntimeProvider.java index 0a1fa24..d0080c5 100644 --- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/PluginVelocityRuntimeProvider.java +++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/velocity/PluginVelocityRuntimeProvider.java
@@ -19,16 +19,15 @@ import com.google.inject.Provider; import com.google.inject.ProvisionException; import com.google.inject.Singleton; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Properties; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.RuntimeInstance; import org.apache.velocity.runtime.log.Log4JLogChute; import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; import org.apache.velocity.runtime.resource.loader.JarResourceLoader; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.Properties; - @Singleton public class PluginVelocityRuntimeProvider implements Provider<RuntimeInstance> { private static final String VELOCITY_FILE_RESOURCE_LOADER_PATH = "file.resource.loader.path";