while ((read = is.read()) != -1) {
char c = (char) read;
sb.append(c);
if (c == '\n') {
log(sb.toString(), Project.MSG_INFO);
sb.delete(0, sb.length());
}
}
if (read != -1) {
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: 6
|
|
Number of AST nodes: 6
|
|
1 | while ((read = is.read()) != -1) {↵ | | 1 | if (read != -1) {↵
|
2 | char c = (char) read;↵ | | 2 | char c = (char) read;↵
|
3 | sb.append(c);↵ | | 3 | sb.append(c);↵
|
4 | if (c == '\n') {↵ | | 4 | if (c == '\n') {↵
|
5 | log(sb.toString(), Project.MSG_INFO);↵ | | 5 | log(sb.toString(), Project.MSG_INFO);↵
|
6 | sb.delete(0, sb.length());↵ | | 6 | sb.delete(0, sb.length());↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 8 | }
|
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.2 |
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) | 4.0 |
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 |