diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-20 12:26:24 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-20 12:26:24 +0200 |
commit | cfd9912407a505d6005d70f89ffc01c2d19b7ab4 (patch) | |
tree | bcb920437ce0055791f01d994dc3560d99e63e58 /sonar-plugin-api/src/main/java/org/sonar/api | |
parent | ab09254608fa6dcf5595891d9070e4d9faf21276 (diff) | |
download | sonarqube-cfd9912407a505d6005d70f89ffc01c2d19b7ab4.tar.gz sonarqube-cfd9912407a505d6005d70f89ffc01c2d19b7ab4.zip |
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/qualitymodel/Characteristic.java | 3 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/qualitymodel/Characteristic.java b/sonar-plugin-api/src/main/java/org/sonar/api/qualitymodel/Characteristic.java index 33940a06ff2..17b518de8f9 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/qualitymodel/Characteristic.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/qualitymodel/Characteristic.java @@ -28,6 +28,7 @@ import org.hibernate.annotations.SortType; import org.sonar.api.rules.Rule; import javax.persistence.*; + import java.util.Collections; import java.util.List; @@ -299,7 +300,7 @@ public final class Characteristic implements Comparable<Characteristic> { public Double getPropertyValue(String key, Double defaultValue) { CharacteristicProperty property = getProperty(key); - Double value = (property != null ? property.getValue() : null); + Double value = property != null ? property.getValue() : null; return value == null ? defaultValue : value; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java index 15227f0deb7..55878682ff6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java @@ -27,12 +27,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; +import java.util.concurrent.*; /** * Synchronously execute a native command line. It's much more limited than the Apache Commons Exec library. @@ -79,6 +74,7 @@ public class CommandExecutor { final Process finalProcess = process; executorService = Executors.newSingleThreadExecutor(); Future<Integer> ft = executorService.submit(new Callable<Integer>() { + @Override public Integer call() throws Exception { return finalProcess.waitFor(); } |