From: aclement Date: Tue, 13 May 2008 19:54:27 +0000 (+0000) Subject: 231467: fix: allow for a type signature like [ITE; - it means int[],E and not just E ! X-Git-Tag: V1_6_1x~36 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a8739e3359b0da1fdb60e2201f8fe37265aa9d04;p=aspectj.git 231467: fix: allow for a type signature like [ITE; - it means int[],E and not just E ! --- diff --git a/weaver/src/org/aspectj/weaver/TypeFactory.java b/weaver/src/org/aspectj/weaver/TypeFactory.java index 699f07de7..9db8e3489 100644 --- a/weaver/src/org/aspectj/weaver/TypeFactory.java +++ b/weaver/src/org/aspectj/weaver/TypeFactory.java @@ -223,17 +223,30 @@ public class TypeFactory { while(!remainingToProcess.equals("")) { int endOfSig = 0; int anglies = 0; - boolean sigFound = false; + boolean sigFound = false; // OPTIMIZE can this be done better? for (endOfSig = 0; (endOfSig < remainingToProcess.length()) && !sigFound; endOfSig++) { char thisChar = remainingToProcess.charAt(endOfSig); switch(thisChar) { - case '<' : anglies++; break; - case '>' : anglies--; break; - case ';' : - if (anglies == 0) { - sigFound = true; + case '<' : anglies++; break; + case '>' : anglies--; break; + case '[' : + if (anglies == 0) { + // the next char might be a [ or a primitive type ref (BCDFIJSZ) + int nextChar = endOfSig+1; + while (remainingToProcess.charAt(nextChar)=='[') { nextChar++; } + if ("BCDFIJSZ".indexOf(remainingToProcess.charAt(nextChar))!=-1) { + // it is something like [I or [[S + sigFound = true; + endOfSig = nextChar; + break; + } + } break; - } + case ';' : + if (anglies == 0) { + sigFound = true; + break; + } } } types.add(createTypeFromSignature(remainingToProcess.substring(0,endOfSig)));