ownerList.remove(value);
// Insert the collection at the right place.
//
ownerList.addAll(index, collection);
// Update the containing map, if necessary.
//
updateEMap(owner, feature);
// We'd like the collection of replacements selected after this replace completes.
//
affectedObjects = collection;
ownerList.remove(value);
// Insert the collection at the right place.
//
ownerList.addAll(index, collection);
// Update the containing map, if necessary.
//
updateEMap(owner, feature);
// We'd like the collection of replacements selected after this replace completes.
//
affectedObjects = collection;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/ReplaceCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/ReplaceCommand.java
|
Method name: void doExecute()
|
|
Method name: void doRedo()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | ownerList.remove(value);↵ | | 1 | ownerList.remove(value);↵
|
|
2 | // Insert the collection at the right place.↵ | | 2 | // Insert the collection at the right place.↵
|
3 | //↵ | | 3 | //↵
|
4 | ownerList.addAll(index, collection);↵ | | 4 | ownerList.addAll(index, collection);↵
|
5 | ↵ | | 5 | ↵
|
6 | // Update the containing map, if necessary.↵ | | 6 | // Update the containing map, if necessary.↵
|
7 | //↵ | | 7 | //↵
|
8 | updateEMap(owner, feature);↵ | | 8 | updateEMap(owner, feature);↵
|
|
9 | // We'd like the collection of replacements selected after this replace completes.↵ | | 9 | // We'd like the collection of replacements selected after this replace completes.↵
|
10 | //↵ | | 10 | //↵
|
11 | affectedObjects = collection; | | 11 | affectedObjects = collection;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | ownerList.remove(value); | | 1 | ownerList.remove(value); |
3 | ownerList.addAll(index, collection); | | 2 | ownerList.addAll(index, collection); |
4 | updateEMap(owner, feature); | | 3 | updateEMap(owner, feature); |
| | | 4 | affectedObjects = collection; |
5 | affectedObjects = collection; | | | |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |