]> source.dussan.org Git - aspectj.git/commitdiff
recover from crash whilst crashing...
authoraclement <aclement>
Mon, 15 May 2006 12:28:27 +0000 (12:28 +0000)
committeraclement <aclement>
Mon, 15 May 2006 12:28:27 +0000 (12:28 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index aa043700bd8eabf9d6b448b1a4950b4dc9f3a39c..8c1667be590200f23cd1a8175227082de3b137aa 100644 (file)
@@ -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)
                                                );