From: Simon Brandhof Date: Fri, 5 Apr 2013 23:10:46 +0000 (+0200) Subject: Minor refactoring X-Git-Tag: 2.5-rc1~171 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=11b6a9f6d40f2c843faa4d70a61b17fcb9e4a1fa;p=sonar-scanner-cli.git Minor refactoring --- diff --git a/sonar-runner-dist/src/main/java/org/sonar/runner/Cli.java b/sonar-runner-dist/src/main/java/org/sonar/runner/Cli.java index 0acb6ee..2c29dbc 100644 --- a/sonar-runner-dist/src/main/java/org/sonar/runner/Cli.java +++ b/sonar-runner-dist/src/main/java/org/sonar/runner/Cli.java @@ -124,6 +124,6 @@ class Cli { Logs.info(" -h,--help Display help information"); Logs.info(" -v,--version Display version information"); Logs.info(" -X,--debug Produce execution debug output"); - System.exit(0); + System.exit(Exit.SUCCESS); } } diff --git a/sonar-runner-dist/src/main/java/org/sonar/runner/Conf.java b/sonar-runner-dist/src/main/java/org/sonar/runner/Conf.java index 13b5239..e92cdcd 100644 --- a/sonar-runner-dist/src/main/java/org/sonar/runner/Conf.java +++ b/sonar-runner-dist/src/main/java/org/sonar/runner/Conf.java @@ -77,14 +77,14 @@ class Conf { private File locatePropertiesFile(Properties props, String homeKey, String relativePathFromHome, String settingsKey) { File settingsFile = null; - String runnerHome = props.getProperty(homeKey); - if (runnerHome != null && !"".equals(runnerHome)) { + String runnerHome = props.getProperty(homeKey, ""); + if (!"".equals(runnerHome)) { settingsFile = new File(runnerHome, relativePathFromHome); } if (settingsFile == null || !settingsFile.exists()) { - String settingsPath = props.getProperty(settingsKey); - if (settingsPath != null && !"".equals(settingsPath)) { + String settingsPath = props.getProperty(settingsKey, ""); + if (!"".equals(settingsPath)) { settingsFile = new File(settingsPath); } } diff --git a/sonar-runner-dist/src/main/java/org/sonar/runner/SystemInfo.java b/sonar-runner-dist/src/main/java/org/sonar/runner/SystemInfo.java index c199d5b..a153d02 100644 --- a/sonar-runner-dist/src/main/java/org/sonar/runner/SystemInfo.java +++ b/sonar-runner-dist/src/main/java/org/sonar/runner/SystemInfo.java @@ -23,6 +23,10 @@ import org.sonar.runner.api.RunnerVersion; class SystemInfo { + private SystemInfo() { + // only static methods + } + static void print() { System.out.println("Sonar Runner " + RunnerVersion.version()); System.out.println(java());