aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2011-04-28 17:57:29 +0000
committeraclement <aclement>2011-04-28 17:57:29 +0000
commit2d239289d269387f6f45087607ffe82054406320 (patch)
treeed9f906301d6d2c5824cf39b5039618b5a6b514e /weaver
parenta8f2bae7a095e502ac4053f31ca0d781f60e8991 (diff)
downloadaspectj-2d239289d269387f6f45087607ffe82054406320.tar.gz
aspectj-2d239289d269387f6f45087607ffe82054406320.zip
318237: diagnostics
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index 222a4f2d1..fcf61a085 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -256,9 +256,14 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
}
private boolean mungeNewAnnotationOnType(BcelClassWeaver weaver, AnnotationOnTypeMunger munger) {
- // FIXME asc this has already been done up front, need to do it here
- // too?
- weaver.getLazyClassGen().addAnnotation(((BcelAnnotation) munger.getNewAnnotation()).getBcelAnnotation());
+ // FIXME asc this has already been done up front, need to do it here too?
+ try {
+ BcelAnnotation anno = (BcelAnnotation) munger.getNewAnnotation();
+ weaver.getLazyClassGen().addAnnotation(anno.getBcelAnnotation());
+ } catch (ClassCastException cce) {
+ throw new IllegalStateException("DiagnosticsFor318237: The typemunger "+munger+" contains an annotation of type "+
+ munger.getNewAnnotation().getClass().getName()+" when it should be a BcelAnnotation",cce);
+ }
return true;
}