File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java | |||
Method name: void handleMultipleTasks(AntRExecClient)
|
Method name: void execute()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (userid != null && password != null) {↵ | 1 | if (userid != null && password != null) {↵ | |
2 | login(rexec);↵ | 2 | login(telnet);↵ | |
3 | }↵ | 3 | }↵ | |
4 | /** Process each sub command */↵ | 4 | /** Process each sub command */↵ | |
5 | Enumeration tasksToRun = rexecTasks.elements();↵ | 5 | Enumeration tasksToRun = telnetTasks.elements();↵ | |
6 | while (tasksToRun != null && tasksToRun.hasMoreElements()) {↵ | 6 | while (tasksToRun != null && tasksToRun.hasMoreElements()) {↵ | |
7 | RExecSubTask task = (RExecSubTask) tasksToRun.nextElement();↵ | 7 | TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();↵ | |
8 | if (task instanceof RExecRead && defaultTimeout != null) {↵ | 8 | if (task instanceof TelnetRead && defaultTimeout != null) {↵ | |
9 | ((RExecRead) task).setDefaultTimeout(defaultTimeout);↵ | 9 | ((TelnetRead) task).setDefaultTimeout(defaultTimeout);↵ | |
10 | }↵ | 10 | ↵ | |
11 | }↵ | |||
11 | task.execute(rexec);↵ | 12 | task.execute(↵ | |
13 | telnet);↵ | |||
12 | } | 14 | } | |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (userid != null && password != null) | 12 | if (userid != null && password != null) | ||||||||||||||||
2 | login(rexec); |
| 13 | login(telnet); | |||||||||||||||
3 | Enumeration tasksToRun = rexecTasks.elements(); |
| 14 | Enumeration tasksToRun = telnetTasks.elements(); | |||||||||||||||
4 | while (tasksToRun != null && tasksToRun.hasMoreElements()) | 15 | while (tasksToRun != null && tasksToRun.hasMoreElements()) | ||||||||||||||||
5 | RExecSubTask task = (RExecSubTask)tasksToRun.nextElement(); |
| | ||||||||||||||||
|
| 16 | TelnetSubTask task = (TelnetSubTask)tasksToRun.nextElement(); | ||||||||||||||||
6 | if (task instanceof RExecRead && defaultTimeout != null) |
| 17 | if (task instanceof TelnetRead && defaultTimeout != null) | |||||||||||||||
7 | ((RExecRead)task).setDefaultTimeout(defaultTimeout); |
| 18 | ((TelnetRead)task).setDefaultTimeout(defaultTimeout); | |||||||||||||||
8 | task.execute(rexec); | | |||||||||||||||||
| 19 | task.execute(telnet); |
Row | Violation |
---|---|
1 | Unmatched statement RExecSubTask task=(RExecSubTask)tasksToRun.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement TelnetSubTask task=(TelnetSubTask)tasksToRun.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type org.apache.tools.ant.taskdefs.optional.net.RExecTask.RExecSubTask of variable task does not match with type org.apache.tools.ant.taskdefs.optional.net.TelnetTask.TelnetSubTask of variable task |
4 | Type org.apache.tools.ant.taskdefs.optional.net.RExecTask.RExecRead of variable (RExecRead)task does not match with type org.apache.tools.ant.taskdefs.optional.net.TelnetTask.TelnetRead of variable (TelnetRead)task |
5 | Type org.apache.tools.ant.taskdefs.optional.net.RExecTask.RExecSubTask of variable task does not match with type org.apache.tools.ant.taskdefs.optional.net.TelnetTask.TelnetSubTask of variable task |