for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
ChangeKind result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
SpaceType result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/ChangeKind.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/SpaceType.java
|
Method name: ChangeKind get(String)
|
|
Method name: SpaceType get(String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int i = 0; i < VALUES_ARRAY.length; ++i)↵ | | 1 | for (int i = 0; i < VALUES_ARRAY.length; ++i)↵
|
2 | {↵ | | 2 | {↵
|
3 | ChangeKind result = VALUES_ARRAY[i];↵ | | 3 | SpaceType result = VALUES_ARRAY[i];↵
|
4 | if (result.toString().equals(literal))↵ | | 4 | if (result.toString().equals(literal))↵
|
5 | {↵ | | 5 | {↵
|
6 | return result;↵ | | 6 | return result;↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | return null; | | 9 | return null;
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | for (int i = 0; i < VALUES_ARRAY.length; ++i) | | 1 | for (int i = 0; i < VALUES_ARRAY.length; ++i) |
2 | ChangeKind result = VALUES_ARRAY[i]; | | 2 | SpaceType result = VALUES_ARRAY[i]; |
3 | if (result.toString().equals(literal)) | | 3 | if (result.toString().equals(literal)) |
4 | | | 4 | |
5 | return null; | | 5 | return null; |
Precondition Violations (0)
Row |
Violation |