if (commandList.isEmpty())
{
isPrepared = true;
isExecutable = true;
}
else
{
isExecutable = prepare();
isPrepared = true;
isPessimistic = true;
if (isExecutable)
{
execute();
}
}
if (commandList.isEmpty())
{
isPrepared = true;
isExecutable = true;
}
else
{
isExecutable = prepare();
isPrepared = true;
if (isExecutable)
{
execute();
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/StrictCompoundCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java
|
Method name: boolean appendAndExecute(Command)
|
|
Method name: boolean appendAndExecute(Command)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 7
|
|
1 | if (commandList.isEmpty())↵ | | 1 | if (commandList.isEmpty())↵
|
2 | {↵ | | 2 | {↵
|
3 | isPrepared = true;↵ | | 3 | isPrepared = true;↵
|
4 | isExecutable = true;↵ | | 4 | isExecutable = true;↵
|
5 | }↵ | | 5 | }↵
|
6 | else↵ | | 6 | else↵
|
7 | {↵ | | 7 | {↵
|
8 | isExecutable = prepare();↵ | | 8 | isExecutable = prepare();↵
|
9 | isPrepared = true;↵ | | 9 | isPrepared = true;↵
|
10 | isPessimistic = true;↵ | | |
|
11 | if (isExecutable)↵ | | 10 | if (isExecutable)↵
|
12 | {↵ | | 11 | {↵
|
13 | execute();↵ | | 12 | execute();↵
|
14 | }↵ | | 13 | }↵
|
15 | } | | 14 | }
|
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 | 35 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (commandList.isEmpty()) | | 3 | if (commandList.isEmpty()) |
4 | | | 4 | |
5 | | | 5 | |
| | | | |
6 | isExecutable = prepare(); | | 6 | isExecutable = prepare(); |
7 | | | 7 | |
8 | | | | |
9 | | | 8 | |
10 | | | 9 | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement isPessimistic=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |