for (int i = 0, lastShadow = this.last; i <= lastShadow; i++) { if (fmap[i] == 0) { this.origPtr = i; break; } }
for (int i = offset; i < end; ++i) { if (header[i] == 0) { break; } result.append((char) header[i]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java File path: /apache-ant-1.7.0/src/org/apache/tools/tar/TarUtils.java
Method name: void blockSort() Method name: StringBuffer parseName(byte[], int, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0, lastShadow = this.last; i <= lastShadow; i++) {
1
for (int i = offset; i < end; ++i) {
2
            if (fmap[i] == 0) {
2
            if (header[i] == 0) {
3
                this.origPtr = i;
3
                break;
4
            
4
            }
5
    break;
5
    
6
            }
6
        result.append((char) header[i]);
7
        }
7
        }
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.2
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    14
    if (fmap[i] == 0)
    14
    if (fmap[i] == 0)
    4
    if (header[i] == 0)
    Differences
    Expression1Expression2Difference
    fmapheaderVARIABLE_NAME_MISMATCH
    int[]byte[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int[] of variable fmap does not match with type byte[] of variable header
    • Make classes int[] and byte[] extend a common superclass
    4
    if (header[i] == 0)
    15
    this.origPtr = i;
    15
    this.origPtr = i;
    Preondition Violations
    Unmatched statement this.origPtr=i; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    16
    break;
    16
    break;
    5
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    5
    break;
    Precondition Violations (4)
    Row Violation
    1Type int[] of variable fmap does not match with type byte[] of variable header
    2Unmatched statement this.origPtr=i; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Statement break; without innermost loop
    4Statement break; without innermost loop