private ParameterInfoImpl @Nullable [] getNewParametersInfo(PsiExpression[] expressions,
                                                              PsiMethod targetMethod,
                                                              PsiSubstitutor substitutor,
                                                              final @NonNls StringBuilder buf,
                                                              final HashSet<? super ParameterInfoImpl> newParams,
                                                              final HashSet<? super ParameterInfoImpl> removedParams,
                                                              final HashSet<? super ParameterInfoImpl> changedParams) {
    PsiParameter[] parameters = targetMethod.getParameterList().getParameters();
    List<ParameterInfoImpl> result = new ArrayList<>();
    if (expressions.length < parameters.length) {
      // find which parameters to remove
      int ei = 0;
      int pi = 0;

      while (ei < expressions.length && pi < parameters.length) {
        PsiExpression expression = expressions[ei];
        PsiParameter parameter = parameters[pi];
        PsiType bareParameterType = getValidParameterType(parameter, targetMethod);
        PsiType paramType = substitutor.substitute(bareParameterType);
        if (!buf.isEmpty()) buf.append(", ");
        final PsiType parameterType = PsiUtil.convertAnonymousToBaseType(paramType);
        final String presentableText = escapePresentableType(parameterType);
        final ParameterInfoImpl parameterInfo = ParameterInfoImpl.create(pi).withName(parameter.getName()).withType(bareParameterType);
        if (TypeConversionUtil.areTypesAssignmentCompatible(paramType, expression)) {
          buf.append(presentableText);
          result.add(parameterInfo);
          pi++;
          ei++;
        }
        else {
          buf.append("<s>").append(presentableText).append("</s>");
          removedParams.add(parameterInfo);
          pi++;
        }
      }
      if (result.size() != expressions.length) return null;
      for(int i = pi; i < parameters.length; i++) {
        if (!buf.isEmpty()) buf.append(", ");
        PsiType paramType = getValidParameterType(parameters[i], targetMethod);
        buf.append("<s>").append(escapePresentableType(paramType)).append("</s>");
        final ParameterInfoImpl parameterInfo = ParameterInfoImpl.create(pi)
          .withName(parameters[i].getName())
          .withType(paramType);
        removedParams.add(parameterInfo);
      }
    }
    else if (expressions.length > parameters.length) {
      if (!findNewParamsPlace(expressions, targetMethod, substitutor, buf, newParams, parameters, result)) return null;
    }
    else {
      //parameter type changed
      for (int i = 0; i < parameters.length; i++) {
        if (!buf.isEmpty()) buf.append(", ");
        PsiParameter parameter = parameters[i];
        PsiExpression expression = expressions[i];
        PsiType bareParamType = getValidParameterType(parameter, targetMethod);
        PsiType paramType = substitutor.substitute(bareParamType);
        PsiUtil.ensureValidType(paramType);
        final String presentableText = escapePresentableType(paramType);
        if (TypeConversionUtil.areTypesAssignmentCompatible(paramType, expression)) {
          result.add(ParameterInfoImpl.create(i).withName(parameter.getName()).withType(paramType));
          buf.append(presentableText);
        }
        else {
          if (PsiPolyExpressionUtil.isPolyExpression(expression)) return null;
          PsiType exprType = CommonJavaRefactoringUtil.getTypeByExpression(expression);
          if (exprType == null || PsiTypes.voidType().equals(exprType)) return null;
          if (exprType instanceof PsiDisjunctionType) {
            exprType = ((PsiDisjunctionType)exprType).getLeastUpperBound();
          }
          if (!PsiTypesUtil.allTypeParametersResolved(myTargetMethod, exprType)) return null;
          final ParameterInfoImpl changedParameterInfo = ParameterInfoImpl.create(i).withName(parameter.getName()).withType(exprType);
          result.add(changedParameterInfo);
          changedParams.add(changedParameterInfo);
          buf.append("<s>").append(presentableText).append("</s> <b>").append(escapePresentableType(exprType)).append("</b>");
        }
      }
      // do not perform silly refactorings
      boolean isSilly = true;
      for (int i = 0; i < result.size(); i++) {
        PsiParameter parameter = parameters[i];
        PsiType paramType = substitutor.substitute(getValidParameterType(parameter, targetMethod));
        ParameterInfoImpl parameterInfo = result.get(i);
        String typeText = parameterInfo.getTypeText();
        if (!paramType.getPresentableText(true).equals(typeText)) {
          isSilly = false;
          break;
        }
      }
      if (isSilly) return null;
    }
    return result.toArray(new ParameterInfoImpl[0]);
  }
private ParameterInfoImpl @Nullable [] getNewParametersInfo(PsiExpression[] expressions,
                                                              PsiMethod targetMethod,
                                                              PsiSubstitutor substitutor,
                                                              final @NonNls StringBuilder buf,
                                                              final HashSet<? super ParameterInfoImpl> newParams,
                                                              final HashSet<? super ParameterInfoImpl> removedParams,
                                                              final HashSet<? super ParameterInfoImpl> changedParams)