Name: atR10191 Date: 05/30/2003
method public Throwable initCause(Throwable cause) of class Throwable
always throws IllegalStateException being called on the
java.rmi.RemoteException instance.
See the example below.
============ Test172.java ==============================================
import java.rmi.RemoteException;
public class Test172 {
public static void main(String argv[]) {
RemoteException re = new RemoteException("java");
Throwable ex = re.initCause(null);
System.out.println("initCause(null) returned " + ex);
System.exit(0);
}
}
======== end of Test172.java ==========================================
======== output of Test172 ============================================
Exception in thread "main" java.lang.IllegalStateException: Can't overwrite caus
e
at java.lang.Throwable.initCause(Throwable.java:320)
at Test172.main(Test172.java:8)
======== end of output of Test172 =====================================
======================================================================