From: aclement Date: Mon, 15 May 2006 12:28:27 +0000 (+0000) Subject: recover from crash whilst crashing... X-Git-Tag: V1_5_2rc1~132 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c2da6f738945e027241703ef91c49099d9851d8;p=aspectj.git recover from crash whilst crashing... --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index aa043700b..8c1667be5 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -1581,12 +1581,26 @@ public class BcelWeaver implements IWeaver { return clazz; } } catch (RuntimeException re) { - String messageText = "trouble in: \n" + clazz.toLongString(); + String classDebugInfo = null; + try { + classDebugInfo = clazz.toLongString(); + } catch (Exception e) { + // recover from crash whilst producing debug string + classDebugInfo = clazz.getClassName(); + } + String messageText = "trouble in: \n" + classDebugInfo; getWorld().getMessageHandler().handleMessage( new Message(messageText,IMessage.ABORT,re,null) ); } catch (Error re) { - String messageText = "trouble in: \n" + clazz.toLongString(); + String classDebugInfo = null; + try { + classDebugInfo = clazz.toLongString(); + } catch (Exception e) { + // recover from crash whilst producing debug string + classDebugInfo = clazz.getClassName(); + } + String messageText = "trouble in: \n" + classDebugInfo; getWorld().getMessageHandler().handleMessage( new Message(messageText,IMessage.ABORT,re,null) );