for (Object object : collection)
{
if (!(object instanceof Mapping))
{
allMappings = false;
break;
}
}
for (Object object : collection)
{
if (!(object instanceof Mapping))
{
result = false;
break;
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/action/RemoveMappingAction.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/AddMappingCommand.java
|
Method name: Command createCommand()
|
|
Method name: boolean prepare()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (Object object : collection)↵ | | 1 | for (Object object : collection)↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | if (!(object instanceof Mapping))↵ | | 4 | if (!(object instanceof Mapping))↵
|
5 | {↵ | | 5 | {↵
|
6 | allMappings = false;↵ | | 6 | result = false;↵
|
7 | break;↵ | | 7 | break;↵
|
8 | }↵ | | 8 | ↵
|
9 | ↵ | | 9 | }↵
|
10 | } | | 10 | }
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (!(object instanceof Mapping)) | | 3 | if (!(object instanceof Mapping)) |
4 | | | 4 | |
5 | | | 5 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |