return getTypeName(signature.substring(1)) + "[]";
}
+ // If it does not contain '<' and '>' then it is
+ // a Type signature, e.g., T, U, etc.
+ if (Types.isParameterWithType(signature)) {
+ // Clean the ';' character first and return the Type
+ return Types.getTypeParameter(signature.replace(";", ""));
+ }
+
int len1 = len-1;
if (signature.charAt(len1) == ';') {
// TODO: Fix for Groovy's model-checking
return 1 + getTypeLength(signature, idx + 1);
case 'L':
-
+ default:
int semicolon = signature.indexOf(';', idx);
// TODO: Fix for Groovy's model-checking
// Check if this is a generic!
return semicolon - idx + 1;
}
- throw new JPFException("invalid type signature");
+ //throw new JPFException("invalid type signature");
}
/**
public static boolean isTypeParameter(String parameterizedType, String signature) {
if (signature == null || signature.equals(""))
return false;
+ // The comparison has to be done without the "[]" part if it is an array
+ if (Types.isArraySignature(parameterizedType)) {
+ parameterizedType = Types.getArrayClassName(parameterizedType);
+ }
String typeParamSig = parameterizedType.concat(":");
return signature.contains(typeParamSig);
}
return signature.replaceAll("\\+L|-L", "");
}
+ public static boolean isParameterWithType(String signature) {
+ // Does not contain a class name
+ if (!signature.contains(".") && !signature.contains("/")) {
+ return true;
+ }
+ return false;
+ }
+
public static String getTypeParameter(String signature) {
if (signature == null || signature.equals(""))
return signature;