Merge pull request #273 from jentfoo/master

Improved Throwable for if getCause is overridden
This commit is contained in:
Joel Dice 2014-05-30 11:47:34 -06:00
commit 46f4e51c32

View File

@ -12,7 +12,6 @@ package java.lang;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.Serializable;
public class Throwable implements Serializable {
@ -113,9 +112,10 @@ public class Throwable implements Serializable {
sb.append(" at ").append(trace[i].toString()).append(nl);
}
if (cause != null) {
Throwable printCause = getCause();
if (printCause != null) {
sb.append("caused by: ");
cause.printStackTrace(sb, nl);
printCause.printStackTrace(sb, nl);
}
}