void (@NotNull ASTNode child) { final TreeElement oldLastNodeInsideParens = getLastNodeInsideParens(); final TreeElement oldFirstNodeInsideParens = getFirstNodeInsideParens(); if (PARAMETER_SET.contains(child.getElementType())) { JavaSourceUtil.deleteSeparatingComma(this, child); ensureParenthesisAroundParameterList(); } super.deleteChildInternal(child); // We may want to fix trailing white space processing here - there is a following possible case: // *) this parameter list is like (arg1, <white-space-containing-line-breaks>, arg2); // *) 'arg2' is to be removed; // We don't want to keep trailing white space then TreeElement newLastNodeInsideParens = getLastNodeInsideParens(); if (newLastNodeInsideParens != null && oldLastNodeInsideParens != null && newLastNodeInsideParens.getElementType() == WHITE_SPACE) { if (oldLastNodeInsideParens.getElementType() != WHITE_SPACE) { deleteChildInternal(newLastNodeInsideParens); } else { replaceChild(newLastNodeInsideParens, (ASTNode)oldLastNodeInsideParens.clone()); } } final TreeElement newFirstNodeInsideParens = getFirstNodeInsideParens(); if (newFirstNodeInsideParens != null && newFirstNodeInsideParens.getElementType() == WHITE_SPACE) { if (oldFirstNodeInsideParens == null || oldFirstNodeInsideParens.getElementType() != WHITE_SPACE) { deleteChildInternal(newFirstNodeInsideParens); } else { replaceChild(newFirstNodeInsideParens, (ASTNode)oldFirstNodeInsideParens.clone()); } } }