]> source.dussan.org Git - aspectj.git/commitdiff
Declare annotation: uses the new annotation type munger
authoraclement <aclement>
Thu, 10 Mar 2005 17:52:39 +0000 (17:52 +0000)
committeraclement <aclement>
Thu, 10 Mar 2005 17:52:39 +0000 (17:52 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java

index d8e755a8c834144cd3520d46a1bc7fc8b4982e7d..61df9e1619f5a584040f340749f5755852afb944 100644 (file)
@@ -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