throw new JPFException("invalid method declaration: " + methodDecl);
}
+
+ public static String[] getGenericTypeVariableNames(String signature) {
+ int pos = 0;
+ int opening = 0;
+ ArrayList<String> typeVarNames = new ArrayList<>();
+
+ while (pos < signature.length()) {
+ if (pos > 0) {
+ // Start from ';' if this is not the first type variable name
+ opening = signature.indexOf(';', pos);
+ // Break if this is the end of the type variable names
+ if (signature.charAt(opening + 1) == '>')
+ break;
+ }
+ int colon = signature.indexOf(':', pos);
+ String typeVarName = signature.substring(opening + 1, colon);
+ typeVarNames.add(typeVarName);
+ pos = colon + 1;
+ }
+
+ String[] arrTypeVarNames = new String[typeVarNames.size()];
+ typeVarNames.toArray(arrTypeVarNames);
+
+ return arrTypeVarNames;
+ }
}