diff options
author | Daniel Trebbien <dtrebbien@gmail.com> | 2017-10-09 10:16:51 -0500 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-10-10 13:28:44 +0200 |
commit | 441b01006f59aa35668be27ae8c2fad05c260edb (patch) | |
tree | 8b99bca76f04b840bfc8a5c7a2aae500a347d07e /server/sonar-main | |
parent | 3f876238ebdfd1cce633ba2c0649752a77602968 (diff) | |
download | sonarqube-441b01006f59aa35668be27ae8c2fad05c260edb.tar.gz sonarqube-441b01006f59aa35668be27ae8c2fad05c260edb.zip |
Utilize parameterized logging rather than String.format()
Diffstat (limited to 'server/sonar-main')
-rw-r--r-- | server/sonar-main/src/main/java/org/sonar/application/cluster/health/HealthStateSharingImpl.java | 4 | ||||
-rw-r--r-- | server/sonar-main/src/main/java/org/sonar/application/process/SQProcess.java | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/cluster/health/HealthStateSharingImpl.java b/server/sonar-main/src/main/java/org/sonar/application/cluster/health/HealthStateSharingImpl.java index 1d2849545cf..14597ca6b3b 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/cluster/health/HealthStateSharingImpl.java +++ b/server/sonar-main/src/main/java/org/sonar/application/cluster/health/HealthStateSharingImpl.java @@ -31,8 +31,6 @@ import org.sonar.process.cluster.health.NodeHealthProvider; import org.sonar.process.cluster.health.SharedHealthStateImpl; import org.sonar.process.cluster.hz.HazelcastMember; -import static java.lang.String.format; - public class HealthStateSharingImpl implements HealthStateSharing { private static final Logger LOG = LoggerFactory.getLogger(HealthStateSharingImpl.class); @@ -78,7 +76,7 @@ public class HealthStateSharingImpl implements HealthStateSharing { } } } catch (InterruptedException ie) { - LOG.warn(format("Termination of pool %s failed", HealthStateSharingImpl.class.getSimpleName()), ie); + LOG.warn("Termination of pool {} failed", HealthStateSharingImpl.class.getSimpleName(), ie); // (Re-)Cancel if current thread also interrupted executorService.shutdownNow(); Thread.currentThread().interrupt(); diff --git a/server/sonar-main/src/main/java/org/sonar/application/process/SQProcess.java b/server/sonar-main/src/main/java/org/sonar/application/process/SQProcess.java index 18f6d192d6c..f0ddfa3ce7a 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/process/SQProcess.java +++ b/server/sonar-main/src/main/java/org/sonar/application/process/SQProcess.java @@ -68,7 +68,7 @@ public class SQProcess { try { this.process = commandLauncher.get(); } catch (RuntimeException e) { - LOG.error(format("Fail to launch process [%s]", processId.getKey()), e); + LOG.error("Fail to launch process [{}]", processId.getKey(), e); lifecycle.tryToMoveTo(Lifecycle.State.STOPPED); throw e; } @@ -131,7 +131,7 @@ public class SQProcess { process.waitFor(timeout, timeoutUnit); } catch (InterruptedException e) { // can't wait for the termination of process. Let's assume it's down. - LOG.warn(format("Interrupted while stopping process %s", processId), e); + LOG.warn("Interrupted while stopping process {}", processId, e); Thread.currentThread().interrupt(); } catch (Throwable e) { LOG.error("Can not ask for graceful stop of process {}", processId, e); |