BufferedOutputStream bos = null; try { bos = new BufferedOutputStream( new FileOutputStream(new File(dir, linkFileName))); properties.store(bos, "Symlinks from " + dir); } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } finally { FileUtils.close(bos); }
BufferedOutputStream bos = null; try { bos = new BufferedOutputStream(new FileOutputStream(propertyfile)); properties.store(bos, comment); } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } finally { FileUtils.close(bos); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Method name: void writePropertyFile(Properties, File) Method name: void writeFile()
Number of AST nodes: 4 Number of AST nodes: 4
1
BufferedOutputStream bos = null;
1
BufferedOutputStream bos = null;
2
        try {
2
        try {
3
            bos = new BufferedOutputStream(
3
            bos = new BufferedOutputStream(
4
                new FileOutputStream(new File(dir, linkFileName)));
4
new FileOutputStream(propertyfile));
5
            properties.store(bos, "Symlinks from " + dir);
5
            properties.store(bos, comment);
6
        } catch (IOException ioe) {
6
        } catch (IOException ioe) {
7
            throw new BuildException(ioe, getLocation());
7
            throw new BuildException(ioe, getLocation());
8
        } finally {
8
        } finally {
9
            FileUtils.close(bos);
9
            FileUtils.close(bos);
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    BufferedOutputStream bos = null;
    1
    BufferedOutputStream bos = null;
    2
    try
    2
    try
    3
    bos = new BufferedOutputStream(new FileOutputStream(new File(dir, linkFileName)));
    3
    bos = new BufferedOutputStream(new FileOutputStream(new File(dir, linkFileName)));
    3
    bos = new BufferedOutputStream(new FileOutputStream(propertyfile));
    Differences
    Expression1Expression2Difference
    new File(dir,linkFileName)propertyfileTYPE_COMPATIBLE_REPLACEMENT
    3
    bos = new BufferedOutputStream(new FileOutputStream(propertyfile));
    4
    properties.store(bos, "Symlinks from " + dir);
    4
    properties.store(bos, "Symlinks from " + dir);
    4
    properties.store(bos, comment);
    Differences
    Expression1Expression2Difference
    "Symlinks from " + dircommentTYPE_COMPATIBLE_REPLACEMENT
    4
    properties.store(bos, comment);
    Precondition Violations (0)
    Row Violation