--- a/jdk/src/share/classes/java/lang/Throwable.java Wed Apr 24 21:27:52 2013 +0000
+++ b/jdk/src/share/classes/java/lang/Throwable.java Thu Apr 25 09:37:03 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -453,9 +453,10 @@
*/
public synchronized Throwable initCause(Throwable cause) {
if (this.cause != this)
- throw new IllegalStateException("Can't overwrite cause");
+ throw new IllegalStateException("Can't overwrite cause with " +
+ Objects.toString(cause, "a null"), this);
if (cause == this)
- throw new IllegalArgumentException("Self-causation not permitted");
+ throw new IllegalArgumentException("Self-causation not permitted", this);
this.cause = cause;
return this;
}
@@ -1039,7 +1040,7 @@
*/
public final synchronized void addSuppressed(Throwable exception) {
if (exception == this)
- throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE);
+ throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE, exception);
if (exception == null)
throw new NullPointerException(NULL_CAUSE_MESSAGE);