From bdb151a442a2606ad37640c4307ba1429514c8dd Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 10 Mar 2005 17:52:39 +0000 Subject: [PATCH] Declare annotation: uses the new annotation type munger --- weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.39.5