[Libreoffice-commits] core.git: qadevOOo/runner
Caolán McNamara
caolanm at redhat.com
Sat Jan 21 20:37:55 UTC 2017
qadevOOo/runner/helper/ProcessHandler.java | 97 -----------------------------
1 file changed, 1 insertion(+), 96 deletions(-)
New commits:
commit 5d7d2beba7c8ab635fb0657075fa81810053324a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 21 17:40:25 2017 +0000
coverity#1399442 UPM: Private method is never called
since
commit 10cb59eb914ba722c203242272de244d795a51e8
Date: Mon Jan 16 16:41:53 2017 +0200
remove some unused Java code
Change-Id: I00c0b1b22f29165fea73b39b4bf946af453186a3
Reviewed-on: https://gerrit.libreoffice.org/33378
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 1e136d9..aed7a12 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -177,8 +177,7 @@ public class ProcessHandler
/**
* Executes the command immediately returns. The process
- * remains in running state. Control of its state should
- * be made by <code>waitFor</code> methods.
+ * remains in running state.
*
* @return <code>true</code> if process was successfully
* started.
@@ -283,100 +282,6 @@ public class ProcessHandler
flushInput();
}
-
-
- /**
- * This method is useful when the process was executed
- * asynchronously. Waits during specified time for process
- * to exit and return its status.
- *
- * @param timeout > 0
- * Waits specified time in miliSeconds for
- * process to exit and return its status.
- *
- * = 0
- * Waits for the process to end regulary
- *
- * < 0
- * Kills the process immediately
- *
- * @return <code>true</code> if process correctly exited
- * (exit code doesn't affect to this result).
- */
- private boolean waitFor(long timeout)
- {
- return waitFor(timeout, true);
- }
-
- private boolean waitFor(long timeout, boolean bKillProcessAfterTimeout)
- {
- if (isFinished())
- {
- return true;
- }
- if (!isStarted())
- {
- return false;
- }
-
- if (timeout == 0)
- {
- try
- {
- m_aProcess.waitFor();
- }
- catch (InterruptedException e)
- {
- log.println("The process was interrupted: " + e);
- }
- isFinished = true;
- try
- {
- exitValue = m_aProcess.exitValue();
- }
- catch (IllegalThreadStateException e)
- {
- }
- }
- else
- {
- try
- {
- while (!isFinished && timeout > 0)
- {
- isFinished = true;
- Thread.sleep(1000);
- timeout -= 1000;
- try
- {
- exitValue = m_aProcess.exitValue(); // throws exception if not finished
- }
- catch (IllegalThreadStateException e)
- {
- isFinished = false;
- }
- }
- if (timeout < 0)
- {
- log.println("The process has timed out!");
- }
- }
- catch (InterruptedException ex)
- {
- log.println("The process was interrupted: " + ex);
- }
- }
-
- if (bKillProcessAfterTimeout && !isFinished)
- {
- log.println("Going to destroy the process!!");
- m_aProcess.destroy();
- log.println("Process has been destroyed!");
- }
-
- return isFinished();
- }
-
private void flushInput()
{
if (stdIn == null)
More information about the Libreoffice-commits
mailing list