From: aclement Date: Thu, 24 Mar 2005 13:13:42 +0000 (+0000) Subject: Removed 4 FIXMEs and added relationships for declare annotation on ITDs X-Git-Tag: V1_5_0M2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7d28c3b34fe214a4795e3c31f45093e374366c8b;p=aspectj.git Removed 4 FIXMEs and added relationships for declare annotation on ITDs --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index e2906bcd2..a96182178 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -576,8 +576,7 @@ class BcelClassWeaver implements IClassWeaver { LazyMethodGen annotationHolder = locateAnnotationHolderForFieldMunger(clazz,fieldMunger); if (doesAlreadyHaveAnnotation(annotationHolder,itdIsActually,decaF,reportedErrors)) continue; // skip this one... annotationHolder.addAnnotation(decaF.getAnnotationX()); - //FIXME asc you need to add relationships for these things - // AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),clazz.getName(),fields[fieldCounter]); + AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),itdIsActually.getSourceLocation()); isChanged = true; modificationOccured = true; @@ -596,8 +595,7 @@ class BcelClassWeaver implements IClassWeaver { LazyMethodGen annotationHolder = locateAnnotationHolderForFieldMunger(clazz,fieldMunger); if (doesAlreadyHaveAnnotation(annotationHolder,itdIsActually,decaF,reportedErrors)) continue; // skip this one... annotationHolder.addAnnotation(decaF.getAnnotationX()); - //FIXME asc you need to add relationships for these things - // AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),clazz.getName(),fields[fieldCounter]); + AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),itdIsActually.getSourceLocation()); isChanged = true; modificationOccured = true; forRemoval.add(decaF); @@ -632,11 +630,8 @@ class BcelClassWeaver implements IClassWeaver { annotationHolder.addAnnotation(decaMC.getAnnotationX()); itdIsActually.addAnnotation(decaMC.getAnnotationX()); isChanged=true; - //FIXME asc you need to add relationships for these things - // AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),clazz.getName(),fields[fieldCounter]); - isChanged = true; - modificationOccured = true; - + AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaMC.getSourceLocation(),itdIsActually.getSourceLocation()); + modificationOccured = true; } else { if (!decaMC.isStarredAnnotationPattern()) worthRetrying.add(decaMC); // an annotation is specified that might be put on by a subsequent decaf @@ -647,16 +642,16 @@ class BcelClassWeaver implements IClassWeaver { modificationOccured = false; List forRemoval = new ArrayList(); for (Iterator iter2 = worthRetrying.iterator(); iter.hasNext();) { - DeclareAnnotation decaF = (DeclareAnnotation) iter2.next(); - if (decaF.matches(itdIsActually,world)) { + DeclareAnnotation decaMC = (DeclareAnnotation) iter2.next(); + if (decaMC.matches(itdIsActually,world)) { LazyMethodGen annotationHolder = locateAnnotationHolderForFieldMunger(clazz,methodctorMunger); - if (doesAlreadyHaveAnnotation(annotationHolder,itdIsActually,decaF,reportedErrors)) continue; // skip this one... - annotationHolder.addAnnotation(decaF.getAnnotationX()); - //FIXME asc you need to add relationships for these things - // AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaF.getSourceLocation(),clazz.getName(),fields[fieldCounter]); + if (doesAlreadyHaveAnnotation(annotationHolder,itdIsActually,decaMC,reportedErrors)) continue; // skip this one... + annotationHolder.addAnnotation(decaMC.getAnnotationX()); + itdIsActually.addAnnotation(decaMC.getAnnotationX()); + AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaMC.getSourceLocation(),itdIsActually.getSourceLocation()); isChanged = true; modificationOccured = true; - forRemoval.add(decaF); + forRemoval.add(decaMC); } worthRetrying.removeAll(forRemoval); }