Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
9 | 2 | 3 | 0.965 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 9 | 166 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java |
2 | 9 | 199 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java |
| ||||
/** * Inserts the given node into the list after the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by * {@link ASTRewrite#createCopyTarget(ASTNode)}, * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. * * @param node the node to insert * @param element the element after which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ public void insertAfter(ASTNode node, ASTNode element, TextEditGroup editGroup) { if (node == null || element == null) { throw new IllegalArgumentException(); } int index = getEvent().getIndex(element, ListRewriteEvent.BOTH); if (index == -1) { throw new IllegalArgumentException("Node does not exist"); //$NON-NLS-1$ } internalInsertAt(node, index + 1, true, editGroup); } |
| ||||
/** * Inserts the given node into the list before the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by * {@link ASTRewrite#createCopyTarget(ASTNode)}, * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. * * @param node the node to insert * @param element the element before which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ public void insertBefore(ASTNode node, ASTNode element, TextEditGroup editGroup) { if (node == null || element == null) { throw new IllegalArgumentException(); } int index = getEvent().getIndex(element, ListRewriteEvent.BOTH); if (index == -1) { throw new IllegalArgumentException("Node does not exist"); //$NON-NLS-1$ } internalInsertAt(node, index, false, editGroup); } |
| |||
/** * Inserts the given node into the list after the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by * {@link ASTRewrite#createCopyTarget(ASTNode)}, * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. * * @param node the node to insert * @param element the element after which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ /** * Inserts the given node into the list before the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by * {@link ASTRewrite#createCopyTarget(ASTNode)}, * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. * * @param node the node to insert * @param element the element before which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ public void [[#variable5e8db200]](ASTNode node, ASTNode element, TextEditGroup editGroup) { if (node == null || element == null) { throw new IllegalArgumentException(); } int index = getEvent().getIndex(element, ListRewriteEvent.BOTH); if (index == -1) { throw new IllegalArgumentException("Node does not exist"); //$NON-NLS-1$ } internalInsertAt(node, [[#variable5e8dbbc0]], [[#variable5e8dbc20]], editGroup); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5e8db200]] | insertAfter |
1 | 2 | [[#5e8db200]] | insertBefore |
2 | 1 | [[#5e8dbbc0]] | index + 1 |
2 | 2 | [[#5e8dbbc0]] | index |
3 | 1 | [[#5e8dbc20]] | true |
3 | 2 | [[#5e8dbc20]] | false |