PsiLocalVariable @NotNull [] declareParameters() {
    PsiCodeBlock block = Objects.requireNonNull(myMethodCopy.getBody());
    final int applicabilityLevel = PsiUtil.getApplicabilityLevel(myMethod, mySubstitutor, myCallArguments);
    PsiParameter[] parameters = myMethodCopy.getParameterList().getParameters();
    PsiLocalVariable[] parameterVars = new PsiLocalVariable[parameters.length];
    for (int i = parameters.length - 1; i >= 0; i--) {
      PsiParameter parameter = parameters[i];
      String parameterName = parameter.getName();
      String name = parameterName;
      name = myJavaCodeStyle.variableNameToPropertyName(name, VariableKind.PARAMETER);
      name = myJavaCodeStyle.propertyNameToVariableName(name, VariableKind.LOCAL_VARIABLE);
      if (!name.equals(parameterName)) {
        name = myJavaCodeStyle.suggestUniqueVariableName(name, block.getFirstChild(), true);
      }
      RefactoringUtil.renameVariableReferences(parameter, name, new LocalSearchScope(block), true);
      PsiType paramType = parameter.getType();
      @NonNls String defaultValue;
      if (paramType instanceof PsiEllipsisType ellipsisType) {
        paramType = mySubstitutor.substitute(ellipsisType.toArrayType());
        if (applicabilityLevel == MethodCandidateInfo.ApplicabilityLevel.VARARGS) {
          PsiType componentType = ((PsiArrayType)paramType).getComponentType();
          defaultValue = "new " + ObjectUtils.notNull(TypeConversionUtil.erasure(componentType), componentType).getCanonicalText() + "[]{}";
        }
        else {
          defaultValue = PsiTypesUtil.getDefaultValueOfType(paramType);
        }
      }
      else {
        defaultValue = PsiTypesUtil.getDefaultValueOfType(paramType);
      }

      PsiExpression initializer = myFactory.createExpressionFromText(defaultValue, null);
      PsiDeclarationStatement declaration = myFactory.createVariableDeclarationStatement(name, paramType, initializer);
      declaration = (PsiDeclarationStatement)block.addAfter(declaration, null);
      parameterVars[i] = (PsiLocalVariable)declaration.getDeclaredElements()[0];
      PsiUtil.setModifierProperty(parameterVars[i], PsiModifier.FINAL, parameter.hasModifierProperty(PsiModifier.FINAL));
    }
    return parameterVars;
  }
PsiLocalVariable @NotNull [] declareParameters()