public static void makeMethodAbstract(@NotNull PsiClass targetClass, @NotNull PsiMethod method) throws IncorrectOperationException {
    if (!method.hasModifierProperty(PsiModifier.DEFAULT)) {
      PsiCodeBlock body = method.getBody();
      if (body != null) {
        body.delete();
      }

      if (!targetClass.isInterface()) {
        PsiUtil.setModifierProperty(method, PsiModifier.ABSTRACT, true);
      }
    }

    if (!targetClass.isInterface()) {
      if (!targetClass.isEnum()) {
        PsiUtil.setModifierProperty(targetClass, PsiModifier.ABSTRACT, true);
      }
      prepareForAbstract(method);
    }
    else {
      prepareForInterface(method);
    }
  }
public static void makeMethodAbstract(@NotNull PsiClass targetClass, @NotNull PsiMethod method)