diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-04-07 17:12:26 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-04-07 17:12:26 +0200 |
commit | a9bf502a052d2edc80526521de7407b43d751973 (patch) | |
tree | 09a572f4ac43a467c040efd332366942036290d1 /sonar-runner-batch/src/main/java/org | |
parent | 20f838228f687a6f6cddc79838956601b23a229c (diff) | |
download | sonar-scanner-cli-a9bf502a052d2edc80526521de7407b43d751973.tar.gz sonar-scanner-cli-a9bf502a052d2edc80526521de7407b43d751973.zip |
Fix some quality flaws and update coverage
Diffstat (limited to 'sonar-runner-batch/src/main/java/org')
-rw-r--r-- | sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java | 16 | ||||
-rw-r--r-- | sonar-runner-batch/src/main/java/org/sonar/runner/batch/package-info.java | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java index 26fcf4c..a451dbd 100644 --- a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java +++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java @@ -40,6 +40,10 @@ import java.util.Properties; */ public class IsolatedLauncher { + private static final String WARN = "WARN"; + private static final String DEBUG = "DEBUG"; + private static final String FALSE = "false"; + public void execute(String sonarVersion, Properties properties, List<Object> extensions) { createBatch(sonarVersion, properties, extensions).execute(); } @@ -60,7 +64,7 @@ public class IsolatedLauncher { jc.setContext(context); context.reset(); InputStream input = Batch.class.getResourceAsStream("/org/sonar/batch/logback.xml"); - System.setProperty("ROOT_LOGGER_LEVEL", isDebug(props) ? "DEBUG" : "INFO"); + System.setProperty("ROOT_LOGGER_LEVEL", isDebug(props) ? DEBUG : "INFO"); context.putProperty("SQL_LOGGER_LEVEL", getSqlLevel(props)); context.putProperty("SQL_RESULTS_LOGGER_LEVEL", getSqlResultsLevel(props)); try { @@ -76,18 +80,18 @@ public class IsolatedLauncher { @VisibleForTesting protected boolean isDebug(Properties props) { - return Boolean.parseBoolean(props.getProperty("sonar.verbose", "false")); + return Boolean.parseBoolean(props.getProperty("sonar.verbose", FALSE)); } @VisibleForTesting protected static String getSqlLevel(Properties props) { - boolean showSql = "true".equals(props.getProperty("sonar.showSql", "false")); - return showSql ? "DEBUG" : "WARN"; + boolean showSql = "true".equals(props.getProperty("sonar.showSql", FALSE)); + return showSql ? DEBUG : WARN; } @VisibleForTesting protected static String getSqlResultsLevel(Properties props) { - boolean showSql = "true".equals(props.getProperty("sonar.showSqlResults", "false")); - return showSql ? "DEBUG" : "WARN"; + boolean showSql = "true".equals(props.getProperty("sonar.showSqlResults", FALSE)); + return showSql ? DEBUG : WARN; } } diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/package-info.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/package-info.java index 70b5c1f..33773c8 100644 --- a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/package-info.java +++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/package-info.java @@ -24,4 +24,5 @@ @ParametersAreNonnullByDefault package org.sonar.runner.batch; -import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file +import javax.annotation.ParametersAreNonnullByDefault; + |