diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-04-16 15:03:37 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-04-16 15:03:37 -0700 |
commit | 503bc62a4441ca925873b92a6d27170673461ebf (patch) | |
tree | c5fea6d54a102449e925f9f84783aff9bff8c107 /org.aspectj.matcher/src | |
parent | 463c5f1d3eab245424929395fc7239fdc04e1eaa (diff) | |
download | aspectj-503bc62a4441ca925873b92a6d27170673461ebf.tar.gz aspectj-503bc62a4441ca925873b92a6d27170673461ebf.zip |
376918
Diffstat (limited to 'org.aspectj.matcher/src')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java index 6101f6536..14d00e5b1 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java @@ -710,11 +710,17 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { private static String nameToSignature(String name) { int len = name.length(); if (len < 8) { - if (name.equals("byte")) { - return "B"; + if (name.equals("int")) { + return "I"; } - if (name.equals("char")) { - return "C"; + if (name.equals("void")) { + return "V"; + } + if (name.equals("long")) { + return "J"; + } + if (name.equals("boolean")) { + return "Z"; } if (name.equals("double")) { return "D"; @@ -722,32 +728,31 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { if (name.equals("float")) { return "F"; } - if (name.equals("int")) { - return "I"; - } - if (name.equals("long")) { - return "J"; + if (name.equals("byte")) { + return "B"; } if (name.equals("short")) { return "S"; } - if (name.equals("boolean")) { - return "Z"; - } - if (name.equals("void")) { - return "V"; + if (name.equals("char")) { + return "C"; } if (name.equals("?")) { return name; } } + if (len == 0) { + throw new BCException("Bad type name: " + name); + } if (name.endsWith("[]")) { return "[" + nameToSignature(name.substring(0, name.length() - 2)); } - if (len == 0) { - throw new BCException("Bad type name: " + name); + + // Sometimes the 'name' for an array is of the form: [Ljava.lang.String; + if (name.charAt(0)=='[') { + return name.replace('.','/'); } - + if (name.indexOf("<") == -1) { // not parameterized return new StringBuilder("L").append(name.replace('.', '/')).append(';').toString(); |