private PsiMethod createMethodToAdd() {
    ChangeContextUtil.encodeContextInfo(myMethod, true);
    try {
      //correct internal references
      final PsiCodeBlock body = myMethod.getBody();
      if (body != null) {
        replaceReferences(body);
      } else {
        if (myMethod.hasModifierProperty(PsiModifier.ABSTRACT) &&
            !myTargetClass.isInterface() && !myTargetClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
          CreateFromUsageUtils.setupMethodBody(myMethod);
        }
      }

      final PsiMethod methodCopy = getPatternMethod();

      final List<PsiParameter> newParameters = Arrays.asList(methodCopy.getParameterList().getParameters());
      CommonJavaRefactoringUtil.fixJavadocsForParams(methodCopy, new HashSet<>(newParameters));
      return methodCopy;
    }
    catch (IncorrectOperationException e) {
      LOG.error(e);
      return myMethod;
    }
  }
private PsiMethod createMethodToAdd()