public static int methodDistance ( Method from , Method to ) { return from . getName ( ) . equals ( to . getName ( ) ) && to . getDeclaringClass ( ) . isAssignableFrom ( from . getDeclaringClass ( ) ) ? classDistance ( from . getDeclaringClass ( ) , to . getDeclaringClass ( ) ) : - 1 ; }
Calculates distance between from and to methods .