diff options
author | acolyer <acolyer> | 2005-08-09 12:56:54 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-09 12:56:54 +0000 |
commit | 24873e8cc3ea7ea2564f53775a4fab61dea6a2c3 (patch) | |
tree | 9e19fdacd23bb142ef99c99bbb03d44e182c2886 | |
parent | 1bae1c807ca847b71d9a0274d41309586707766e (diff) | |
download | aspectj-24873e8cc3ea7ea2564f53775a4fab61dea6a2c3.tar.gz aspectj-24873e8cc3ea7ea2564f53775a4fab61dea6a2c3.zip |
added toGenericString
4 files changed, 30 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/JoinPointSignature.java b/weaver/src/org/aspectj/weaver/JoinPointSignature.java index 9fefcdf23..ecfde649e 100644 --- a/weaver/src/org/aspectj/weaver/JoinPointSignature.java +++ b/weaver/src/org/aspectj/weaver/JoinPointSignature.java @@ -351,6 +351,10 @@ public class JoinPointSignature implements ResolvedMember { } return buf.toString(); } + + public String toGenericString() { + return realMember.toGenericString(); + } public void resetName(String newName) { realMember.resetName(newName); diff --git a/weaver/src/org/aspectj/weaver/MemberImpl.java b/weaver/src/org/aspectj/weaver/MemberImpl.java index 96a4478b2..c1eae3b62 100644 --- a/weaver/src/org/aspectj/weaver/MemberImpl.java +++ b/weaver/src/org/aspectj/weaver/MemberImpl.java @@ -424,6 +424,7 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member { return buf.toString(); } + /* (non-Javadoc) * @see org.aspectj.weaver.Member#toLongString() */ diff --git a/weaver/src/org/aspectj/weaver/ResolvedMember.java b/weaver/src/org/aspectj/weaver/ResolvedMember.java index 17b1e2930..fd6e5b020 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedMember.java +++ b/weaver/src/org/aspectj/weaver/ResolvedMember.java @@ -91,6 +91,9 @@ public interface ResolvedMember extends Member, AnnotatedElement, TypeVariableDe public void setAnnotatedElsewhere(boolean b); public boolean isAnnotatedElsewhere(); + + // like toString but include generic signature info + public String toGenericString(); /** * Get the UnresolvedType for the return type, taking generic signature into account diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java index 91cee14a6..521076638 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -701,5 +701,27 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno toBuffer.append(aType.getSignature()); } } + + public String toGenericString() { + StringBuffer buf = new StringBuffer(); + buf.append(getGenericReturnType().getSimpleName()); + buf.append(' '); + buf.append(declaringType.getName()); + buf.append('.'); + buf.append(name); + if (kind != FIELD) { + buf.append("("); + UnresolvedType[] params = getGenericParameterTypes(); + if (params.length != 0) { + buf.append(params[0].getSimpleName()); + for (int i=1, len = params.length; i < len; i++) { + buf.append(", "); + buf.append(params[i].getSimpleName()); + } + } + buf.append(")"); + } + return buf.toString(); + } } |