if (index == CommandParameter.NO_INDEX)
{
ownerList.addAll(collection);
}
else
{
ownerList.addAll(index, collection);
}
// Update the containing map, if necessary.
//
updateEMap(owner, feature);
// We'd like the collection of things added to be selected after this command completes.
//
affectedObjects = collection;
if (index == CommandParameter.NO_INDEX)
{
ownerList.addAll(collection);
}
else
{
ownerList.addAll(index, collection);
}
// Update the containing map, if necessary.
//
updateEMap(owner, feature);
// We'd like the collection of things added to be selected after this command completes.
//
affectedObjects = collection;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/AddCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/AddCommand.java
|
Method name: void doRedo()
|
|
Method name: void doExecute()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (index == CommandParameter.NO_INDEX)↵ | | 1 | if (index == CommandParameter.NO_INDEX)↵
|
2 | {↵ | | 2 | {↵
|
3 | ownerList.addAll(collection);↵ | | 3 | ownerList.addAll(collection);↵
|
4 | }↵ | | 4 | }↵
|
5 | else↵ | | 5 | else↵
|
6 | {↵ | | 6 | {↵
|
7 | ownerList.addAll(index, collection);↵ | | 7 | ownerList.addAll(index, collection);↵
|
8 | }↵ | | 8 | }↵
|
|
9 | // Update the containing map, if necessary.↵ | | 9 | // Update the containing map, if necessary.↵
|
10 | //↵ | | 10 | //↵
|
11 | updateEMap(owner, feature);↵ | | 11 | updateEMap(owner, feature);↵
|
|
12 | // We'd like the collection of things added to be selected after this command completes.↵ | | 12 | // We'd like the collection of things added to be selected after this command completes.↵
|
13 | //↵ | | 13 | //↵
|
14 | affectedObjects = collection; | | 14 | 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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (index == CommandParameter.NO_INDEX) | | 1 | if (index == CommandParameter.NO_INDEX) |
2 | ownerList.addAll(collection); | | 2 | ownerList.addAll(collection); |
| | | | |
3 | ownerList.addAll(index, collection); | | 3 | ownerList.addAll(index, collection); |
4 | updateEMap(owner, feature); | | 4 | updateEMap(owner, feature); |
| | | 5 | affectedObjects = collection; |
5 | affectedObjects = collection; | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |