fis2.read(buffer2);
for (int i = 0; i < read; ++i, ++index) {
if (buffer1[i] != buffer2[i]) {
System.out.println("Bytes mismatch:" + name1 + ", " + name2 +
" at byte " + index);
return false;
}
}
fis2.read(buffer2);
for (int i = 0; i < read; ++i, ++index) {
if (buffer1[i] != buffer2[i]) {
System.out.println("Bytes mismatch:" + name1 + ", " + name2 +
" at byte " + index);
return false;
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/i18n/TranslateTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/FilterSetTest.java
|
Method name: boolean compareFiles(String, String)
|
|
Method name: boolean compareFiles(String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | fis2.read(buffer2);↵ | | 1 | fis2.read(buffer2);↵
|
2 | for (int i = 0; i < read; ++i, ++index) {↵ | | 2 | for (int i = 0; i < read; ++i, ++index) {↵
|
3 | if (buffer1[i] != buffer2[i]) {↵ | | 3 | if (buffer1[i] != buffer2[i]) {↵
|
4 | System.out.println("Bytes mismatch:" + name1 + ", " + name2 +↵ | | 4 | System.out.println("Bytes mismatch:" + name1 + ", " + name2 +↵
|
5 | " at byte " + index);↵ | | 5 | " at byte " + index);↵
|
6 | return false;↵ | | 6 | return false;↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Non-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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | fis2.read(buffer2); | | 17 | fis2.read(buffer2); |
18 | for (int i = 0; i < read; ++i, ++index) | | 18 | for (int i = 0; i < read; ++i, ++index) |
19 | if (buffer1[i] != buffer2[i]) | | 19 | if (buffer1[i] != buffer2[i]) |
20 | System.out.println("Bytes mismatch:" + name1 + ", " + name2 + " at byte " + index); | | 20 | System.out.println("Bytes mismatch:" + name1 + ", " + name2 + " at byte " + index); |
21 | | | 21 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return false; |
2 | Conditional return false; |