]> source.dussan.org Git - aspectj.git/commitdiff
see pr112105 comment #13: uses new declared sig support inside a munger.
authoraclement <aclement>
Wed, 26 Oct 2005 16:48:29 +0000 (16:48 +0000)
committeraclement <aclement>
Wed, 26 Oct 2005 16:48:29 +0000 (16:48 +0000)
weaver/src/org/aspectj/weaver/NewFieldTypeMunger.java
weaver/src/org/aspectj/weaver/NewMethodTypeMunger.java
weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java

index 6bd54722313a19543ed07ad02094c685f5db6489..c58493312258d2a0bb724f213d606c71e12b2939 100644 (file)
@@ -89,7 +89,7 @@ public class NewFieldTypeMunger extends ResolvedTypeMunger {
                  parameterizedSignature = getSignature().parameterizedWith(target.getTypeParameters(),genericType,target.isParameterizedType(),typeVariableAliases);
                }
                NewFieldTypeMunger nftm = new NewFieldTypeMunger(parameterizedSignature,getSuperMethodsCalled(),typeVariableAliases);
-           nftm.setOriginalSignature(getSignature());
+           nftm.setDeclaredSignature(getSignature());
            return nftm;
        }
 
index 531b493124c715f27277d321b93a2718b9a6d5d5..b08b70bb9306ecde20637d4a05d69ccb4c95b08d 100644 (file)
@@ -34,9 +34,30 @@ public class NewMethodTypeMunger extends ResolvedTypeMunger {
                return AjcMemberMaker.interMethodBody(signature, aspectType);
        }
        
+       /**
+        * If the munger has a declared signature 
+        */
+       public ResolvedMember getDeclaredInterMethodBody(UnresolvedType aspectType,World w) {
+               if (declaredSignature!=null) {
+                       ResolvedMember rm = declaredSignature.parameterizedWith(null,signature.getDeclaringType().resolve(w),false,getTypeVariableAliases());
+                       return AjcMemberMaker.interMethodBody(rm, aspectType);
+               } else {
+                       return AjcMemberMaker.interMethodBody(signature,aspectType);
+               }
+       }
+       
        public ResolvedMember getInterMethodDispatcher(UnresolvedType aspectType) {
                return AjcMemberMaker.interMethodDispatcher(signature, aspectType);
        }
+       
+       public ResolvedMember getDeclaredInterMethodDispatcher(UnresolvedType aspectType,World w) {
+               if (declaredSignature!=null) {
+                       ResolvedMember rm = declaredSignature.parameterizedWith(null,signature.getDeclaringType().resolve(w),false,getTypeVariableAliases());
+                       return AjcMemberMaker.interMethodDispatcher(rm, aspectType);
+               } else {
+                       return AjcMemberMaker.interMethodDispatcher(signature,aspectType);
+               }
+       }
 
        public void write(DataOutputStream s) throws IOException {
                kind.write(s);
@@ -85,7 +106,7 @@ public class NewMethodTypeMunger extends ResolvedTypeMunger {
                  parameterizedSignature = getSignature().parameterizedWith(target.getTypeParameters(),genericType,target.isParameterizedType(),typeVariableAliases);
                }
                NewMethodTypeMunger nmtm = new NewMethodTypeMunger(parameterizedSignature,getSuperMethodsCalled(),typeVariableAliases);
-               nmtm.setOriginalSignature(getSignature());
+               nmtm.setDeclaredSignature(getSignature());
                return nmtm;
        }
        
index 7717915f1d197457005ea6ed4635e521f3c65d66..67846d5f31a5911f55a416cb11d85659ad9b8c76 100644 (file)
@@ -40,16 +40,13 @@ public abstract class ResolvedTypeMunger {
        protected Kind kind;
        protected ResolvedMember signature;
        
-       protected ResolvedMember originalSignature;
+       /**
+        * The declared signature is filled in when a type munger is parameterized for application to
+        * a particular type.  It represents the signature originally declared in the source file.
+        */
+       protected ResolvedMember declaredSignature;
        
-       public void setOriginalSignature(ResolvedMember rm) {
-               originalSignature = rm;
-       }
        
-       public ResolvedMember getMostOriginalSignature() {
-               if (originalSignature==null) return signature;
-               return originalSignature;
-       }
        
        // This list records the occurences (in order) of any names specified in the <> 
        // for a target type for the ITD.  So for example, for List<C,B,A> this list
@@ -250,7 +247,7 @@ public abstract class ResolvedTypeMunger {
                 return Method.toString();
             } else {
                 return super.toString();
-            }
+       }
         }
     }
        
@@ -388,4 +385,12 @@ public abstract class ResolvedTypeMunger {
 //             ResolvedMember parameterizedSignature = getSignature().parameterizedWith(target.getTypeParameters(),genericType,target.isParameterizedType(),typeVariableAliases);
 //             return new NewFieldTypeMunger(parameterizedSignature,getSuperMethodsCalled(),typeVariableAliases);
 //     }
+       
+       public void setDeclaredSignature(ResolvedMember rm) {
+               declaredSignature = rm;
+       }
+       
+       public ResolvedMember getDeclaredSignature() {
+               return declaredSignature;
+       }
 }