]> source.dussan.org Git - aspectj.git/commitdiff
paramannos: implementation!
authoraclement <aclement>
Fri, 25 Jan 2008 18:59:49 +0000 (18:59 +0000)
committeraclement <aclement>
Fri, 25 Jan 2008 18:59:49 +0000 (18:59 +0000)
weaver/src/org/aspectj/weaver/AjAttribute.java
weaver/src/org/aspectj/weaver/JoinPointSignature.java
weaver/src/org/aspectj/weaver/Member.java
weaver/src/org/aspectj/weaver/MemberImpl.java
weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java

index a1fc5fcc4dd9d208906d24616da189c62fa9eb11..f1d68512e3cf4ebb2de35112e49d26a813ea89b8 100644 (file)
@@ -215,10 +215,15 @@ public abstract class AjAttribute {
                public static short WEAVER_VERSION_MAJOR_AJ150M4 = 3; 
                public static short WEAVER_VERSION_MAJOR_AJ150 = 2;
                public static short WEAVER_VERSION_MINOR_AJ150 = 0;
+
+               // These are the weaver major/minor numbers for AspectJ 1.6.0
+               public static short WEAVER_VERSION_MAJOR_AJ160 = 4;
+               public static short WEAVER_VERSION_MINOR_AJ160 = 0;
+
                
                // These are the weaver major/minor versions for *this* weaver
-               private static short CURRENT_VERSION_MAJOR      = WEAVER_VERSION_MAJOR_AJ150M4;
-               private static short CURRENT_VERSION_MINOR      = WEAVER_VERSION_MINOR_AJ150;
+               private static short CURRENT_VERSION_MAJOR      = WEAVER_VERSION_MAJOR_AJ160;
+               private static short CURRENT_VERSION_MINOR      = WEAVER_VERSION_MINOR_AJ160;
                
                public static final WeaverVersionInfo UNKNOWN = 
                        new WeaverVersionInfo(WEAVER_VERSION_MAJOR_UNKNOWN,WEAVER_VERSION_MINOR_UNKNOWN);
index 57752d232cd23d279c202ceecb5b6b66f750d2cd..3c168e67b6edbf33bf39793c36ddfe21db9b368b 100644 (file)
@@ -263,6 +263,14 @@ public class JoinPointSignature implements ResolvedMember {
        public UnresolvedType[] getParameterTypes() {
                return realMember.getParameterTypes();
        }
+       
+       public AnnotationX[][] getParameterAnnotations() {
+               return realMember.getParameterAnnotations();
+       }
+       
+       public ResolvedType[][] getParameterAnnotationTypes() {
+               return realMember.getParameterAnnotationTypes();
+       }
 
        public String getSignature() {
                return realMember.getSignature();
index 2b4d9d6d7037775ea2a376c9d29aabce526c4c84..f59ae646f26fc28ccd9fecd93ca62056311c11ca 100644 (file)
@@ -53,7 +53,9 @@ public interface Member {
        public static final Kind MONITORENTER = new Kind("MONITORENTER", 8);
        public static final Kind MONITOREXIT = new Kind("MONITOREXIT", 9);
 
-
+       public static final AnnotationX[][] NO_PARAMETER_ANNOTATIONXS = new AnnotationX[][]{};
+       public static final ResolvedType[][] NO_PARAMETER_ANNOTATION_TYPES = new ResolvedType[][]{};
+       
        public ResolvedMember resolve(World world);
 
        public int compareTo(Object other);
@@ -75,6 +77,9 @@ public interface Member {
 
        public UnresolvedType[] getParameterTypes();
 
+       public AnnotationX[][] getParameterAnnotations();
+       public ResolvedType[][] getParameterAnnotationTypes();
+       
        /**
         * Return full signature, including return type, e.g. "()LFastCar;" for a signature without the return type,
         * use getParameterSignature() - it is importnant to choose the right one in the face of covariance.
index 65050638cbd2cd01b97b81c29470c5544600c39b..d984f2e84b072df1144028831f1ac1e4649efbb1 100644 (file)
@@ -479,6 +479,13 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member {
         * @see org.aspectj.weaver.Member#getParameterTypes()
         */
     public UnresolvedType[]  getParameterTypes() { return parameterTypes; }
+    
+    public AnnotationX[][] getParameterAnnotations() {
+               throw new UnsupportedOperationException("You should resolve this member and call getParameterAnnotations() on the result...");
+    }
+    public ResolvedType[][] getParameterAnnotationTypes() { 
+               throw new UnsupportedOperationException("You should resolve this member and call getParameterAnnotationTypes() on the result...");
+    }
     /* (non-Javadoc)
         * @see org.aspectj.weaver.Member#getSignature()
         */
index 8401fa4c8ce1890029013b6229742b632182ad36..039d9f5c518e8f37a949c0fa5f0e585842a9dbe6 100644 (file)
@@ -42,6 +42,8 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
     protected ResolvedMember backingGenericMember = null;
         
     protected Set annotationTypes = null;
+    protected ResolvedType[][] parameterAnnotationTypes = null;
+    
        // Some members are 'created' to represent other things (for example ITDs).  These
        // members have their annotations stored elsewhere, and this flag indicates that is
        // the case.  It is up to the caller to work out where that is!
@@ -314,6 +316,16 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
                }
        }
        
+    public ResolvedType[][] getParameterAnnotationTypes() {
+       if (parameterAnnotationTypes == null) return null;
+               return parameterAnnotationTypes;
+    }
+    
+    public AnnotationX[][] getParameterAnnotations() {
+       if (backingGenericMember != null) return backingGenericMember.getParameterAnnotations();
+       return super.getParameterAnnotations();
+    }
+       
        public void addAnnotation(AnnotationX annotation) {
            // FIXME asc only allows for annotation types, not instances - should it?
                if (annotationTypes == null) annotationTypes = new HashSet();