Entry [] entries = (Entry[])data;
for (int i = 0; i < size; ++i)
{
Entry otherEntry = entries[i];
if (otherEntry.equals(entry) && i != index)
{
throw new IllegalArgumentException("The 'no duplicates' constraint is violated");
}
}
Entry [] entries = (Entry[])data;
for (int i = 0; i < size; ++i)
{
Entry otherEntry = entries[i];
if (otherEntry.equals(entry) && i != index)
{
throw new IllegalArgumentException("The 'no duplicates' constraint is violated");
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
|
Method name: void add(int, Entry)
|
|
Method name: Entry set(int, Entry)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Entry [] entries = (Entry[])data;↵ | | 1 | Entry [] entries = (Entry[])data;↵
|
2 | for (int i = 0; i < size; ++i)↵ | | 2 | for (int i = 0; i < size; ++i)↵
|
3 | {↵ | | 3 | {↵
|
4 | Entry otherEntry = entries[i];↵ | | 4 | Entry otherEntry = entries[i];↵
|
5 | if (otherEntry.equals(entry) && i != index)↵ | | 5 | if (otherEntry.equals(entry) && i != index)↵
|
6 | {↵ | | 6 | {↵
|
7 | throw new IllegalArgumentException("The 'no duplicates' constraint is violated");↵ | | 7 | throw new IllegalArgumentException("The 'no duplicates' constraint is violated");↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | Entry[] entries = (Entry[])data; | | 5 | Entry[] entries = (Entry[])data; |
6 | for (int i = 0; i < size; ++i) | | 6 | for (int i = 0; i < size; ++i) |
7 | Entry otherEntry = entries[i]; | | 7 | Entry otherEntry = entries[i]; |
8 | if (otherEntry.equals(entry) && i != index) | | 8 | if (otherEntry.equals(entry) && i != index) |
9 | throw new IllegalArgumentException("The 'no duplicates' constraint is violated"); | | 9 | throw new IllegalArgumentException("The 'no duplicates' constraint is violated"); |
Precondition Violations (0)
Row |
Violation |