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
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 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
    return false;
    21
    return false;
    21
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    21
    return false;
    Precondition Violations (2)
    Row Violation
    1Conditional return false;
    2Conditional return false;