]> source.dussan.org Git - aspectj.git/commitdiff
fix for 125810 (from helen)
authoraclement <aclement>
Wed, 1 Feb 2006 15:20:44 +0000 (15:20 +0000)
committeraclement <aclement>
Wed, 1 Feb 2006 15:20:44 +0000 (15:20 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java

index 9174ef4ca8795a6361ac476d0564137659227100..e0d3d79ba24a8be45e6f3ef9a2d2f3ae46ec28eb 100644 (file)
@@ -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) {