From 5c2da6f738945e027241703ef91c49099d9851d8 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 15 May 2006 12:28:27 +0000 Subject: [PATCH] recover from crash whilst crashing... --- .../org/aspectj/weaver/bcel/BcelWeaver.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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) ); -- 2.39.5