]> source.dussan.org Git - aspectj.git/commitdiff
fixes for pr91859
authoraclement <aclement>
Wed, 9 Nov 2005 16:18:13 +0000 (16:18 +0000)
committeraclement <aclement>
Wed, 9 Nov 2005 16:18:13 +0000 (16:18 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 0bc377fd4fbbeeb65167315d07395c0d5a289dbc..6f92b5c03e598c145bacc167e9ae7c18266d5ce9 100644 (file)
@@ -103,6 +103,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                        changed = mungeNewParent(weaver, (NewParentTypeMunger)munger);
                } else if (munger.getKind() == ResolvedTypeMunger.AnnotationOnType) {
                        changed = mungeNewAnnotationOnType(weaver,(AnnotationOnTypeMunger)munger);
+                       worthReporting=false;
         } else {
                        throw new RuntimeException("unimplemented");
                }
index fc35718cb544a5b854059a7a1c620cb2636d18c8..c2049533bdc68fc2dd406cbc79955ef224e6ddc7 100644 (file)
@@ -1362,29 +1362,8 @@ public class BcelWeaver implements IWeaver {
                boolean didSomething = false;
                if (decA.matches(onType)) {
                        
-                       // FIXME asc important this should be guarded by the 'already has annotation' check below but isn't since the compiler is producing classfiles with deca affected things in...
-                       AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decA.getSourceLocation(),onType.getSourceLocation());
-                       
-                       // FIXME asc same comment above applies here
-                       // TAG: WeavingMessage 
-                       if (!getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)){
-                         getWorld().getMessageHandler().handleMessage(
-                             WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ANNOTATES,
-                                         new String[]{
-                                                           onType.toString(),
-                                                           Utility.beautifyLocation(onType.getSourceLocation()),
-                                                           decA.getAnnotationString(),
-                                                           "type",
-                                                           decA.getAspect().toString(),
-                                                           Utility.beautifyLocation(decA.getSourceLocation())
-                                                           }));
-                       }
-                       
-                       
                    if (onType.hasAnnotation(decA.getAnnotationX().getSignature())) {
-// FIXME asc Could put out a lint here for an already annotated type - the problem is that it may have
-// picked up the annotation during 'source weaving' in which case the message is misleading.  Leaving it
-// off for now...
+              // Could put out a lint here for an already annotated type ...
 //                   if (reportProblems) {
 //                     world.getLint().elementAlreadyAnnotated.signal(
 //                           new String[]{onType.toString(),decA.getAnnotationTypeX().toString()},
@@ -1399,6 +1378,20 @@ public class BcelWeaver implements IWeaver {
                        boolean problemReported = verifyTargetIsOK(decA, onType, annoX,reportProblems);
                        
                        if (!problemReported) {
+                               AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decA.getSourceLocation(),onType.getSourceLocation());
+                               // TAG: WeavingMessage 
+                               if (!getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)){
+                                 getWorld().getMessageHandler().handleMessage(
+                                     WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ANNOTATES,
+                                                 new String[]{
+                                                                   onType.toString(),
+                                                                   Utility.beautifyLocation(onType.getSourceLocation()),
+                                                                   decA.getAnnotationString(),
+                                                                   "type",
+                                                                   decA.getAspect().toString(),
+                                                                   Utility.beautifyLocation(decA.getSourceLocation())
+                                                                   }));
+                               }
                                didSomething = true;
                                ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX);
                                newAnnotationTM.setSourceLocation(decA.getSourceLocation());