written += 12; // file name length byte[] name = getBytes(ze.getName()); writeOut(ZipShort.getBytes(name.length)); written += 2; // extra field length byte[] extra = ze.getLocalFileDataExtra(); writeOut(ZipShort.getBytes(extra.length)); written += 2;
written += 12; // file name length byte[] name = getBytes(ze.getName()); writeOut(ZipShort.getBytes(name.length)); written += 2; // extra field length byte[] extra = ze.getCentralDirectoryExtra(); writeOut(ZipShort.getBytes(extra.length)); written += 2;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/zip/ZipOutputStream.java File path: /apache-ant-1.7.0/src/org/apache/tools/zip/ZipOutputStream.java
Method name: void writeLocalFileHeader(ZipEntry) Method name: void writeCentralFileHeader(ZipEntry)
Number of AST nodes: 7 Number of AST nodes: 7
1
written += 12;
1
written += 12;
2
        // file name length
2
        // file name length
3
        byte[] name = getBytes(ze.getName());
3
        byte[] name = getBytes(ze.getName());
4
        writeOut(ZipShort.getBytes(name.length));
4
        writeOut(ZipShort.getBytes(name.length));
5
        written += 2;
5
        written += 2;
6
        // extra field length
6
        // extra field length
7
        byte[] extra = ze.getLocalFileDataExtra();
7
        byte[] extra = ze.getCentralDirectoryExtra();
8
        writeOut(ZipShort.getBytes(extra.length));
8
        writeOut(ZipShort.getBytes(extra.length));
9
        written += 2;
9
        written += 2;
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.0
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    written += 12;
    18
    written += 12;
    24
    byte[] name = getBytes(ze.getName());
    19
    byte[] name = getBytes(ze.getName());
    25
    writeOut(ZipShort.getBytes(name.length));
    20
    writeOut(ZipShort.getBytes(name.length));
    26
    written += 2;
    21
    written += 2;
    27
    byte[] extra = ze.getLocalFileDataExtra();
    27
    byte[] extra = ze.getLocalFileDataExtra();
    22
    byte[] extra = ze.getCentralDirectoryExtra();
    Differences
    Expression1Expression2Difference
    getLocalFileDataExtragetCentralDirectoryExtraMETHOD_INVOCATION_NAME_MISMATCH
    22
    byte[] extra = ze.getCentralDirectoryExtra();
    28
    writeOut(ZipShort.getBytes(extra.length));
    23
    writeOut(ZipShort.getBytes(extra.length));
    29
    written += 2;
    24
    written += 2;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables name, extra , while Clone fragment #2 returns variables name, extra