8151141: Sjavac fails to fork server on Windows
Summary: Reverted changeset 3269:80c06d9873bd.
Reviewed-by: jlahoda
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/client/SjavacClient.java Thu Mar 03 15:07:29 2016 +0530
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/client/SjavacClient.java Thu Mar 03 15:53:51 2016 +0100
@@ -257,7 +257,7 @@
// serverProcess != null at this point.
try {
// Throws an IOException if no valid values materialize
- portFile.waitForValidValues(serverProcess);
+ portFile.waitForValidValues();
} catch (IOException ex) {
// Process was started, but server failed to initialize. This could
// for instance be due to the JVM not finding the server class,
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java Thu Mar 03 15:07:29 2016 +0530
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java Thu Mar 03 15:53:51 2016 +0100
@@ -232,7 +232,7 @@
/**
* Wait for the port file to contain values that look valid.
*/
- public void waitForValidValues(Process serverProcess) throws IOException, InterruptedException {
+ public void waitForValidValues() throws IOException, InterruptedException {
final int MS_BETWEEN_ATTEMPTS = 500;
long startTime = System.currentTimeMillis();
long timeout = startTime + getServerStartupTimeoutSeconds() * 1000;
@@ -250,9 +250,6 @@
if (System.currentTimeMillis() > timeout) {
break;
}
- if (!serverProcess.isAlive()) {
- throw new IOException("Server process terminated.");
- }
Thread.sleep(MS_BETWEEN_ATTEMPTS);
}
throw new IOException("No port file values materialized. Giving up after " +