public boolean referencesMethod ( ExecutableElement method ) { TypeElement declaringClass = ( TypeElement ) method . getEnclosingElement ( ) ; String fullyQualifiedname = declaringClass . getQualifiedName ( ) . toString ( ) ; String name = method . getSimpleName ( ) . toString ( ) ; assert name . indexOf ( ' ' ) == - 1 ; String descriptor = Descriptor . getDesriptor ( method ) ; return getRefIndex ( Methodref . class , fullyQualifiedname , name , descriptor ) != - 1 ; }
Return true if class contains method ref to given method