From: aclement Date: Thu, 10 Mar 2005 17:52:39 +0000 (+0000) Subject: Declare annotation: uses the new annotation type munger X-Git-Tag: V1_5_0M2~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bdb151a442a2606ad37640c4307ba1429514c8dd;p=aspectj.git Declare annotation: uses the new annotation type munger --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index d8e755a8c..61df9e161 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -33,6 +33,7 @@ import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.WeaveMessage; import org.aspectj.weaver.AjcMemberMaker; +import org.aspectj.weaver.AnnotationOnTypeMunger; import org.aspectj.weaver.AsmRelationshipProvider; import org.aspectj.weaver.ConcreteTypeMunger; import org.aspectj.weaver.Member; @@ -86,6 +87,8 @@ public class BcelTypeMunger extends ConcreteTypeMunger { changed = mungeNewConstructor(weaver, (NewConstructorTypeMunger)munger); } else if (munger.getKind() == ResolvedTypeMunger.Parent) { changed = mungeNewParent(weaver, (NewParentTypeMunger)munger); + } else if (munger.getKind() == ResolvedTypeMunger.AnnotationOnType) { + changed = mungeNewAnnotationOnType(weaver,(AnnotationOnTypeMunger)munger); } else { throw new RuntimeException("unimplemented"); } @@ -152,6 +155,12 @@ public class BcelTypeMunger extends ConcreteTypeMunger { } return path.substring(takefrom+1); } + + 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(munger.getNewAnnotation().getBcelAnnotation()); + return true; + } /** * For a long time, AspectJ did not allow binary weaving of declare parents. This restriction is now lifted