diff options
author | aclement <aclement> | 2009-11-02 17:59:47 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-11-02 17:59:47 +0000 |
commit | f2b05dfae18ecb754c4cb963bfef2e54ef5bafe9 (patch) | |
tree | 45c92678400b6478cafbce0e98b1ccd49ab4e093 /org.aspectj.matcher | |
parent | e4f92ac7658ea33bfb9da884c78796b84740a8b1 (diff) | |
download | aspectj-f2b05dfae18ecb754c4cb963bfef2e54ef5bafe9.tar.gz aspectj-f2b05dfae18ecb754c4cb963bfef2e54ef5bafe9.zip |
generics
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java index 0c62fa7f2..9120ab045 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -127,8 +127,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno accumulateTypesInBetween(originalDeclaringType, firstDefiningType, declaringTypes); Set<ResolvedMember> memberSignatures = new HashSet<ResolvedMember>(); for (ResolvedType declaringType : declaringTypes) { - ResolvedMember member = firstDefiningMember.withSubstituteDeclaringType(declaringType); - memberSignatures.add(member); + memberSignatures.add(new JoinPointSignature(firstDefiningMember, declaringType)); } if (shouldWalkUpHierarchyFor(firstDefiningMember)) { @@ -137,7 +136,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno // every type between the firstDefiningMember and the root defining // member. Iterator<ResolvedType> superTypeIterator = firstDefiningType.getDirectSupertypes(); - List typesAlreadyVisited = new ArrayList(); + List<ResolvedType> typesAlreadyVisited = new ArrayList<ResolvedType>(); accumulateMembersMatching(firstDefiningMember, superTypeIterator, typesAlreadyVisited, memberSignatures, false); } @@ -196,8 +195,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno accumulateTypesInBetween(toLookIn, resolvedDeclaringType, declaringTypes); for (ResolvedType declaringType : declaringTypes) { // typesAlreadyVisited.add(declaringType); - ResolvedMember member = foundMember.withSubstituteDeclaringType(declaringType); - foundMembers.add(member); + foundMembers.add(new JoinPointSignature(foundMember, declaringType)); } if (!ignoreGenerics && toLookIn.isParameterizedType() && (foundMember.backingGenericMember != null)) { foundMembers.add(new JoinPointSignature(foundMember.backingGenericMember, foundMember.declaringType @@ -920,30 +918,17 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno } /** - * Returns a copy of this member but with the declaring type swapped. Copy only needs to be shallow. - * - * @param newDeclaringType - */ - public JoinPointSignature withSubstituteDeclaringType(ResolvedType newDeclaringType) { - JoinPointSignature ret = new JoinPointSignature(this, newDeclaringType); - return ret; - } - - /** * Returns true if this member matches the other. The matching takes into account name and parameter types only. When comparing * parameter types, we allow any type variable to match any other type variable regardless of bounds. */ public boolean matches(ResolvedMember aCandidateMatch, boolean ignoreGenerics) { - // if (this.getName().equals("get")) { - // System.out.println("In RMI.matches() this=" + this + " candidate=" + aCandidateMatch); - // } ResolvedMemberImpl candidateMatchImpl = (ResolvedMemberImpl) aCandidateMatch; if (!getName().equals(aCandidateMatch.getName())) { return false; } - UnresolvedType[] myParameterTypes = getGenericParameterTypes(); + UnresolvedType[] parameterTypes = getGenericParameterTypes(); UnresolvedType[] candidateParameterTypes = aCandidateMatch.getGenericParameterTypes(); - if (myParameterTypes.length != candidateParameterTypes.length) { + if (parameterTypes.length != candidateParameterTypes.length) { return false; } boolean b = false; |