Auto-format source code using gjf Change-Id: I73004740248ec95eaa02a7dbe1a483c5f2abc528
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/AutoReloadSecureCredentialsFactoryDecorator.java b/src/main/java/com/googlesource/gerrit/plugins/replication/AutoReloadSecureCredentialsFactoryDecorator.java index 32c439b..0bf9026 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/AutoReloadSecureCredentialsFactoryDecorator.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/AutoReloadSecureCredentialsFactoryDecorator.java
@@ -46,9 +46,10 @@ new AtomicReference<>(newSecureCredentialsFactory(site, secureStore, config)); if (config.useLegacyCredentials()) { logger.atWarning().log( - "Using legacy credentials in clear text in secure.config. Please encrypt your credentials using " - + "'java -jar gerrit.war passwd' for each remote, remove the gerrit.useLegacyCredentials in replication.config " - + "and then reload the replication plugin."); + "Using legacy credentials in clear text in secure.config. Please encrypt your credentials" + + " using 'java -jar gerrit.war passwd' for each remote, remove the" + + " gerrit.useLegacyCredentials in replication.config and then reload the replication" + + " plugin."); } }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/CreateProjectTask.java b/src/main/java/com/googlesource/gerrit/plugins/replication/CreateProjectTask.java index 00f8baf..8cbb2a2 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/CreateProjectTask.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/CreateProjectTask.java
@@ -51,8 +51,10 @@ } public boolean create() { - return destinations.getURIs(Optional.of(config.getName()), project, FilterType.PROJECT_CREATION) - .values().stream() + return destinations + .getURIs(Optional.of(config.getName()), project, FilterType.PROJECT_CREATION) + .values() + .stream() .map(u -> createProject(u, project, head)) .reduce(true, (a, b) -> a && b); }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/FanoutConfigResource.java b/src/main/java/com/googlesource/gerrit/plugins/replication/FanoutConfigResource.java index c634cce..b8392c7 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/FanoutConfigResource.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/FanoutConfigResource.java
@@ -112,7 +112,8 @@ Set<String> remoteNames = config.getSubsections("remote"); if (remoteNames.size() > 0) { logger.atSevere().log( - "When replication directory is present replication.config file cannot contain remote configuration. Ignoring: %s", + "When replication directory is present replication.config file cannot contain remote" + + " configuration. Ignoring: %s", String.join(",", remoteNames)); for (String name : remoteNames) { @@ -207,7 +208,8 @@ return hasher.hash().toString(); } catch (IOException e) { logger.atSevere().withCause(e).log( - "Cannot list remote configuration files from %s. Returning replication.config file version", + "Cannot list remote configuration files from %s. Returning replication.config file" + + " version", remoteConfigsDirPath); return parentVersion; }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/RemoteConfiguration.java b/src/main/java/com/googlesource/gerrit/plugins/replication/RemoteConfiguration.java index 726bcf5..e39afd6 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/RemoteConfiguration.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/RemoteConfiguration.java
@@ -25,6 +25,7 @@ * @return the delay value in seconds */ int getDelay(); + /** * Time to wait before rescheduling a remote replication operation, which might have failed the * first time round. Setting to 0 effectively disables the delay. @@ -32,6 +33,7 @@ * @return the delay value in seconds */ int getRescheduleDelay(); + /** * Time to wait before retrying a failed remote replication operation, Setting to 0 effectively * disables the delay. @@ -39,12 +41,14 @@ * @return the delay value in seconds */ int getRetryDelay(); + /** * List of the remote endpoint addresses used for replication. * * @return list of remote URL strings */ ImmutableList<String> getUrls(); + /** * List of alternative remote endpoint addresses, used for admin operations, such as repository * creation @@ -52,36 +56,42 @@ * @return list of remote URL strings */ ImmutableList<String> getAdminUrls(); + /** * List of repositories that should be replicated * * @return list of project strings */ ImmutableList<String> getProjects(); + /** * List of groups that should be used to access the repositories. * * @return list of group strings */ ImmutableList<String> getAuthGroupNames(); + /** * Influence how the name of the remote repository should be computed. * * @return a string representing a remote style name */ String getRemoteNameStyle(); + /** * If true, permissions-only projects and the refs/meta/config branch will also be replicated * * @return a string representing a remote style name */ boolean replicatePermissions(); + /** * the JGIT remote configuration representing the replication for this endpoint * * @return The remote config {@link RemoteConfig} */ RemoteConfig getRemoteConfig(); + /** * Number of times to retry a replication operation *
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java index 40f5278..b60cc57 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
@@ -405,7 +405,8 @@ if (isMultiPrimary() && e instanceof NoSuchFileException) { logger.atFine().log( message - + " (expected after recovery from another node's startup with multi-primaries and distributor enabled)", + + " (expected after recovery from another node's startup with multi-primaries and" + + " distributor enabled)", taskKey); } else { logger.atSevere().withCause(e).log(message, taskKey);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/PushReplicationTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/PushReplicationTest.java index 122465b..736ad1a 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/PushReplicationTest.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/PushReplicationTest.java
@@ -45,7 +45,8 @@ assertThat(escape("name\nwith-LF")).isEqualTo("name%0Awith-LF"); assertThat( escape( - "key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2 <option_VALUE-2> --option-without-value")) + "key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2 <option_VALUE-2>" + + " --option-without-value")) .isEqualTo( "key=a-value=1,%20--option1%20%22OPTION_VALUE_1%22%20--option-2%20%3Coption_VALUE-2%3E%20--option-without-value"); } @@ -56,7 +57,8 @@ String url = urlBase + "/${name}.git"; URIish template = new URIish(url); String name = - "key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2 <option_VALUE-2> --option-without-value"; + "key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2 <option_VALUE-2>" + + " --option-without-value"; String expectedAsciiName = "key=a-value=1,%20--option1%20\"OPTION_VALUE_1\"%20--option-2%20<option_VALUE-2>%20--option-without-value"; String expectedEscapedName =
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDaemon.java b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDaemon.java index 833310c..11b7718 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDaemon.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDaemon.java
@@ -26,7 +26,6 @@ import com.google.gerrit.entities.Project; import com.google.gerrit.extensions.api.changes.NotifyHandling; import com.google.gerrit.extensions.events.ProjectDeletedListener; -import com.google.gerrit.server.config.SitePaths; import com.google.gerrit.server.git.LocalDiskRepositoryManager; import com.google.inject.Inject; import java.io.IOException;
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorageTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorageTest.java index 6e02573..6d334fa 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorageTest.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorageTest.java
@@ -170,7 +170,8 @@ String url = urlBase + "/${name}.git"; URIish template = new URIish(url); String strangeValidName = - "project/with/a/strange/name key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2 <option_VALUE-2> --option-without-value"; + "project/with/a/strange/name key=a-value=1, --option1 \"OPTION_VALUE_1\" --option-2" + + " <option_VALUE-2> --option-without-value"; Project.NameKey project = Project.nameKey(strangeValidName); URIish expanded = Destination.getURI(template, project, "slash", false); ReplicateRefUpdate update =