public TreeElement addInternal(TreeElement first, ASTNode last, ASTNode anchor, Boolean beforeB) { TreeElement firstAppended = null; boolean before = beforeB == null || beforeB.booleanValue(); try { TreeElement next; do { next = first.getTreeNext(); if (firstAppended == null) { firstAppended = addInternal(first, anchor, before); anchor = firstAppended; } else { anchor = addInternal(first, anchor, false); } } while (first != last && (first = next) != null); } catch (IncorrectOperationException ignored) { } finally { clearCaches(); } return firstAppended; }