Fix 'raw type' warnings. No significant API changes.
This commit is contained in:
@@ -109,6 +109,7 @@ public class Background {
|
||||
String[] execCmd;
|
||||
ArrayList tmpCmd = new ArrayList();
|
||||
Runtime r;
|
||||
ArrayList<String> tmpCmd = new ArrayList<String>();
|
||||
|
||||
tmpCmd.add("cmd");
|
||||
tmpCmd.add("/c");
|
||||
|
||||
@@ -51,15 +51,15 @@ public class Execute {
|
||||
private File workingDirectory = null;
|
||||
private boolean newEnvironment = false;
|
||||
|
||||
private static Vector procEnvironment = null;
|
||||
private static Vector<String> procEnvironment = null;
|
||||
|
||||
/**
|
||||
* Find the list of environment variables for this process.
|
||||
*/
|
||||
public static synchronized Vector getProcEnvironment() {
|
||||
public static synchronized Vector<String> getProcEnvironment() {
|
||||
if (procEnvironment != null) return procEnvironment;
|
||||
|
||||
procEnvironment = new Vector();
|
||||
procEnvironment = new Vector<String>();
|
||||
try {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Execute exe = new Execute(new PumpStreamHandler(out));
|
||||
@@ -321,7 +321,8 @@ public class Execute {
|
||||
* @return the patched environment
|
||||
*/
|
||||
private String[] patchEnvironment() {
|
||||
Vector osEnv = (Vector) getProcEnvironment().clone();
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<String> osEnv = (Vector<String>) getProcEnvironment().clone();
|
||||
for (int i = 0; i < env.length; i++) {
|
||||
int pos = env[i].indexOf('=');
|
||||
// Get key including "="
|
||||
@@ -340,18 +341,18 @@ public class Execute {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int execute( Vector envVars, String cmd, File baseDir ) {
|
||||
Vector v=new Vector();
|
||||
public static int execute(Vector<String> envVars, String cmd, File baseDir ) {
|
||||
Vector<String> v = new Vector<String>();
|
||||
StringTokenizer st=new StringTokenizer( cmd, " " );
|
||||
while( st.hasMoreTokens() ) {
|
||||
v.addElement( st.nextElement() );
|
||||
v.addElement( st.nextToken() );
|
||||
}
|
||||
|
||||
return execute( envVars, v, baseDir );
|
||||
}
|
||||
|
||||
public static int execute( Vector envVars, Vector cmd, File baseDir) {
|
||||
return execute( envVars, cmd, baseDir, 10000 /* default time to wait */);
|
||||
public static int execute(Vector<String> envVars, Vector<String> cmd, File baseDir) {
|
||||
return execute( envVars, cmd, baseDir, 10000 /* default time to wait */);
|
||||
}
|
||||
|
||||
/** Wrapper for common execution patterns
|
||||
@@ -360,7 +361,7 @@ public class Execute {
|
||||
* @param baseDir the base directory to run from (optional)
|
||||
* @param timeToWait milliseconds to wait for completion
|
||||
*/
|
||||
public static int execute( Vector envVars, Vector cmd, File baseDir, int timeToWait) {
|
||||
public static int execute(Vector<String> envVars, Vector<String> cmd, File baseDir, int timeToWait) {
|
||||
try {
|
||||
// We can collect the out or provide in if needed
|
||||
ExecuteWatchdog watchdog=new ExecuteWatchdog( timeToWait );
|
||||
|
||||
Reference in New Issue
Block a user