byte[] buffer = new byte[8 * 1024];
int count = 0;
do {
out.write(buffer, 0, count);
count = zIn.read(buffer, 0, buffer.length);
} while (count != -1);
byte[] buffer = new byte[8 * 1024];
int count = 0;
do {
zOut.write(buffer, 0, count);
count = in.read(buffer, 0, buffer.length);
} while (count != -1);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GUnzip.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Pack.java
|
Method name: void extract()
|
|
Method name: void zipFile(InputStream, OutputStream)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | byte[] buffer = new byte[8 * 1024];↵ | | 1 | byte[] buffer = new byte[8 * 1024];↵
|
2 | int count = 0;↵ | | 2 | int count = 0;↵
|
3 | do {↵ | | 3 | do {↵
|
4 | out.write(buffer, 0, count);↵ | | 4 | zOut.write(buffer, 0, count);↵
|
5 | count = zIn.read(buffer, 0, buffer.length);↵ | | 5 | count = in.read(buffer, 0, buffer.length);↵
|
6 | } while (count != -1); | | 6 | } while (count != -1);
|
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 different classes having the same super class |
Number of node comparisons | 13 |
-
{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) | 13.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | byte[] buffer = new byte[8 * 1024]; | | 1 | byte[] buffer = new byte[8 * 1024]; |
11 | int count = 0; | | 2 | int count = 0; |
14 | do while(count != -1) | | 5 | do while(count != -1) |
12 | out.write(buffer, 0, count); | | 3 | zOut.write(buffer, 0, count); |
13 | count = zIn.read(buffer, 0, buffer.length); | | 4 | count = in.read(buffer, 0, buffer.length); |
Precondition Violations (0)
Row |
Violation |