aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDaniel Trebbien <dtrebbien@gmail.com>2017-10-09 10:52:03 -0500
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-10 14:22:53 +0200
commit6972869252c7be41fb0230d9f5a8c3aa8b12c95e (patch)
tree5c8e0524cfec4e3f79284f84502aeb9ef902d3db /server
parent441b01006f59aa35668be27ae8c2fad05c260edb (diff)
downloadsonarqube-6972869252c7be41fb0230d9f5a8c3aa8b12c95e.tar.gz
sonarqube-6972869252c7be41fb0230d9f5a8c3aa8b12c95e.zip
Incorporate the constant property names into the logger format string
The resulting string concatenation is still a constant expression.
Diffstat (limited to 'server')
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java b/server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java
index 9011f167c8e..dd14b4306a8 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java
@@ -136,19 +136,19 @@ public class JdbcSettings implements Consumer<Props> {
if (isNotEmpty(existing)) {
Logger logger = LoggerFactory.getLogger(JdbcSettings.class);
if (expectedUrl.equals(existing)) {
- logger.warn("To change H2 database port, only property '{}' should be set (which current value is '{}'). " +
- "Remove property '{}' from configuration to remove this warning.",
- JDBC_EMBEDDED_PORT, port,
- JDBC_URL);
+ logger.warn("To change H2 database port, only property '" + JDBC_EMBEDDED_PORT +
+ "' should be set (which current value is '{}'). " +
+ "Remove property '" + JDBC_URL + "' from configuration to remove this warning.",
+ port);
} else {
- logger.warn("Both '{}' and '{}' properties are set. " +
- "The value of property '{}' ('{}') is not consistent with the value of property '{}' ('{}'). " +
- "The value of property '{}' will be ignored and value '{}' will be used instead. " +
- "To remove this warning, either remove property '{}' if your intent was to use the embedded H2 database, otherwise remove property '{}'.",
- JDBC_EMBEDDED_PORT, JDBC_URL,
- JDBC_URL, existing, JDBC_EMBEDDED_PORT, port,
- JDBC_URL, expectedUrl,
- JDBC_URL, JDBC_EMBEDDED_PORT);
+ logger.warn("Both '" + JDBC_EMBEDDED_PORT + "' and '" + JDBC_URL + "' properties are set. " +
+ "The value of property '" + JDBC_URL + "' ('{}') is not consistent with the value of property '" +
+ JDBC_EMBEDDED_PORT + "' ('{}'). " +
+ "The value of property '" + JDBC_URL + "' will be ignored and value '{}' will be used instead. " +
+ "To remove this warning, either remove property '" + JDBC_URL +
+ "' if your intent was to use the embedded H2 database, otherwise remove property '" + JDBC_EMBEDDED_PORT
+ + "'.",
+ existing, port, expectedUrl);
}
}
}