OutputStream os = this.getOutputStream();
try {
os.write((s + "\n").getBytes());
if (echoString) {
log(s, Project.MSG_INFO);
}
os.flush();
} catch (Exception e) {
throw new BuildException(e, getLocation());
}
OutputStream os = this.getOutputStream();
try {
os.write((s + "\n").getBytes());
if (echoString) {
log(s, Project.MSG_INFO);
}
os.flush();
} catch (Exception e) {
throw new BuildException(e, getLocation());
}
Clone fragments detected by clone detection tool
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 sendString(String, boolean)
|
|
Method name: void sendString(String, boolean)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | OutputStream os = this.getOutputStream();↵ | | 1 | OutputStream os = this.getOutputStream();↵
|
2 | try {↵ | | 2 | try {↵
|
3 | os.write((s + "\n").getBytes());↵ | | 3 | os.write((s + "\n").getBytes());↵
|
4 | if (echoString) {↵ | | 4 | if (echoString) {↵
|
5 | log(s, Project.MSG_INFO);↵ | | 5 | log(s, Project.MSG_INFO);↵
|
6 | }↵ | | 6 | }↵
|
7 | os.flush();↵ | | 7 | os.flush();↵
|
8 | } catch (Exception e) {↵ | | 8 | } catch (Exception e) {↵
|
9 | throw new BuildException(e, getLocation());↵ | | 9 | throw new BuildException(e, getLocation());↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | OutputStream os = this.getOutputStream(); | | 1 | OutputStream os = this.getOutputStream(); |
2 | try | | 2 | try |
3 | os.write((s + "\n").getBytes()); | | 3 | os.write((s + "\n").getBytes()); |
4 | | | 4 | |
5 | log(s, Project.MSG_INFO); | | 5 | log(s, Project.MSG_INFO); |
6 | | | 6 | |
Precondition Violations (0)
Row |
Violation |