return args;
}
+ // TODO: Fix for Groovy's model-checking
+ // TODO: We return the generic type name whenever possible (the one between '<' and '>')
+ // TODO: To do this we fixed the implementation of getTypeLength
public static String[] getArgumentTypeNames (String signature) {
int len = signature.length();
return typeNames;
}
-
+
public static String dequalify (String typeName){
int idx = typeName.lastIndexOf('.');
if (idx > 0) {
int i = signature.indexOf(')');
return getTypeName(signature.substring(i+1));
}
+
+ public static String getGenericReturnTypeName (String signature){
+ int i = signature.indexOf(')');
+ return getTypeName(signature.substring(i+1));
+ }
public static String getTypeSignature (String type, boolean asDotNotation) {
String t = null;
int len1 = len-1;
if (signature.charAt(len1) == ';') {
- return signature.substring(1, len1).replace('/', '.');
+ // TODO: Fix for Groovy's model-checking
+ // TODO: Cleaning up the generic type part inside '<' and '>'
+ return signature.substring(1, len1).replace('/', '.').
+ replaceAll(";L", ", ").
+ replace("<L","<").
+ replace(";>", ">");
}
+
+
throw new JPFException("invalid type string: " + signature);
}
case 'L':
int semicolon = signature.indexOf(';', idx);
+ // TODO: Fix for Groovy's model-checking
+ // Check if this is a generic!
+ if (signature.substring(idx,semicolon).indexOf('<') != -1) {
+ int generic = signature.indexOf('>', semicolon);
+ if (generic != -1) {
+ // Advance one character past the ';'
+ semicolon = generic + 1;
+ }
+ }
if (semicolon == -1) {
throw new JPFException("invalid type signature: " +