Replacing getMethodParamSignature with the below (it's a drop-in backwards-compatible replacement) means that most parameter names are recovered (rather than being param0, param1 etc).
I'd do a pull request if I knew how :)
private String getMethodParamSignature(JavaClass clazz, TypeDefinition typeDefinition, Method m) {
LocalVariableTable table = m.getLocalVariableTable();
StringBuilder sb = new StringBuilder();
sb.append("(");
int idx = 0;
for (Type type : this.getArgumentTypes(m)) {
if (idx > 0) {
sb.append(", ");
}
int localVarIndex;
if (!m.isStatic()) {
localVarIndex = idx + 1;
} else {
localVarIndex = idx;
}
if (table != null && table.getLocalVariable(localVarIndex, 0) != null) {
sb.append(table.getLocalVariable(localVarIndex, 0).getName());
} else {
sb.append("param");
sb.append(idx);
}
idx+=1;
sb.append(": ");
String paramTypeName = getTypeScriptTypeFromJavaType(type, typeDefinition);
// TODO: Pete:
if (paramTypeName.startsWith("java.util.function")) {
sb.append("any /* " + paramTypeName + "*/");
} else {
addReference(type);
sb.append(paramTypeName);
}
}
sb.append(")");
String sig = sb.toString();
return sig;
}
Replacing getMethodParamSignature with the below (it's a drop-in backwards-compatible replacement) means that most parameter names are recovered (rather than being param0, param1 etc).
I'd do a pull request if I knew how :)