TreeElement (TreeElement first, ASTNode last, ASTNode anchor, Boolean before) { final CharTable treeCharTab = SharedImplUtil.findCharTableByTree(this); if (anchor == null) { if (before == null || before.booleanValue()) { anchor = findChildByRole(ChildRole.RPARENTH); if (anchor == null) { LeafElement lparenth = Factory.createSingleLeafElement(JavaTokenType.LPARENTH, "(", 0, 1, treeCharTab, getManager()); super.addInternal(lparenth, lparenth, null, Boolean.FALSE); LeafElement rparenth = Factory.createSingleLeafElement(JavaTokenType.RPARENTH, ")", 0, 1, treeCharTab, getManager()); super.addInternal(rparenth, rparenth, null, Boolean.TRUE); anchor = findChildByRole(ChildRole.RPARENTH); LOG.assertTrue(anchor != null); } before = Boolean.TRUE; } else { anchor = findChildByRole(ChildRole.LPARENTH); if (anchor == null) { LeafElement lparenth = Factory.createSingleLeafElement(JavaTokenType.LPARENTH, "(", 0, 1, treeCharTab, getManager()); super.addInternal(lparenth, lparenth, null, Boolean.FALSE); LeafElement rparenth = Factory.createSingleLeafElement(JavaTokenType.RPARENTH, ")", 0, 1, treeCharTab, getManager()); super.addInternal(rparenth, rparenth, null, Boolean.TRUE); anchor = findChildByRole(ChildRole.LPARENTH); LOG.assertTrue(anchor != null); } before = Boolean.FALSE; } } TreeElement firstAdded = super.addInternal(first, last, anchor, before); TreeElement element = first; while (true) { if (ElementType.EXPRESSION_BIT_SET.contains(element.getElementType())) { JavaSourceUtil.addSeparatingComma(this, element, ElementType.EXPRESSION_BIT_SET); break; } if (element == last) break; element = element.getTreeNext(); } return firstAdded; }