int index;
Type[] types;
try { // Read all declarations between for `(' and `)'
if (signature.charAt(0) != '(')
throw new ClassFormatException("Invalid method signature: " + signature);
index = 1; // current string position
while(signature.charAt(index) != ')') {
TypeHolder th = getTypeInternal(signature.substring(index));
vec.add(th.getType());
index += th.getConsumed(); // update position
}
} catch(StringIndexOutOfBoundsException e) { // Should never occur
throw new ClassFormatException("Invalid method signature: " + signature);
}
types = new Type[vec.size()];
vec.toArray(types);
return types;