Index: working_classlib/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/ServerCloneExceptionTest.java =================================================================== --- working_classlib/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/ServerCloneExceptionTest.java (revision 692634) +++ working_classlib/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/ServerCloneExceptionTest.java (working copy) @@ -68,8 +68,8 @@ assertNull(e.detail); try { e.initCause(e); - fail("No expected IllegalArgumentException"); - } catch (IllegalArgumentException exception) { + fail("No expected IllegalStateException"); + } catch (IllegalStateException exception) { // expected } } Index: working_vm/vm/vmcore/src/kernel_classes/javasrc/java/lang/Throwable.java =================================================================== --- working_vm/vm/vmcore/src/kernel_classes/javasrc/java/lang/Throwable.java (revision 692634) +++ working_vm/vm/vmcore/src/kernel_classes/javasrc/java/lang/Throwable.java (working copy) @@ -118,16 +118,16 @@ * @com.intel.drl.spec_ref */ public Throwable initCause(Throwable initialCause) { - if (initialCause == this) { + if (cause == this) { + if (initialCause != this) { + cause = initialCause; + return this; + } throw new IllegalArgumentException("A throwable cannot be its own cause."); } // second call of initCause(Throwable) - if (cause != this) { - throw new IllegalStateException("A cause can be set at most once." + + throw new IllegalStateException("A cause can be set at most once." + " Illegal attempt to re-set the cause of " + this); - } - cause = initialCause; - return this; } /**