@Override
  public void prepareForDeletion(@NotNull PsiElement element) throws IncorrectOperationException {
    if (element instanceof PsiVariable) {
      ((PsiVariable)element).normalizeDeclaration();
    }
    if (element instanceof PsiParameter && element.getParent() instanceof PsiParameterList parameterList) {
      PsiMethod method = ObjectUtils.tryCast(parameterList.getParent(), PsiMethod.class);
      if (method != null) {
        PsiAnnotation contract = method.getModifierList().findAnnotation(JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
        if (contract != null) {
          ParameterInfoImpl[] info = ParameterInfoImpl.fromMethodExceptParameter(method, (PsiParameter)element);
          try {
            String[] names = ContainerUtil.map(parameterList.getParameters(), PsiParameter::getName, ArrayUtilRt.EMPTY_STRING_ARRAY);
            PsiAnnotation newContract =
              ContractConverter.convertContract(method, names, info);
            if (newContract != null && newContract != contract) {
              contract.replace(newContract);
            }
          }
          catch (ContractConverter.ContractConversionException ignored) { }
        }
      }
    }
  }
@Override
  public void prepareForDeletion(@NotNull PsiElement element)