diff options
Diffstat (limited to 'bcel-builder')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java index 230a055c1..4ad1b9a1b 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java @@ -301,6 +301,8 @@ public class GenericSignatureParser { int index = 0; List tokens = new ArrayList(); StringBuffer identifier = new StringBuffer(); + boolean inParens = false; + boolean couldSeePrimitive = false; do { switch (chars[index]) { case '<' : @@ -322,11 +324,13 @@ public class GenericSignatureParser { if (identifier.length() > 0) tokens.add(identifier.toString()); identifier = new StringBuffer(); tokens.add("/"); + couldSeePrimitive = false; break; case ';' : if (identifier.length() > 0) tokens.add(identifier.toString()); identifier = new StringBuffer(); tokens.add(";"); + couldSeePrimitive = true; break; case '^': if (identifier.length() > 0) tokens.add(identifier.toString()); @@ -349,13 +353,31 @@ public class GenericSignatureParser { break; case '(' : tokens.add("("); + inParens = true; + couldSeePrimitive = true; break; case ')' : tokens.add(")"); + inParens = false; break; case '[' : tokens.add("["); break; + case 'B' : + case 'C' : + case 'D' : + case 'F' : + case 'I' : + case 'J' : + case 'S' : + case 'V' : + case 'Z' : + if (inParens && couldSeePrimitive && identifier.length() == 0) { + tokens.add(new String("" + chars[index])); + } else { + identifier.append(chars[index]); + } + break; default : identifier.append(chars[index]); } |