if (fos != null) { fos.close(); }
if (manifest == null) { if (manifestFile != null) { // if we haven't got the manifest yet, attempt to // get it now and have manifest be the final merge manifest = getManifest(manifestFile); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Exec.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Jar.java
Method name: void logFlush() Method name: Manifest createManifest()
Number of AST nodes: 2 Number of AST nodes: 3
1
if (fos != null) {
1
if (
2
          fos.close();
2
manifest == null) {
3
                if (manifestFile != null) {
4
                    // if we haven't got the manifest yet, attempt to
5
                    // get it now and have manifest be the final merge
6
                    manifest = getManifest(manifestFile);
7
                }
3
        }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (fos != null)
    1
    if (fos != null)
    4
    if (manifestFile != null)
    Differences
    Expression1Expression2Difference
    fosmanifestFileVARIABLE_NAME_MISMATCH
    java.io.PrintWriterjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.PrintWriter of variable fos does not match with type java.io.File of variable manifestFile
    • Make classes java.io.PrintWriter and java.io.File extend a common superclass
    4
    if (manifestFile != null)
    2
    fos.close();
                                  
                                                                                
    5
    manifest = getManifest(manifestFile);
    Precondition Violations (1)
    Row Violation
    1Type java.io.PrintWriter of variable fos does not match with type java.io.File of variable manifestFile