]> source.dussan.org Git - aspectj.git/commitdiff
ctor ITDs now remember tvar aliases (see 112105)
authoraclement <aclement>
Tue, 18 Oct 2005 14:15:25 +0000 (14:15 +0000)
committeraclement <aclement>
Tue, 18 Oct 2005 14:15:25 +0000 (14:15 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
weaver/src/org/aspectj/weaver/NewConstructorTypeMunger.java

index 80e77e262f110a8e84de60ad6142f08c4aea6a52..b70c2a2d5fb4a1058b2449b7dd84d8431fae2d71 100644 (file)
@@ -227,9 +227,9 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration {
                ResolvedType aspectType = world.fromEclipse(classScope.referenceContext.binding);
                
                
-
+               
                // This signature represents what we want consumers of the targetted type to 'see'
-               ResolvedMember signature = world.makeResolvedMember(binding,onTypeBinding);
+               ResolvedMember signature = world.makeResolvedMemberForITD(binding,onTypeBinding,interTypeScope.getRecoveryAliases());
                signature.resetKind(Member.CONSTRUCTOR);
                signature.resetName("<init>");
                int resetModifiers = declaredModifiers;
@@ -240,7 +240,7 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration {
                        AjcMemberMaker.interConstructor(declaringTypeX,  signature, aspectType);
                
                NewConstructorTypeMunger myMunger = 
-                       new NewConstructorTypeMunger(signature, syntheticInterMember, null, null);
+                       new NewConstructorTypeMunger(signature, syntheticInterMember, null, null,typeVariableAliases);
                setMunger(myMunger);
                myMunger.check(world.getWorld());
                
index cb2044e4b78e7c3b3aff831603c546b11e889e3b..f4eca2a492ec2828ea7fd0353876ce37e333fa84 100644 (file)
@@ -20,6 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclarati
 import org.aspectj.org.eclipse.jdt.internal.compiler.env.IConstants;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
 import org.aspectj.weaver.ConcreteTypeMunger;
 import org.aspectj.weaver.NewConstructorTypeMunger;
@@ -139,7 +140,7 @@ public class EclipseTypeMunger extends ConcreteTypeMunger {
        
        private void mungeNewConstructor(SourceTypeBinding sourceType, NewConstructorTypeMunger munger) {               
                if (shouldTreatAsPublic()) {
-                       MethodBinding binding = world.makeMethodBinding(munger.getSignature());
+                       MethodBinding binding = world.makeMethodBinding(munger.getSignature(),munger.getTypeVariableAliases());
                        findOrCreateInterTypeMemberFinder(sourceType).addInterTypeMethod(binding);
                        //classScope.referenceContext.binding.addMethod(binding);
                } else {
index 6acd4b7e721e3f2e97754778d80231a2d8db7d31..0f23fcf972513183e11a6fa9d75a7c9aef5e0219 100644 (file)
@@ -15,9 +15,11 @@ package org.aspectj.weaver;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.util.List;
 import java.util.Set;
 
 import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.ISourceLocation;
 
 public class NewConstructorTypeMunger extends ResolvedTypeMunger {
        private ResolvedMember syntheticConstructor;
@@ -28,10 +30,11 @@ public class NewConstructorTypeMunger extends ResolvedTypeMunger {
                ResolvedMember signature,
                ResolvedMember syntheticConstructor,
                ResolvedMember explicitConstructor,
-               Set superMethodsCalled)
-       {
+               Set superMethodsCalled,
+               List typeVariableAliases) {
                super(Constructor, signature);
                this.syntheticConstructor = syntheticConstructor;
+               this.typeVariableAliases = typeVariableAliases;
                this.explicitConstructor = explicitConstructor;
                this.setSuperMethodsCalled(superMethodsCalled);
 
@@ -49,15 +52,19 @@ public class NewConstructorTypeMunger extends ResolvedTypeMunger {
                explicitConstructor.write(s);
                writeSuperMethodsCalled(s);
                writeSourceLocation(s);
+               writeOutTypeAliases(s);
        }
        
        public static ResolvedTypeMunger readConstructor(VersionedDataInputStream s, ISourceContext context) throws IOException {
-               ResolvedTypeMunger munger = new NewConstructorTypeMunger(
-                               ResolvedMemberImpl.readResolvedMember(s, context),
-                               ResolvedMemberImpl.readResolvedMember(s, context),
-                               ResolvedMemberImpl.readResolvedMember(s, context),
-                               readSuperMethodsCalled(s));
-               munger.setSourceLocation(readSourceLocation(s));
+               ISourceLocation sloc = null;
+               ResolvedMember sig           = ResolvedMemberImpl.readResolvedMember(s, context);
+               ResolvedMember syntheticCtor = ResolvedMemberImpl.readResolvedMember(s, context);
+               ResolvedMember explicitCtor  = ResolvedMemberImpl.readResolvedMember(s, context);
+               Set superMethodsCalled       = readSuperMethodsCalled(s);
+               sloc                         = readSourceLocation(s);
+               List typeVarAliases          = readInTypeAliases(s);
+               ResolvedTypeMunger munger = new NewConstructorTypeMunger(sig,syntheticCtor,explicitCtor,superMethodsCalled,typeVarAliases);
+               if (sloc!=null) munger.setSourceLocation(sloc);
                return munger;
        }