boolean (@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiMethod method = (PsiMethod)startElement; if(!method.isPhysical()) return false; final PsiType newType = myReturnTypePointer.getType(); if (BaseIntentionAction.canModify(method) && newType != null && newType.isValid()) { final PsiType returnType = method.getReturnType(); if (returnType == null) return true; if (returnType.isValid() && !Comparing.equal(newType, returnType)) { if (!mySuggestSuperTypes && newType.getCanonicalText().equals(returnType.getCanonicalText())) return false; return PsiTypesUtil.allTypeParametersResolved(method, newType); } } return false; }