private static String getSignature(Method method) {
        StringBuffer b = new StringBuffer("(");
        Class[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; ++i)
            b.append(getSignature(parameterTypes[i]));

        b.append(')').append(getSignature(method.getReturnType()));

        return b.toString();
    }
private static String getSignature(Method method) {
        StringBuffer b = new StringBuffer("(");
        Class[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; ++i)
            b.append(getSignature(parameterTypes[i]));

        b.append(')').append(getSignature(method.getReturnType()));

        return b.toString();
    }
private static String getSignature ( Method method ) { StringBuffer b = new StringBuffer ( "(" ) ; Class [ ] parameterTypes = method . getParameterTypes ( ) ; for ( int i = 0 ; i < parameterTypes . length ; ++ i ) b . append ( getSignature ( parameterTypes [ i ] ) ) ; b . append ( ' ' ) . append ( getSignature ( method . getReturnType ( ) ) ) ; return b . toString ( ) ; }
Calculate the signature of a method, according to the Java VM
specification, section 4.3.3.
Calculate the signature of a method according to the Java VM specification section 4 . 3 . 3 .