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