@ SuppressWarnings ( "unchecked" ) public static String computeSignature ( Method m ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( m . getName ( ) ) . append ( ' ' ) ; Class [ ] parameterTypes = m . getParameterTypes ( ) ; for ( int i = 0 ; i < parameterTypes . length ; i ++ ) { if ( i > 0 ) sb . append ( ' ' ) ; Class parameterType = parameterTypes [ i ] ; sb . append ( parameterType . getName ( ) ) ; } sb . append ( ' ' ) ; return sb . toString ( ) ; }
Computes the signature of a method . Note that if 2 methods are declared in different classes or interfaces then I1 . m and I2 . m are different but they can still have the same signature ...