diff options
author | acolyer <acolyer> | 2005-08-09 12:59:26 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-09 12:59:26 +0000 |
commit | 8643e44d95867da295b83368bd305705247c57e0 (patch) | |
tree | 6f1e7dcd7a176e3f10b9e251c976b5a15c339aa3 /weaver | |
parent | 5b169a89bf518b4af16311dc4f95b71fbb4688f1 (diff) | |
download | aspectj-8643e44d95867da295b83368bd305705247c57e0.tar.gz aspectj-8643e44d95867da295b83368bd305705247c57e0.zip |
added getSimpleName which looks better when used in error and warning messages
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/UnresolvedType.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/UnresolvedType.java b/weaver/src/org/aspectj/weaver/UnresolvedType.java index 5efa8c423..aa657244c 100644 --- a/weaver/src/org/aspectj/weaver/UnresolvedType.java +++ b/weaver/src/org/aspectj/weaver/UnresolvedType.java @@ -463,6 +463,26 @@ public class UnresolvedType implements TypeVariableDeclaringElement { return signatureToName(signature); } + public String getSimpleName() { + String name = getRawName(); + int lastDot = name.lastIndexOf('.'); + if (lastDot != -1) { + name = name.substring(lastDot+1); + } + if (isParameterizedType()) { + StringBuffer sb = new StringBuffer(name); + sb.append("<"); + for (int i = 0; i < (typeParameters.length -1); i++) { + sb.append(typeParameters[i].getSimpleName()); + sb.append(","); + } + sb.append(typeParameters[typeParameters.length -1].getSimpleName()); + sb.append(">"); + name = sb.toString(); + } + return name; + } + public String getRawName() { return signatureToName((signatureErasure==null?signature:signatureErasure)); } @@ -476,6 +496,15 @@ public class UnresolvedType implements TypeVariableDeclaringElement { return name; } } + + public String getSimpleBaseName() { + String name = getBaseName(); + int lastDot = name.lastIndexOf('.'); + if (lastDot != -1) { + name = name.substring(lastDot+1); + } + return name; + } /** * Returns an array of strings representing the java langauge names of |