From: aclement Date: Thu, 8 Feb 2007 12:38:26 +0000 (+0000) Subject: extra debug around a problematic bit of code. X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f5f87fcf277cdfb65de560539d62cd2b54d2099;p=aspectj.git extra debug around a problematic bit of code. --- 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!