aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-27 16:18:44 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-27 16:21:31 +0100
commit8cfd8984b7404bb1ded935ae6f46d7ce0faee405 (patch)
tree661b36c7fe7daee2a9c30167d666aca55dee589e /sonar-plugin-api/src/main/java
parent8b0becbe3ae16fef934d1e2066475b4a2ef52ea8 (diff)
downloadsonarqube-8cfd8984b7404bb1ded935ae6f46d7ce0faee405.tar.gz
sonarqube-8cfd8984b7404bb1ded935ae6f46d7ce0faee405.zip
Fix quality flaw
Diffstat (limited to 'sonar-plugin-api/src/main/java')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java4
1 files changed, 3 insertions, 1 deletions
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 e395c8ab820..0a094de7052 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
@@ -101,7 +101,6 @@ public class CommandExecutor {
return exitCode;
} catch (java.util.concurrent.TimeoutException te) {
- process.destroy();
throw new TimeoutException(command, "Timeout exceeded: " + timeoutMilliseconds + " ms", te);
} catch (CommandException e) {
@@ -111,6 +110,9 @@ public class CommandExecutor {
throw new CommandException(command, e);
} finally {
+ if (process != null) {
+ process.destroy();
+ }
waitUntilFinish(outputGobbler);
waitUntilFinish(errorGobbler);
closeStreams(process);