From 795cd9eadc225d0c1c6d0297853bcd5ca8937be4 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 1 Feb 2006 15:20:44 +0000 Subject: [PATCH] fix for 125810 (from helen) --- .../compiler/lookup/AjLookupEnvironment.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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) { -- 2.39.5