refactoring and moving the launcher utilities to wala.util
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4032 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
6416445fe4
commit
d7d6b048b6
|
@ -30,7 +30,6 @@ Export-Package: .,
|
|||
com.ibm.wala.demandpa.alg.statemachine,
|
||||
com.ibm.wala.demandpa.flowgraph,
|
||||
com.ibm.wala.demandpa.util,
|
||||
com.ibm.wala.dynamic,
|
||||
com.ibm.wala.escape,
|
||||
com.ibm.wala.fixedpoint.impl,
|
||||
com.ibm.wala.fixpoint,
|
||||
|
|
|
@ -8,4 +8,5 @@ Export-Package: com.ibm.wala.util,
|
|||
com.ibm.wala.util.debug,
|
||||
com.ibm.wala.util.functions,
|
||||
com.ibm.wala.util.intset,
|
||||
com.ibm.wala.util.math
|
||||
com.ibm.wala.util.math,
|
||||
com.ibm.wala.util.processes
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.ibm.wala.dynamic;
|
||||
package com.ibm.wala.util.processes;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
|
||||
/**
|
||||
* A generic process launcher
|
||||
*/
|
||||
|
@ -50,7 +48,7 @@ public class BasicLauncher extends Launcher {
|
|||
* @throws IllegalArgumentException
|
||||
* @throws IOException
|
||||
*/
|
||||
public int launch() throws WalaException, IllegalArgumentException, IOException {
|
||||
public int launch() throws IllegalArgumentException, IOException {
|
||||
Process p = spawnProcess(getCmd());
|
||||
Thread d1 = isCaptureErr() ? captureStdErr(p) : drainStdErr(p);
|
||||
Thread d2 = isCaptureOutput() ? captureStdOut(p) : drainStdOut(p);
|
||||
|
@ -62,14 +60,14 @@ public class BasicLauncher extends Launcher {
|
|||
input.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new WalaException("error priming stdin", e);
|
||||
throw new IOException("error priming stdin", e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
d1.join();
|
||||
d2.join();
|
||||
} catch (InterruptedException e) {
|
||||
throw new WalaException("Internal error", e);
|
||||
throw new Error("Internal error", e);
|
||||
}
|
||||
if (isCaptureErr()) {
|
||||
Drainer d = (Drainer) d1;
|
|
@ -8,7 +8,7 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.ibm.wala.dynamic;
|
||||
package com.ibm.wala.util.processes;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -8,7 +8,7 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.ibm.wala.dynamic;
|
||||
package com.ibm.wala.util.processes;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -19,7 +19,6 @@ import java.util.Iterator;
|
|||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
|
||||
/**
|
||||
* Abstract base class for a process launcher
|
Loading…
Reference in New Issue