diff --git a/classpath/java/lang/Throwable.java b/classpath/java/lang/Throwable.java index 90232eee82..9f02a7997b 100644 --- a/classpath/java/lang/Throwable.java +++ b/classpath/java/lang/Throwable.java @@ -112,9 +112,10 @@ public class Throwable implements Serializable { sb.append(" at ").append(trace[i].toString()).append(nl); } - if (getCause() != null) { + Throwable printCause = getCause(); + if (printCause != null) { sb.append("caused by: "); - getCause().printStackTrace(sb, nl); + printCause.printStackTrace(sb, nl); } }