Kaydet (Commit) 5d7d2beb authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1399442 UPM: Private method is never called

since

commit 10cb59eb
Date:   Mon Jan 16 16:41:53 2017 +0200

    remove some unused Java code

Change-Id: I00c0b1b22f29165fea73b39b4bf946af453186a3
Reviewed-on: https://gerrit.libreoffice.org/33378Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 711f203d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment