From 82d052e1a5f5fe29d6603ef38435606569dd90fe Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 19 Jul 2016 09:05:09 +0200 Subject: Fix Quality flaws --- .../src/main/java/org/sonar/api/utils/command/CommandExecutor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api') 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 79ff15faf90..b546b2aca9b 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 @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -79,7 +80,7 @@ public class CommandExecutor { final Process finalProcess = process; executorService = Executors.newSingleThreadExecutor(); - Future ft = executorService.submit(() -> finalProcess.waitFor()); + Future ft = executorService.submit((Callable) finalProcess::waitFor); int exitCode; if (timeoutMilliseconds < 0) { exitCode = ft.get(); -- cgit v1.2.3