[java] consistent PSI after removing one of multiple declarations (IDEA-175642)

This commit is contained in:
Roman Shevchenko
2017-07-13 14:07:11 +02:00
parent ac8b9ae4ee
commit 7b9eab1dec
2 changed files with 13 additions and 1 deletions
@@ -77,6 +77,17 @@ public class PsiDeclarationStatementImpl extends CompositePsiElement implements
}
super.deleteChildInternal(child);
TreeElement first = getFirstChildNode();
if (first != null && !DECLARED_ELEMENT_BIT_SET.contains(first.getElementType())) {
TreeElement last = first;
while (true) {
TreeElement next = last.getTreeNext();
if (next == null || DECLARED_ELEMENT_BIT_SET.contains(next.getElementType())) break;
last = next;
}
getTreeParent().addInternal(first, last, this, Boolean.TRUE);
}
}
private void removeCommaBefore(ASTNode child) {
@@ -5,7 +5,8 @@ class a {
int k;
private int run() {
/*ddddd*/ Object oo = (Object) new Integer(0);
/*ddddd*/
Object oo = (Object) new Integer(0);
return 0;
}
}