From: aclement Date: Wed, 1 Feb 2006 15:20:44 +0000 (+0000) Subject: fix for 125810 (from helen) X-Git-Tag: POST_MEMORY_CHANGES~122 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=795cd9eadc225d0c1c6d0297853bcd5ca8937be4;p=aspectj.git fix for 125810 (from helen) --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 9174ef4ca..e0d3d79ba 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -420,8 +420,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } } } - - if (hasPointcuts || dec instanceof AspectDeclaration) { + + if (hasPointcuts || dec instanceof AspectDeclaration || isAnnotationStyleAspectDeclaration(dec)) { ReferenceType name = (ReferenceType)factory.fromEclipse(sourceType); EclipseSourceType eclipseSourceType = (EclipseSourceType)name.getDelegate(); eclipseSourceType.checkPointcutDeclarations(); @@ -433,9 +433,22 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } } - + /** + * Return true if the declaration has @Aspect annotation + */ + private boolean isAnnotationStyleAspectDeclaration(TypeDeclaration dec) { + Annotation[] annotations = dec.annotations; + boolean isAtAspect = false; + if (annotations != null) { + for (int i = 0; i < annotations.length && !isAtAspect; i++) { + if (annotations[i].resolvedType.debugName().equals("org.aspectj.lang.annotation.Aspect")) { + isAtAspect = true; + } + } + } + return isAtAspect; + } - private void buildInterTypeAndPerClause(ClassScope s) { TypeDeclaration dec = s.referenceContext; if (dec instanceof AspectDeclaration) {