TreeElement (TreeElement first, ASTNode last, ASTNode anchor, Boolean before) { if (first == last && first.getElementType() == JavaElementType.TYPE){ if (getLastChildNode() != null && getLastChildNode().getElementType() == TokenType.ERROR_ELEMENT){ super.deleteChildInternal(getLastChildNode()); } } final CharTable treeCharTab = SharedImplUtil.findCharTableByTree(this); if (getFirstChildNode()== null || getFirstChildNode().getElementType() != JavaTokenType.LT){ TreeElement lt = Factory.createSingleLeafElement(JavaTokenType.LT, "<", 0, 1, treeCharTab, getManager()); super.addInternal(lt, lt, getFirstChildNode(), Boolean.TRUE); } if (getLastChildNode() == null || getLastChildNode().getElementType() != JavaTokenType.GT){ TreeElement gt = Factory.createSingleLeafElement(JavaTokenType.GT, ">", 0, 1, treeCharTab, getManager()); super.addInternal(gt, gt, getLastChildNode(), Boolean.FALSE); } if (anchor == null){ if (before == null || before.booleanValue()){ anchor = findChildByRole(ChildRole.GT_IN_TYPE_LIST); before = Boolean.TRUE; } else{ anchor = findChildByRole(ChildRole.LT_IN_TYPE_LIST); before = Boolean.FALSE; } } final TreeElement firstAdded = super.addInternal(first, last, anchor, before); if (first == last && first.getElementType() == JavaElementType.TYPE) { JavaSourceUtil.addSeparatingComma(this, first, TYPE_SET); } return firstAdded; }