Fix FloggerFormatString error pattern flagged by error prone
Running the recent error prone version is flagging error pattern
FloggerFormatString:
GerritSshApi.java:69: error: [FloggerFormatString] missing argument for
format specifier '%s'
logger.atInfo().log(
^
(see https://errorprone.info/bugpattern/FloggerFormatString)
Destination.java:466: error: [FloggerFormatString] extra format
arguments: used 0, provided 2
repLog.atFine().log("scheduling deletion of project {} at {}", project, uri);
^
(see https://errorprone.info/bugpattern/FloggerFormatString)
Change-Id: I01ea76f6673cb445924c72d40cef9e4ba57e2e6f
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
index e0a9354..dfe7e79 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
@@ -463,7 +463,7 @@
}
void scheduleDeleteProject(URIish uri, Project.NameKey project, ProjectDeletionState state) {
- repLog.atFine().log("scheduling deletion of project {} at {}", project, uri);
+ repLog.atFine().log("scheduling deletion of project %s at %s", project, uri);
@SuppressWarnings("unused")
ScheduledFuture<?> ignored =
pool.schedule(deleteProjectFactory.create(uri, project, state), 0, TimeUnit.SECONDS);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java b/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
index d195aa3..0fa02ef 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
@@ -68,7 +68,8 @@
if (exitCode == 1) {
logger.atInfo().log(
"DeleteProject plugin is not installed on %s;"
- + " will not try to forward this operation to that host");
+ + " will not try to forward this operation to that host",
+ uri);
withoutDeleteProjectPlugin.add(uri);
}
}