char c = (char) read;
sb.append(c);
if (c == '\n') {
log(sb.toString(), Project.MSG_INFO);
sb.delete(0, sb.length());
}
char c = (char) read;
sb.append(c);
if (c == '\n') {
log(sb.toString(), Project.MSG_INFO);
sb.delete(0, sb.length());
}
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/RExecTask.java
|
Method name: void waitForEOF(Integer)
|
|
Method name: void waitForEOF(Integer)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | char c = (char) read;↵ | | 1 | char c = (char) read;↵
|
2 | sb.append(c);↵ | | 2 | sb.append(c);↵
|
3 | if (c == '\n') {↵ | | 3 | if (c == '\n') {↵
|
4 | log(sb.toString(), Project.MSG_INFO);↵ | | 4 | log(sb.toString(), Project.MSG_INFO);↵
|
5 | sb.delete(0, sb.length());↵ | | 5 | sb.delete(0, sb.length());↵
|
6 | } | | 6 | }
|
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | char c = (char)read; | | 23 | char c = (char)read; |
8 | sb.append(c); | | 24 | sb.append(c); |
9 | if (c == '\n') | | 25 | if (c == '\n') |
10 | log(sb.toString(), Project.MSG_INFO); | | 26 | log(sb.toString(), Project.MSG_INFO); |
11 | sb.delete(0, sb.length()); | | 27 | sb.delete(0, sb.length()); |
Precondition Violations (0)
Row |
Violation |