summaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
diff options
context:
space:
mode:
authoraclement <aclement>2009-11-02 17:59:47 +0000
committeraclement <aclement>2009-11-02 17:59:47 +0000
commitf2b05dfae18ecb754c4cb963bfef2e54ef5bafe9 (patch)
tree45c92678400b6478cafbce0e98b1ccd49ab4e093 /org.aspectj.matcher
parente4f92ac7658ea33bfb9da884c78796b84740a8b1 (diff)
downloadaspectj-f2b05dfae18ecb754c4cb963bfef2e54ef5bafe9.tar.gz
aspectj-f2b05dfae18ecb754c4cb963bfef2e54ef5bafe9.zip
generics
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r--org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java25
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;