harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r1027577 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/ classlib/support/src/test/java/tests/support/ drlvm/ jdktools/
Date Tue, 26 Oct 2010 14:29:40 GMT
Author: hindessm
Date: Tue Oct 26 14:29:40 2010
New Revision: 1027577

URL: http://svn.apache.org/viewvc?rev=1027577&view=rev
Log:
Merge change from /harmony/enhanced/java/trunk@1022390:

  r1022390 | hindessm | 2010-10-14 08:08:53 +0100 (Thu, 14 Oct 2010) | 3 lines
  
  Refactor InstrumentTestHelper to share code with Support_Exec.  More
  work needed.
  

Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java
    harmony/enhanced/java/branches/java6/classlib/support/src/test/java/tests/support/Support_Exec.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 14:29:40 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064
+/harmony/enhanced/java/trunk:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064,1022390
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 14:29:40 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064
+/harmony/enhanced/java/trunk/classlib:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064,1022390
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 14:29:40 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064,1022390
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java?rev=1027577&r1=1027576&r2=1027577&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java
Tue Oct 26 14:29:40 2010
@@ -36,6 +36,7 @@ import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
+import tests.support.Support_Exec;
 
 public class InstrumentTestHelper {
     private Manifest manifest;
@@ -52,9 +53,9 @@ public class InstrumentTestHelper {
 
     private List<String> classpath = new ArrayList<String>();
 
-    private StringBuilder stdOut = new StringBuilder();
+    private String stdOut;
 
-    private StringBuilder stdErr = new StringBuilder();
+    private String stdErr;
 
     private int exitCode;
 
@@ -148,40 +149,11 @@ public class InstrumentTestHelper {
     }
 
     private void runAgentTest() throws IOException, InterruptedException {
-        String[] args = new String[2];
-        args[0] = "-javaagent:" + commandAgent;
-        if (commandAgentOptions != null
-                && commandAgentOptions.trim().length() != 0) {
-            args[0] += "=" + commandAgentOptions;
-        }
-
-        args[1] = mainClass.getName();
-
-        Process process = execJava(args, getClasspath());
-        process.waitFor();
-
-        exitCode = process.exitValue();
-    }
-
-    private Process execJava(String[] args, String[] classpath)
-            throws IOException {
-        // this function returns the resulting process from the exec
-        StringBuilder command;
-        String testVMArgs;
-        StringTokenizer st;
-
-        List<String> execArgs = new ArrayList<String>(3 + args.length);
-
-        // construct the name of executable file
-        String executable = System.getProperty("java.home");
-        if (!executable.endsWith(File.separator)) {
-            executable += File.separator;
-        }
-        executable += "bin" + File.separator + "java";
-        execArgs.add(executable);
+        List<String> execArgs = new ArrayList<String>(4);
 
         // add classpath string
         StringBuilder classPathString = new StringBuilder();
+        String[] classpath = getClasspath();
         if (classpath != null && classpath.length > 0) {
             boolean isFirst = true;
             for (String element : classpath) {
@@ -199,67 +171,17 @@ public class InstrumentTestHelper {
             execArgs.add(classPathString.toString());
         }
 
-        // parse hy.test.vmargs if was given
-        testVMArgs = System.getProperty("hy.test.vmargs");
-        if (testVMArgs != null) {
-            st = new StringTokenizer(testVMArgs, " ");
-            while (st.hasMoreTokens()) {
-                execArgs.add(st.nextToken());
-            }
-        }
-
-        // add custom args given as parameter
-        for (String arg : args) {
-            execArgs.add(arg);
-        }
-
-        // construct command line string and print it to stdout
-        command = new StringBuilder(execArgs.get(0));
-        for (int i = 1; i < execArgs.size(); i++) {
-            command.append(" ");
-            command.append(execArgs.get(i));
-        }
-        System.out.println("Exec: " + command.toString());
-        System.out.println();
-
-        // execute java process
-        final Process proc = Runtime.getRuntime().exec(
-                execArgs.toArray(new String[execArgs.size()]));
-
-        final String lineSeparator = System.getProperty("line.separator");
-        Thread errReader = new Thread(new Runnable() {
-            public void run() {
-                BufferedReader reader = new BufferedReader(
-                        new InputStreamReader(proc.getErrorStream()));
-                String line = null;
-                try {
-                    while ((line = reader.readLine()) != null) {
-                        stdErr.append(line).append(lineSeparator);
-                    }
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        errReader.start();
-
-        Thread outReader = new Thread(new Runnable() {
-            public void run() {
-                BufferedReader reader = new BufferedReader(
-                        new InputStreamReader(proc.getInputStream()));
-                String line = null;
-                try {
-                    while ((line = reader.readLine()) != null) {
-                        stdOut.append(line).append(lineSeparator);
-                    }
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        outReader.start();
-
-        return proc;
+        execArgs.add("-javaagent:" + commandAgent
+                     + ((commandAgentOptions != null
+                         && commandAgentOptions.trim().length() != 0)
+                        ? "=" + commandAgentOptions
+                        : ""));
+        execArgs.add(mainClass.getName());
+
+        Object[] res = Support_Exec.runJava(execArgs, null, false);
+        exitCode = ((Integer)res[0]).intValue();
+        stdOut = (String)res[1];
+        stdErr = (String)res[2];
     }
 
     private void generateJars() throws FileNotFoundException, IOException,
@@ -308,11 +230,11 @@ public class InstrumentTestHelper {
     }
 
     public String getStdOut() {
-        return stdOut.toString();
+        return stdOut;
     }
 
     public String getStdErr() {
-        return stdErr.toString();
+        return stdErr;
     }
 
     public String[] getClasspath() {

Modified: harmony/enhanced/java/branches/java6/classlib/support/src/test/java/tests/support/Support_Exec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/support/src/test/java/tests/support/Support_Exec.java?rev=1027577&r1=1027576&r2=1027577&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/support/src/test/java/tests/support/Support_Exec.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/support/src/test/java/tests/support/Support_Exec.java
Tue Oct 26 14:29:40 2010
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.StringTokenizer;
 
 import junit.framework.TestCase;
@@ -30,28 +31,88 @@ import junit.framework.TestCase;
 public class Support_Exec extends TestCase {
 
     /**
+     * Exec java returns the exitCode, and stdOut and stdErr as strings
+     */
+    public static Object[] runJava(List<String> args, String[] envp,
+                                   boolean displayOutput)
+            throws IOException, InterruptedException {
+        String executable = System.getProperty("java.home");
+        if (!executable.endsWith(File.separator)) {
+            executable += File.separator;
+        }
+        executable += "bin" + File.separator + "java";
+
+        // parse hy.test.vmargs if was given
+        String testVMArgs = System.getProperty("hy.test.vmargs");
+        if (testVMArgs != null) {
+            StringTokenizer st = new StringTokenizer(testVMArgs, " ");
+            int i = 0; // add at the beginning but maintain order
+            while (st.hasMoreTokens()) {
+                args.add(i++, st.nextToken());
+            }
+        }
+
+        return run(executable, args, envp, displayOutput);
+    }
+
+    /**
+     * Exec command returns the exitCode, and stdOut and stdErr as strings
+     */
+    public static Object[] run(String command, List<String> args, String[] envp,
+                               boolean displayOutput)
+            throws IOException, InterruptedException {
+        Object[] arr = exec(command, args, envp, displayOutput);
+
+        Process proc = (Process) arr[0];
+        StringBuilder output = new StringBuilder();
+        InputStream in = proc.getInputStream();
+        int result;
+        byte[] bytes = new byte[1024];
+
+        while ((result = in.read(bytes)) != -1) {
+            output.append(new String(bytes, 0, result));
+            if (displayOutput) {
+                System.out.write(bytes, 0, result);
+            }
+        }
+
+        in.close();
+        proc.waitFor();
+        int exitCode = proc.exitValue();
+        proc.destroy();
+        return new Object[] {
+            Integer.valueOf(exitCode),
+            output.toString(),
+            ((StringBuilder)arr[1]).toString()
+        };
+    }
+        
+    /**
      *  This function returns the output of the process as a string
      */
-	public static String execJava(String[] args, String[] classpath,
-			boolean displayOutput) throws IOException, InterruptedException {
+    public static String execJava(String[] args, String[] classpath,
+                                  boolean displayOutput)
+        throws IOException, InterruptedException {
         Object[] arr =
-                execJavaCommon(args, classpath, null, displayOutput, true);
+            execJavaCommon(args, classpath, null, displayOutput, true);
 
-        return getProcessOutput(arr, displayOutput);
-	}
+        return getProcessOutput(arr, displayOutput, true);
+    }
 
     /**
      * This function returns the output of the process as a string
      */
-	public static String execJava(String[] args, String[] classpath, String[] envp,
-			boolean displayOutput) throws IOException, InterruptedException {
-		Object[] arr =
-                execJavaCommon(args, classpath, envp, displayOutput, false);
+    public static String execJava(String[] args, String[] classpath,
+                                  String[] envp, boolean displayOutput)
+            throws IOException, InterruptedException {
+        Object[] arr =
+            execJavaCommon(args, classpath, envp, displayOutput, false);
 
-        return getProcessOutput(arr, displayOutput);
-	}
+        return getProcessOutput(arr, displayOutput, true);
+    }
 
-    private static String getProcessOutput(Object[] arr, boolean displayOutput)
+    private static String getProcessOutput(Object[] arr, boolean displayOutput,
+                                           boolean checkStderr)
             throws IOException, InterruptedException {
         Process proc = (Process) arr[0];
         StringBuilder output = new StringBuilder();
@@ -61,7 +122,6 @@ public class Support_Exec extends TestCa
 
         while ((result = in.read(bytes)) != -1) {
             output.append(new String(bytes, 0, result));
-
             if (displayOutput) {
                 System.out.write(bytes, 0, result);
             }
@@ -69,47 +129,48 @@ public class Support_Exec extends TestCa
 
         in.close();
         proc.waitFor();
-        checkStderr(arr);
+        if (checkStderr) {
+            checkStderr(arr);
+        }
         proc.destroy();
 
         return output.toString();
     }
 
     public static void checkStderr(Object[] execArgs) {
-		StringBuilder errBuf = (StringBuilder) execArgs[1];
+            StringBuilder errBuf = (StringBuilder) execArgs[1];
 
-        synchronized (errBuf) {
-			if (errBuf.length() > 0) {
-				fail(errBuf.toString());
-			}
-		}
-	}
+            synchronized (errBuf) {
+                if (errBuf.length() > 0) {
+                    fail(errBuf.toString());
+                }
+            }
+    }
 
     public static Object[] execJava2(String[] args, String[] classpath,
-			boolean displayOutput) throws IOException, InterruptedException {
+                                     boolean displayOutput)
+            throws IOException, InterruptedException {
         return execJavaCommon(args, classpath, null, displayOutput, true);
     }
 
     private static Object[] execJavaCommon(String[] args, String[] classpath,
-			String[] envp, boolean displayOutput, boolean appendToSystemClassPath)
+                                           String[] envp,
+                                           boolean displayOutput,
+                                           boolean appendToSystemClassPath)
             throws IOException, InterruptedException {
         // this function returns the resulting process from the exec
-		ArrayList<String> execArgs = null;
-		StringBuilder classPathString = new StringBuilder();
+        ArrayList<String> execArgs = null;
+        StringBuilder classPathString = new StringBuilder();
         StringBuilder command;
-        String executable;
-        String testVMArgs;
-        StringTokenizer st;
 
         execArgs = new ArrayList<String>(3 + args.length);
 
         // construct the name of executable file
-        executable = System.getProperty("java.home");
+        String executable = System.getProperty("java.home");
         if (!executable.endsWith(File.separator)) {
             executable += File.separator;
         }
-        executable += "bin" + File.separator;
-        execArgs.add(executable + "java");
+        executable += "bin" + File.separator + "java";
 
         // add classpath string
         if (classpath != null) {
@@ -121,7 +182,7 @@ public class Support_Exec extends TestCa
         if (appendToSystemClassPath) {
             execArgs.add("-cp");
             execArgs.add(System.getProperty("java.class.path") +
-                    classPathString);
+                         classPathString);
         } else {
             if (classpath != null) {
                 execArgs.add("-cp");
@@ -130,9 +191,9 @@ public class Support_Exec extends TestCa
         }
 
         // parse hy.test.vmargs if was given
-        testVMArgs = System.getProperty("hy.test.vmargs");
+        String testVMArgs = System.getProperty("hy.test.vmargs");
         if (testVMArgs != null) {
-            st = new StringTokenizer(testVMArgs, " ");
+            StringTokenizer st = new StringTokenizer(testVMArgs, " ");
 
             while (st.hasMoreTokens()) {
                 execArgs.add(st.nextToken());
@@ -143,74 +204,85 @@ public class Support_Exec extends TestCa
         for (String arg : args) {
             execArgs.add(arg);
         }
+        return exec(executable, execArgs, envp, displayOutput);
+    }
+
+    private static Object[] exec(String command, List<String> args,
+                                 String[] envp,
+                                 boolean displayOutput)
+            throws IOException, InterruptedException {
+        // this function returns the resulting process from the exec
+        args.add(0, command);
 
-        // construct command line string and print it to stdout
-        //if (displayOutput) {
-            command = new StringBuilder(execArgs.get(0));
-            for (int i = 1; i < execArgs.size(); i++) {
-                command.append(" ");
-                command.append(execArgs.get(i));
+        if (displayOutput) {
+            StringBuilder commandLine;
+            // construct command line string and print it to stdout
+            commandLine = new StringBuilder(args.get(0));
+            for (int i = 1; i < args.size(); i++) {
+                commandLine.append(" ");
+                commandLine.append(args.get(i));
             }
+            System.out.println("Exec: " + commandLine.toString());
             System.out.println();
-            System.out.println("Exec: " + command.toString());
-        //}
+        }
 
         // execute java process
-        final Process proc = Runtime.getRuntime().exec(
-                execArgs.toArray(new String[execArgs.size()]), envp);
-		final StringBuilder errBuf = new StringBuilder();
-		Thread errThread = new Thread(new Runnable() {
-			public void run() {
-				synchronized (errBuf) {
-                    InputStream err;
-                    int result;
-                    byte[] bytes = new byte[1024];
-
-                    synchronized (proc) {
-						proc.notifyAll();
-					}
-
-                    err = proc.getErrorStream();
-                    try {
-						while ((result = err.read(bytes)) != -1) {
-							System.err.write(bytes, 0, result);
-							errBuf.append(new String(bytes));
-						}
-						err.close();
-					} catch (IOException e) {
-						ByteArrayOutputStream out = new ByteArrayOutputStream();
-						PrintStream printer = new PrintStream(out);
-
-                        e.printStackTrace();
-						e.printStackTrace(printer);
-						printer.close();
-						errBuf.append(new String(out.toByteArray()));
-					}
-				}
-			}
-		});
+        final Process proc =
+            Runtime.getRuntime().exec(args.toArray(new String[args.size()]),
+                                      envp);
+
+        final StringBuilder errBuf = new StringBuilder();
+        Thread errThread = new Thread(new Runnable() {
+                public void run() {
+                    synchronized (errBuf) {
+                        InputStream err;
+                        int result;
+                        byte[] bytes = new byte[1024];
+
+                        synchronized (proc) {
+                            proc.notifyAll();
+                        }
+
+                        err = proc.getErrorStream();
+                        try {
+                            while ((result = err.read(bytes)) != -1) {
+                                System.err.write(bytes, 0, result);
+                                errBuf.append(new String(bytes));
+                            }
+                            err.close();
+                        } catch (IOException e) {
+                            ByteArrayOutputStream out =
+                                new ByteArrayOutputStream();
+                            PrintStream printer = new PrintStream(out);
+                            
+                            e.printStackTrace();
+                            e.printStackTrace(printer);
+                            printer.close();
+                            errBuf.append(new String(out.toByteArray()));
+                        }
+                    }
+                }
+            });
 
         synchronized (proc) {
-			errThread.start();
-			// wait for errThread to start
-			int count = 0;
-			boolean isFinished = false;
-			while(!isFinished) {
-			    try {
-			        proc.wait();
-			        isFinished = true;
-			    } catch (InterruptedException e) {
-			        if(++count == 2) {
-			            throw e;
-			        }
-			    }
-			}
-			if(count > 0) {
-			    Thread.currentThread().interrupt();
-			}
-		}
-
+            errThread.start();
+            // wait for errThread to start
+            int count = 0;
+            boolean isFinished = false;
+            while(!isFinished) {
+                try {
+                    proc.wait();
+                    isFinished = true;
+                } catch (InterruptedException e) {
+                    if(++count == 2) {
+                        throw e;
+                    }
+                }
+            }
+            if(count > 0) {
+                Thread.currentThread().interrupt();
+            }
+        }
         return new Object[] { proc, errBuf };
-	}
-
+    }
 }

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 14:29:40 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064
+/harmony/enhanced/java/trunk/drlvm:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064,1022390
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 14:29:40 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064
+/harmony/enhanced/java/trunk/jdktools:929253-997624,997759,997980,997986,998010,998030,998619,998628,998759,998804,998822,999260,999286,999306,999591,999601,999623,999715-999716,999724,999793,1000005,1000169,1000213,1000229,1000231,1000233,1000240,1000245,1000248,1000265,1000527,1000689,1000696,1000699-1000700,1000705,1000708,1001065,1001080,1001153,1001187,1001490,1001609,1001638,1001652,1001723,1001741,1001744-1001745,1001751,1002080,1002189,1002476,1002480,1002488,1002506,1002511,1002592,1002736,1002971,1002988,1002990,1003089,1003094-1003095,1003109,1003513,1003744,1004471,1004624,1004837,1004906,1004908,1005084,1005391,1005441-1005442,1005648,1005651,1006115,1021745,1022064,1022390
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147



Mime
View raw message