From 0be0b4df98034d96d0ec4b0ca5fa29a310a2fd22 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 15 Dec 2011 07:57:37 +0000 Subject: [PATCH] Fix violations --- src/main/java/org/sonar/runner/Main.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/sonar/runner/Main.java b/src/main/java/org/sonar/runner/Main.java index eccf6d0..839275e 100644 --- a/src/main/java/org/sonar/runner/Main.java +++ b/src/main/java/org/sonar/runner/Main.java @@ -61,7 +61,7 @@ public final class Main { private static void printMemoryUsage() { Runtime r = Runtime.getRuntime(); - System.out.println("Final Memory: " + (r.totalMemory() - r.freeMemory()) / MB + "M/" + r.totalMemory() / MB + "M"); + log("Final Memory: " + (r.totalMemory() - r.freeMemory()) / MB + "M/" + r.totalMemory() / MB + "M"); } static Properties loadProperties(String[] args) { @@ -97,13 +97,13 @@ public final class Main { private static File locatePropertiesFile(Properties props, String homeKey, String relativePathFromHome, String settingsKey) { File settingsFile = null; String runnerHome = props.getProperty(homeKey); - if (runnerHome != null && !runnerHome.equals("")) { + if (runnerHome != null && !"".equals(runnerHome)) { settingsFile = new File(runnerHome, relativePathFromHome); } if (settingsFile == null || !settingsFile.exists()) { String settingsPath = props.getProperty(settingsKey); - if (settingsPath != null && !settingsPath.equals("")) { + if (settingsPath != null && !"".equals(settingsPath)) { settingsFile = new File(settingsPath); } } @@ -186,4 +186,7 @@ public final class Main { private static void log(String message) { System.out.println(message); // NOSONAR } + + private Main() { + } } -- 2.39.5