summaryrefslogtreecommitdiffstats
path: root/bcel-builder
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-07-08 15:59:24 +0000
committeracolyer <acolyer>2005-07-08 15:59:24 +0000
commitea6af95245d692048e0cc3aa10d6bdbdd931121c (patch)
treef41bfd8bdb8c7a792907bd800b8cbbd5ad41dd20 /bcel-builder
parent908baa7d7e4e0b879dc7893d0e03e56ff0e659b7 (diff)
downloadaspectj-ea6af95245d692048e0cc3aa10d6bdbdd931121c.tar.gz
aspectj-ea6af95245d692048e0cc3aa10d6bdbdd931121c.zip
fix in GenericSigParser when tokenising primitives
Diffstat (limited to 'bcel-builder')
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/GenericSignatureParser.java22
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]);
}