From 2f5f87fcf277cdfb65de560539d62cd2b54d2099 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 8 Feb 2007 12:38:26 +0000 Subject: [PATCH] extra debug around a problematic bit of code. --- .../aspectj/weaver/bcel/BcelObjectType.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index 694333967..5a748f1a3 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -791,8 +791,28 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { weaverState.setReweavable(false); weaverState.setUnwovenClassFileData(null); } - for (int i = methods.length - 1; i >= 0; i--) methods[i].evictWeavingState(); - for (int i = fields.length - 1; i >= 0; i--) fields[i].evictWeavingState(); + + ResolvedMember currentMember = null; + try { + for (int i = methods.length - 1; i >= 0; i--) { + currentMember = methods[i]; + methods[i].evictWeavingState(); + } + for (int i = fields.length - 1; i >= 0; i--) { + currentMember = fields[i]; + fields[i].evictWeavingState(); + } + } catch (IllegalStateException ise) { + // once we've found our problem, let's promote this to trace? + ise.printStackTrace(); // temporary... + // add more diagnostics !!! + StringBuffer newMessage = new StringBuffer(); + newMessage.append("Unexpected problem evicting state for members."); + newMessage.append("Problematic type is "+className+"."); + newMessage.append("Problematic member is "+currentMember+"."); + newMessage.append(ise.getMessage()); + throw new IllegalStateException(newMessage.toString()); + } javaClass = null; // setSourceContext(SourceContextImpl.UNKNOWN_SOURCE_CONTEXT); // bit naughty // interfaces=null; // force reinit - may get us the right instances! -- 2.39.5