From: aclement Date: Tue, 18 Oct 2005 14:15:25 +0000 (+0000) Subject: ctor ITDs now remember tvar aliases (see 112105) X-Git-Tag: V1_5_0RC1~357 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f303867ebd5f697256407e8586f688ff8f979353;p=aspectj.git ctor ITDs now remember tvar aliases (see 112105) --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java index 80e77e262..b70c2a2d5 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java @@ -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(""); 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()); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java index cb2044e4b..f4eca2a49 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java @@ -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 { diff --git a/weaver/src/org/aspectj/weaver/NewConstructorTypeMunger.java b/weaver/src/org/aspectj/weaver/NewConstructorTypeMunger.java index 6acd4b7e7..0f23fcf97 100644 --- a/weaver/src/org/aspectj/weaver/NewConstructorTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/NewConstructorTypeMunger.java @@ -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; }