System is a Ultra 30/256MB ram.
I'm using the SunSoft JDK1.1.5 release with
native threads but the problem also occurs
using the JavaSoft JDK1.1.6 with native
threads.
If you run the sample application it crashes
with:
java.lang.NullPointerException
at Fred$1.construct(Fred.java:13)
at Fred$2.run(Fred.java:31)
at java.lang.Thread.run(Thread.java)
Like I said, bizarre.
public class Fred {
public String s = "hello";
public void doIt() {
Worker w = new Worker();
Worker worker = new Worker() {
public void construct() {
System.out.println("This Fails");
s = "Hello There";
}
};
}
public static void main(String[] args) {
Fred f = new Fred();
f.doIt();
}
class Worker {
public void construct() {
System.out.println("This Works");
s = "Hello There";
}
public Worker() {
Runnable doConstruct = new Runnable() {
public void run() {
construct();
}
};
Thread thread = new Thread(doConstruct);
thread.start();
}
}
}
peter.castle@rsa 1998-07-06
peter.castle@rsa 1998-07-21