aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-04-09 22:51:08 +0000
committeraclement <aclement>2008-04-09 22:51:08 +0000
commitad96a03d9a1491121612dc6992d7a64e4943b712 (patch)
tree9c5af3f5d4bb07fe2b81b75336ea77565c11451c
parent3179a7d863cb647e063dab11cada2240e71a76ec (diff)
downloadaspectj-ad96a03d9a1491121612dc6992d7a64e4943b712.tar.gz
aspectj-ad96a03d9a1491121612dc6992d7a64e4943b712.zip
dont loop indefinetly (eg. Enum<E extends Enum<E>>)
-rw-r--r--weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
index 2075f84aa..1361e0697 100644
--- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
+++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
@@ -894,7 +894,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
StringBuffer sig = new StringBuffer();
UnresolvedType[] myParameterTypes = getGenericParameterTypes();
for (int i = 0; i < myParameterTypes.length; i++) {
- appendSigWithTypeVarBoundsRemoved(myParameterTypes[i], sig);
+ appendSigWithTypeVarBoundsRemoved(myParameterTypes[i], sig, new HashSet());
}
myParameterSignatureWithBoundsRemoved = sig.toString();
return myParameterSignatureWithBoundsRemoved;
@@ -918,16 +918,21 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
// does NOT produce a meaningful java signature, but does give a unique string suitable for
// comparison.
- private void appendSigWithTypeVarBoundsRemoved(UnresolvedType aType, StringBuffer toBuffer) {
+ public static void appendSigWithTypeVarBoundsRemoved(UnresolvedType aType, StringBuffer toBuffer, Set alreadyUsedTypeVars) {
if (aType.isTypeVariableReference()) {
// pr204505
- appendSigWithTypeVarBoundsRemoved(aType.getUpperBound(),toBuffer);
+ if (alreadyUsedTypeVars.contains(aType)) {
+ toBuffer.append("...");
+ } else {
+ alreadyUsedTypeVars.add(aType);
+ appendSigWithTypeVarBoundsRemoved(aType.getUpperBound(), toBuffer, alreadyUsedTypeVars);
+ }
// toBuffer.append("T;");
} else if (aType.isParameterizedType()) {
toBuffer.append(aType.getRawType().getSignature());
toBuffer.append("<");
for (int i = 0; i < aType.getTypeParameters().length; i++) {
- appendSigWithTypeVarBoundsRemoved(aType.getTypeParameters()[i], toBuffer);
+ appendSigWithTypeVarBoundsRemoved(aType.getTypeParameters()[i], toBuffer, alreadyUsedTypeVars);
}
toBuffer.append(">;");
} else {