Here you can find the source of getMethodName(Method method, Class>[] parameterClasses, String rightCode)
public static String getMethodName(Method method, Class<?>[] parameterClasses, String rightCode)
//package com.java2s; //License from project: Apache License import java.lang.reflect.*; public class Main { public static String getMethodName(Method method, Class<?>[] parameterClasses, String rightCode) { if (method.getParameterTypes().length > parameterClasses.length) { Class<?>[] types = method.getParameterTypes(); StringBuilder buf = new StringBuilder(rightCode); for (int i = parameterClasses.length; i < types.length; i++) { if (buf.length() > 0) { buf.append(","); }//from w w w. ja v a2 s .c om Class<?> type = types[i]; String def; if (type == boolean.class) { def = "false"; } else if (type == char.class) { def = "\'\\0\'"; } else if (type == byte.class || type == short.class || type == int.class || type == long.class || type == float.class || type == double.class) { def = "0"; } else { def = "null"; } buf.append(def); } } return method.getName() + "(" + rightCode + ")"; } }