diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-06 09:24:47 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-06 09:37:13 +0200 |
commit | 46d6957730741f64a75b0b9404395bd5bc5d4cd4 (patch) | |
tree | e20e1cfba9fb8fdb53cc304be544fece6e8063a6 /sonar-plugin-api | |
parent | 899f7efa859fa9f805eb82035be4b364826c5630 (diff) | |
download | sonarqube-46d6957730741f64a75b0b9404395bd5bc5d4cd4.tar.gz sonarqube-46d6957730741f64a75b0b9404395bd5bc5d4cd4.zip |
Revert to previous behavior for CommandExecutor::execute for timeout=0
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java | 5 |
1 files changed, 3 insertions, 2 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 68f7349093d..d95d3234718 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 @@ -56,7 +56,7 @@ public class CommandExecutor { /** * @throws org.sonar.api.utils.command.TimeoutException on timeout, since 4.4 * @throws CommandException on any other error - * @param timeoutMilliseconds set it to 0 for no timeout. + * @param timeoutMilliseconds any negative value means no timeout. * @since 3.0 */ public int execute(Command command, StreamConsumer stdOut, StreamConsumer stdErr, long timeoutMilliseconds) { @@ -86,7 +86,7 @@ public class CommandExecutor { } }); int exitCode; - if (timeoutMilliseconds == 0) { + if (timeoutMilliseconds < 0) { exitCode = ft.get(); } else { exitCode = ft.get(timeoutMilliseconds, TimeUnit.MILLISECONDS); @@ -128,6 +128,7 @@ public class CommandExecutor { * Execute command and display error and output streams in log. * Method {@link #execute(Command, StreamConsumer, StreamConsumer, long)} is preferable, * when fine-grained control of output of command required. + * @param timeoutMilliseconds any negative value means no timeout. * * @throws CommandException */ |