]> source.dussan.org Git - aspectj.git/commitdiff
extra debug around a problematic bit of code.
authoraclement <aclement>
Thu, 8 Feb 2007 12:38:26 +0000 (12:38 +0000)
committeraclement <aclement>
Thu, 8 Feb 2007 12:38:26 +0000 (12:38 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java

index 6943339679ca1895042d91c7bfc6340a47a6c601..5a748f1a3bc07b531c4b22083aa99c52e7e10a31 100644 (file)
@@ -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!