From 0f7cb310b399fe3ab9b9ed4fb228752beba00975 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 9 Nov 2005 16:18:13 +0000 Subject: [PATCH] fixes for pr91859 --- .../aspectj/weaver/bcel/BcelTypeMunger.java | 1 + .../org/aspectj/weaver/bcel/BcelWeaver.java | 37 ++++++++----------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 0bc377fd4..6f92b5c03 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -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"); } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index fc35718cb..c2049533b 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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()); -- 2.39.5