aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-21 22:35:43 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-21 23:00:50 +0200
commit71e022071f6b244422f74580ec3c04179695a3ea (patch)
treea40a03e941f1e30ab3cc1a39e30c3c4f8990f79d /sonar-application/src
parent44447ed6b69b1497ed60cc4d610742a5d9987873 (diff)
downloadsonarqube-71e022071f6b244422f74580ec3c04179695a3ea.tar.gz
sonarqube-71e022071f6b244422f74580ec3c04179695a3ea.zip
Fix quality flaws
Diffstat (limited to 'sonar-application/src')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/JdbcSettings.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
index cbfbf4d6265..0a8f22839f5 100644
--- a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
+++ b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
@@ -19,18 +19,17 @@
*/
package org.sonar.application;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.LoggerFactory;
-import org.sonar.process.MessageException;
-import org.sonar.process.ProcessProperties;
-import org.sonar.process.Props;
-
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.sonar.api.utils.log.Loggers;
+import org.sonar.process.MessageException;
+import org.sonar.process.ProcessProperties;
+import org.sonar.process.Props;
public class JdbcSettings {
@@ -73,13 +72,13 @@ public class JdbcSettings {
Pattern pattern = Pattern.compile("jdbc:(\\w+):.+");
Matcher matcher = pattern.matcher(url);
if (!matcher.find()) {
- throw new MessageException(String.format("Bad format of JDBC URL: " + url));
+ throw new MessageException(String.format("Bad format of JDBC URL: %s", url));
}
String key = matcher.group(1);
try {
return Provider.valueOf(StringUtils.upperCase(key));
} catch (IllegalArgumentException e) {
- throw new MessageException(String.format(String.format("Unsupported JDBC driver provider: %s", key)));
+ throw new MessageException(String.format("Unsupported JDBC driver provider: %s", key));
}
}
@@ -100,7 +99,7 @@ public class JdbcSettings {
private void checkRecommendedParameter(String url, String val) {
if (!url.contains(val)) {
- LoggerFactory.getLogger(getClass()).warn(String.format("JDBC URL is recommended to have the property '%s'", val));
+ Loggers.get(getClass()).warn("JDBC URL is recommended to have the property '{}'", val);
}
}
}