summaryrefslogtreecommitdiffstats
path: root/weaver/src/org
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-26 11:43:32 +0000
committeracolyer <acolyer>2005-08-26 11:43:32 +0000
commit27e68f3b3ae82408e8e046a40ab69d9e4996ff5a (patch)
tree483b14300087f4fd886561dd8d6a9329d098ae8f /weaver/src/org
parentd9132dc6a4ca244a4404d7a7f4e19d9983309962 (diff)
downloadaspectj-27e68f3b3ae82408e8e046a40ab69d9e4996ff5a.tar.gz
aspectj-27e68f3b3ae82408e8e046a40ab69d9e4996ff5a.zip
tests for pr108050, signature matching in multiple override scenarioV1_5_0M3a
Diffstat (limited to 'weaver/src/org')
-rw-r--r--weaver/src/org/aspectj/weaver/JoinPointSignature.java11
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java6
2 files changed, 14 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/JoinPointSignature.java b/weaver/src/org/aspectj/weaver/JoinPointSignature.java
index d4276f9a6..97384c45f 100644
--- a/weaver/src/org/aspectj/weaver/JoinPointSignature.java
+++ b/weaver/src/org/aspectj/weaver/JoinPointSignature.java
@@ -371,4 +371,15 @@ public class JoinPointSignature implements ResolvedMember {
realMember.resetReturnTypeToObjectArray();
}
+ public boolean equals(Object obj) {
+ if (! (obj instanceof JoinPointSignature)) return false;
+ JoinPointSignature other = (JoinPointSignature) obj;
+ if (!realMember.equals(other.realMember)) return false;
+ if (!substituteDeclaringType.equals(other.substituteDeclaringType)) return false;
+ return true;
+ }
+
+ public int hashCode() {
+ return 17 + (37 * realMember.hashCode()) + (37 * substituteDeclaringType.hashCode());
+ }
}
diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
index e9dfa18ad..d94d3db12 100644
--- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
+++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
@@ -151,7 +151,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
accumulateTypesInBetween(originalDeclaringType,
firstDefiningType,
declaringTypes);
- List memberSignatures = new ArrayList();
+ Set memberSignatures = new HashSet();
for (Iterator iter = declaringTypes.iterator(); iter.hasNext();) {
ResolvedType declaringType = (ResolvedType) iter.next();
ResolvedMember member = firstDefiningMember.withSubstituteDeclaringType(declaringType);
@@ -204,7 +204,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
ResolvedMemberImpl memberToMatch,
Iterator typesToLookIn,
List typesAlreadyVisited,
- List foundMembers) {
+ Set foundMembers) {
while(typesToLookIn.hasNext()) {
ResolvedType toLookIn = (ResolvedType) typesToLookIn.next();
if (!typesAlreadyVisited.contains(toLookIn)) {
@@ -217,7 +217,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
accumulateTypesInBetween(toLookIn, resolvedDeclaringType, declaringTypes);
for (Iterator iter = declaringTypes.iterator(); iter.hasNext();) {
ResolvedType declaringType = (ResolvedType) iter.next();
- typesAlreadyVisited.add(declaringType);
+// typesAlreadyVisited.add(declaringType);
ResolvedMember member = foundMember.withSubstituteDeclaringType(declaringType);
foundMembers.add(member);
}