]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Minor refactoring
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 5 Apr 2013 23:10:46 +0000 (01:10 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 5 Apr 2013 23:10:46 +0000 (01:10 +0200)
sonar-runner-dist/src/main/java/org/sonar/runner/Cli.java
sonar-runner-dist/src/main/java/org/sonar/runner/Conf.java
sonar-runner-dist/src/main/java/org/sonar/runner/SystemInfo.java

index 0acb6ee845b91acb20e81b424438b43fafbc2b79..2c29dbc8e91d9ba84707a78f4d5d5b31b268f9c6 100644 (file)
@@ -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);
   }
 }
index 13b5239b6ce74ffd707c835de5afdda7a8b7fa13..e92cdcd2f2e4da2d9ba7d6ec1a768d4c238a111f 100644 (file)
@@ -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);
       }
     }
index c199d5be0a933814e2d60e0c6d033431e0a27edc..a153d02fc27cdd31dad8eeae45553d6a44bf6ec4 100644 (file)
@@ -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());