Task task = event.getTask();
Object real = task;
if (task instanceof UnknownElement) {
Object realObj = ((UnknownElement) task).getTask();
if (realObj != null) {
real = realObj;
}
}
Log log = getLog(real.getClass().getName(), null);
Task task = event.getTask();
Object real = task;
if (task instanceof UnknownElement) {
Object realObj = ((UnknownElement) task).getTask();
if (realObj != null) {
real = realObj;
}
}
Log log = getLog(real.getClass().getName(), null);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/listener/CommonsLoggingListener.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/listener/CommonsLoggingListener.java
|
Method name: void taskStarted(BuildEvent)
|
|
Method name: void taskFinished(BuildEvent)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | Task task = event.getTask();↵ | | 1 | Task task = event.getTask();↵
|
2 | Object real = task;↵ | | 2 | Object real = task;↵
|
3 | if (task instanceof UnknownElement) {↵ | | 3 | if (task instanceof UnknownElement) {↵
|
4 | Object realObj = ((UnknownElement) task).getTask();↵ | | 4 | Object realObj = ((UnknownElement) task).getTask();↵
|
5 | if (realObj != null) {↵ | | 5 | if (realObj != null) {↵
|
6 | real = realObj;↵ | | 6 | real = realObj;↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | Log log = getLog(real.getClass().getName(), null); | | 9 | Log log = getLog(real.getClass().getName(), null);
|
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 3.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | Task task = event.getTask(); | | 2 | Task task = event.getTask(); |
3 | Object real = task; | | 3 | Object real = task; |
4 | if (task instanceof UnknownElement) | | 4 | if (task instanceof UnknownElement) |
5 | Object realObj = ((UnknownElement)task).getTask(); | | 5 | Object realObj = ((UnknownElement)task).getTask(); |
6 | | | 6 | |
7 | | | 7 | |
8 | Log log = getLog(real.getClass().getName(), null); | | 8 | Log log = getLog(real.getClass().getName(), null); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables log, task , while Clone fragment #2 returns variables log, task |