]> source.dussan.org Git - aspectj.git/commitdiff
see pr112105 comment #13: more helpers, for itd support.
authoraclement <aclement>
Wed, 26 Oct 2005 16:51:51 +0000 (16:51 +0000)
committeraclement <aclement>
Wed, 26 Oct 2005 16:51:51 +0000 (16:51 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java

index ba7926a864f80825e5ef7e8811eb4155c09732fb..48713779d53a765584014f2a5fa3484c76786e01 100644 (file)
@@ -714,6 +714,15 @@ public class EclipseFactory {
                return internalMakeMethodBinding(member,aliases);
        }
        
+       /**
+     * Creates a method binding for a resolvedmember taking into account type variable aliases -
+     * this variant can take an aliasTargetType and should be used when the alias target type
+     * cannot be retrieved from the resolvedmember.
+     */
+       public MethodBinding makeMethodBinding(ResolvedMember member,List aliases,UnresolvedType aliasTargetType) {
+               return internalMakeMethodBinding(member,aliases,aliasTargetType);
+       }
+       
        /**
         * Convert a resolvedmember into an eclipse method binding.
         */
@@ -721,6 +730,10 @@ public class EclipseFactory {
                return internalMakeMethodBinding(member,null); // there are no aliases
        }
        
+       public MethodBinding internalMakeMethodBinding(ResolvedMember member,List aliases) {
+               return internalMakeMethodBinding(member,aliases,member.getDeclaringType());
+       }
+       
        /**
         * Take a normal AJ member and convert it into an eclipse methodBinding.
         * Taking into account any aliases that it may include due to being a 
@@ -728,7 +741,7 @@ public class EclipseFactory {
         * map so that they will be substituted as appropriate in the returned 
         * methodbinding
         */
-       public MethodBinding internalMakeMethodBinding(ResolvedMember member,List aliases) {
+       public MethodBinding internalMakeMethodBinding(ResolvedMember member,List aliases,UnresolvedType aliasTargetType) {
                typeVariableToTypeBinding.clear();
                TypeVariableBinding[] tvbs = null;
 
@@ -746,9 +759,10 @@ public class EclipseFactory {
                // If there are aliases, place them in the map
                if (aliases!=null && aliases.size()!=0) {
                        int i=0;
+                       ReferenceBinding aliasTarget = (ReferenceBinding)makeTypeBinding(aliasTargetType);
                        for (Iterator iter = aliases.iterator(); iter.hasNext();) {
                                String element = (String) iter.next();
-                               typeVariableToTypeBinding.put(element,declaringType.typeVariables()[i++]);
+                               typeVariableToTypeBinding.put(element,aliasTarget.typeVariables()[i++]);
                        }
                }