System.arraycopy(data[i].getHeaderId().getBytes(),
0, result, start, 2);
System.arraycopy(data[i].getLocalFileDataLength().getBytes(),
0, result, start + 2, 2);
byte[] local = data[i].getLocalFileDataData();
System.arraycopy(local, 0, result, start + 4, local.length);
start += (local.length + 4);
System.arraycopy(data[i].getHeaderId().getBytes(),
0, result, start, 2);
System.arraycopy(data[i].getCentralDirectoryLength().getBytes(),
0, result, start + 2, 2);
byte[] local = data[i].getCentralDirectoryData();
System.arraycopy(local, 0, result, start + 4, local.length);
start += (local.length + 4);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/zip/ExtraFieldUtils.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/zip/ExtraFieldUtils.java
|
Method name: byte[] mergeLocalFileDataData(ZipExtraField[])
|
|
Method name: byte[] mergeCentralDirectoryData(ZipExtraField[])
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | System.arraycopy(data[i].getHeaderId().getBytes(),↵ | | 1 | System.arraycopy(data[i].getHeaderId().getBytes(),↵
|
2 | 0, result, start, 2);↵ | | 2 | 0, result, start, 2);↵
|
3 | System.arraycopy(data[i].getLocalFileDataLength().getBytes(),↵ | | 3 | System.arraycopy(data[i].getCentralDirectoryLength().getBytes(),↵
|
4 | 0, result, start + 2, 2);↵ | | 4 | 0, result, start + 2, 2);↵
|
5 | byte[] local = data[i].getLocalFileDataData();↵ | | 5 | byte[] local = data[i].getCentralDirectoryData();↵
|
6 | System.arraycopy(local, 0, result, start + 4, local.length);↵ | | 6 | System.arraycopy(local, 0, result, start + 4, local.length);↵
|
7 | start += (local.length + 4); | | 7 | start += (local.length + 4);
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
-
{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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | System.arraycopy(data[i].getHeaderId().getBytes(), 0, result, start, 2); | | 7 | System.arraycopy(data[i].getHeaderId().getBytes(), 0, result, start, 2); |
8 | System.arraycopy(data[i].getLocalFileDataLength().getBytes(), 0, result, start + 2, 2); | | 8 | System.arraycopy(data[i].getCentralDirectoryLength().getBytes(), 0, result, start + 2, 2); |
9 | byte[] local = data[i].getLocalFileDataData(); | | 9 | byte[] local = data[i].getCentralDirectoryData(); |
10 | System.arraycopy(local, 0, result, start + 4, local.length); | | 10 | System.arraycopy(local, 0, result, start + 4, local.length); |
11 | start += (local.length + 4); | | 11 | start += (local.length + 4); |
Precondition Violations (0)
Row |
Violation |