private static <Parent extends PsiElement, Child extends PsiElement> void resolveVariableVsFieldsConflicts(
    final List<Child> newElements,
    final List<String> newElementNames,
    final Parent parent,
    boolean[] toRemoveParameters,
    final PsiElement methodBody,
    ChangeSignatureUtil.ChildrenGenerator<Parent, Child> generator) throws IncorrectOperationException
  {
    PsiUtilCore.ensureValid(parent);
    List<FieldConflictsResolver> conflictResolvers = new ArrayList<>();
    for (String newElementName : ContainerUtil.skipNulls(newElementNames)) {
      conflictResolvers.add(new FieldConflictsResolver(newElementName, methodBody));
    }
    ChangeSignatureUtil.synchronizeList(parent, newElements, generator, toRemoveParameters);
    LOG.assertTrue(parent.getContainingFile() != null, "No containing file for: " + parent.getClass());
    JavaCodeStyleManager.getInstance(parent.getProject()).shortenClassReferences(parent);
    for (FieldConflictsResolver fieldConflictsResolver : conflictResolvers) {
      fieldConflictsResolver.fix();
    }
  }
private static <Parent extends PsiElement, Child extends PsiElement> void resolveVariableVsFieldsConflicts(
    final List<Child> newElements,
    final List<String> newElementNames,
    final Parent parent,
    boolean[] toRemoveParameters,
    final PsiElement methodBody,
    ChangeSignatureUtil.ChildrenGenerator<Parent, Child> generator)