From 809b3493e4e97ad96b29b23ae3eccb5511e2db9a Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Fri, 30 May 2014 09:46:38 -0600 Subject: [PATCH] More defensive if getCause() changes --- classpath/java/lang/Throwable.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } }