Fix for bug 950 -- NPE Compiler.java:407 -- also searched for any other instances & found two other cases of the same bug

This commit is contained in:
Andrew Stone 2012-06-08 16:49:31 -04:00
parent 958c835ef0
commit 5e75bd4a97
3 changed files with 13 additions and 12 deletions

View File

@ -401,12 +401,8 @@ public class Compiler implements MessageConsumer {
boolean compiling = true;
while (compiling) {
try {
Thread t = in.thread;
if (t != null)
t.join();
t = err.thread;
if (t != null)
t.join();
in.join();
err.join();
result = process.waitFor();
//System.out.println("result is " + result);
compiling = false;

View File

@ -85,8 +85,15 @@ public class MessageSiphon implements Runnable {
}
}
// Wait until the MessageSiphon thread is complete.
public void join() throws java.lang.InterruptedException {
// Grab a temp copy in case another thread nulls the "thread"
// member variable
Thread t = thread;
if (t != null) t.join();
}
public Thread getThread() {
return thread;
}
}
}

View File

@ -63,10 +63,8 @@ public class Sizer implements MessageConsumer {
while(running) {
try {
if (in.thread != null)
in.thread.join();
if (err.thread != null)
err.thread.join();
in.join();
err.join();
r = process.waitFor();
running = false;
} catch (InterruptedException intExc) { }