byte[] slice = new byte[(end - begin + 1)];
int count = 0;
for (int i = begin; i <= end; i++) {
slice[count] = array[i];
count++;
}
return slice;
byte[] slice = new byte[(end - begin + 1)];
int count = 0;
for (int i = begin; i <= end; i++) {
slice[count] = array[i];
count++;
}
return slice;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/XMLAssertion.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java
|
Method name: byte[] getByteArraySlice(byte[], int, int)
|
|
Method name: byte[] getByteArraySlice(byte[], int, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | byte[] slice = new byte[(end - begin + 1)];↵ | | 1 | byte[] slice = new byte[(end - begin + 1)];↵
|
2 | int count = 0;↵ | | 2 | int count = 0;↵
|
3 | for (int i = begin; i <= end; i++) {↵ | | 3 | for (int i = begin; i <= end; i++) {↵
|
4 | slice[count] = array[i];↵ | | 4 | slice[count] = array[i];↵
|
5 | count++;↵ | | 5 | count++;↵
|
6 | }↵ | | 6 | }↵
|
|
7 | return slice; | | 7 | return slice;
|
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 different classes |
Number of node comparisons | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | byte[] slice = new byte[(end - begin + 1)]; | | 1 | byte[] slice = new byte[(end - begin + 1)]; |
2 | int count = 0; | | 2 | int count = 0; |
3 | for (int i = begin; i <= end; i++) | | 3 | for (int i = begin; i <= end; i++) |
4 | | | 4 | |
5 | | | 5 | |
6 | return slice; | | 6 | return slice; |
Precondition Violations (0)
Row |
Violation |