File path: /apache-ant-1.7.0/src/org/apache/tools/tar/TarInputStream.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Concat.java | |||
Method name: void copyEntryContents(OutputStream)
|
Method name: void concatenate(char[], Writer, Reader)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | while (true) {↵ | 1 | while (true) {↵ | |
2 | int numRead = this.read(buf, 0, buf.length);↵ | 2 | int nRead = in.read(buffer, 0, buffer.length);↵ | |
3 | if (numRead == -1) {↵ | 3 | if (nRead == -1) {↵ | |
4 | break;↵ | 4 | break;↵ | |
5 | }↵ | 5 | }↵ | |
6 | out.write(buf, 0, numRead);↵ | 6 | writer.write(buffer, 0, nRead);↵ | |
7 | } | 7 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
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) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | while (true) | 8 | while (true) | ||||||||||||||||||||||
3 | int numRead = this.read(buf, 0, buf.length); |
| | ||||||||||||||||||||||
|
| 9 | int nRead = in.read(buffer, 0, buffer.length); | ||||||||||||||||||||||
4 | if (numRead == -1) |
| 10 | if (nRead == -1) | |||||||||||||||||||||
5 | break; | 11 | break; | ||||||||||||||||||||||
6 | out.write(buf, 0, numRead); |
| 12 | writer.write(buffer, 0, nRead); |
Row | Violation |
---|---|
1 | Unmatched statement int numRead=this.read(buf,0,buf.length); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement int nRead=in.read(buffer,0,buffer.length); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type byte[] of variable buf does not match with type char[] of variable buffer |
4 | Type java.io.OutputStream of variable out does not match with type java.io.Writer of variable writer |