TypeMirror candidateType = typeUtils.erasure(t.asType()); if (typeUtils.isAssignable(candidateType, methodContainerType)) { ExecutableElement tMethod = methodInType(t, method); if (tMethod != null) { return tMethod;
/** * Returns the given method as it appears in the given type. This is the method itself, * or the nearest override in a superclass of the given type, or null if the method is not * found in the given type or any of its superclasses. */ ExecutableElement methodFromSuperclasses(TypeElement in, ExecutableElement method) { for (TypeElement t = in; t != null; t = superclass(t)) { ExecutableElement tMethod = methodInType(t, method); if (tMethod != null) { return tMethod; } } return null; }