From: Duarte Meneses Date: Wed, 9 Nov 2016 08:33:28 +0000 (+0100) Subject: Fix quality issues X-Git-Tag: 2.9.0.670~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32da3293ad76b0a734ad78ecb3668c490c790a51;p=sonar-scanner-cli.git Fix quality issues --- diff --git a/src/main/java/org/sonarsource/scanner/cli/Conf.java b/src/main/java/org/sonarsource/scanner/cli/Conf.java index c224204..3479108 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Conf.java +++ b/src/main/java/org/sonarsource/scanner/cli/Conf.java @@ -31,6 +31,8 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import javax.annotation.Nullable; + import org.sonarsource.scanner.api.Utils; class Conf { @@ -206,7 +208,7 @@ class Conf { return locatePropertiesFile(settingsFile, props, settingsKey); } - private static Path locatePropertiesFile(Path defaultPath, Properties props, String settingsKey) { + private static Path locatePropertiesFile(@Nullable Path defaultPath, Properties props, String settingsKey) { Path settingsFile = defaultPath; if (settingsFile == null || !Files.exists(settingsFile)) { String settingsPath = props.getProperty(settingsKey, ""); diff --git a/src/main/java/org/sonarsource/scanner/cli/Logs.java b/src/main/java/org/sonarsource/scanner/cli/Logs.java index a26a850..60d788d 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Logs.java +++ b/src/main/java/org/sonarsource/scanner/cli/Logs.java @@ -65,9 +65,7 @@ public class Logs { public void error(String message, Throwable t) { print(stdErr, "ERROR: " + message); - if (t != null) { - t.printStackTrace(stdErr); - } + t.printStackTrace(stdErr); } private void print(PrintStream stream, String msg) {