diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-21 17:40:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-21 20:37:26 +0000 |
commit | 5d7d2beba7c8ab635fb0657075fa81810053324a (patch) | |
tree | 24c48fbd9bb99ec1414da61aea773fbef52dd169 /qadevOOo | |
parent | 711f203d1eeaeb0c2c75569c8606e98c394fd301 (diff) |
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@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/helper/ProcessHandler.java | 97 |
1 files changed, 1 insertions, 96 deletions
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java index 1e136d97095e..aed7a12e91aa 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) |