deploymentDescriptor = descr; if (!deploymentDescriptor.exists()) { throw new BuildException("Deployment descriptor: " + deploymentDescriptor + " does not exist."); } // Create a ZipFileSet for this file, and pass it up. ZipFileSet fs = new ZipFileSet(); fs.setFile(deploymentDescriptor); fs.setFullpath("META-INF/application.xml"); super.addFileset(fs);
deploymentDescriptor = descr; if (!deploymentDescriptor.exists()) { throw new BuildException("Deployment descriptor: " + deploymentDescriptor + " does not exist."); } // Create a ZipFileSet for this file, and pass it up. ZipFileSet fs = new ZipFileSet(); fs.setFile(deploymentDescriptor); fs.setFullpath(XML_DESCRIPTOR_PATH); super.addFileset(fs);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Ear.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/War.java
Method name: void setAppxml(File) Method name: void setWebxml(File)
Number of AST nodes: 7 Number of AST nodes: 7
1
deploymentDescriptor = descr;
1
deploymentDescriptor = descr;
2
        if (!deploymentDescriptor.exists()) {
2
        if (!deploymentDescriptor.exists()) {
3
            throw new BuildException("Deployment descriptor: "
3
            throw new BuildException("Deployment descriptor: "
4
                                     + deploymentDescriptor
4
                                     + deploymentDescriptor
5
                                     + " does not exist.");
5
                                     + " does not exist.");
6
        }
6
        }
7
        // Create a ZipFileSet for this file, and pass it up.
7
        // Create a ZipFileSet for this file, and pass it up.
8
        ZipFileSet fs = new ZipFileSet();
8
        ZipFileSet fs = new ZipFileSet();
9
        fs.setFile(deploymentDescriptor);
9
        fs.setFile(deploymentDescriptor);
10
        fs.setFullpath("META-INF/application.xml");
10
        fs.setFullpath(XML_DESCRIPTOR_PATH);
11
        super.addFileset(fs);
11
        super.addFileset(fs);
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 comparisons15
  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)157.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    deploymentDescriptor = descr;
    1
    deploymentDescriptor = descr;
    2
    if (!deploymentDescriptor.exists())
    2
    if (!deploymentDescriptor.exists())
    3
    throw new BuildException("Deployment descriptor: " + deploymentDescriptor + " does not exist.");
    3
    throw new BuildException("Deployment descriptor: " + deploymentDescriptor + " does not exist.");
    4
    ZipFileSet fs = new ZipFileSet();
    4
    ZipFileSet fs = new ZipFileSet();
    5
    fs.setFile(deploymentDescriptor);
    5
    fs.setFile(deploymentDescriptor);
    6
    fs.setFullpath("META-INF/application.xml");
    6
    fs.setFullpath("META-INF/application.xml");
    6
    fs.setFullpath(XML_DESCRIPTOR_PATH);
    Differences
    Expression1Expression2Difference
    "META-INF/application.xml"XML_DESCRIPTOR_PATHTYPE_COMPATIBLE_REPLACEMENT
    6
    fs.setFullpath(XML_DESCRIPTOR_PATH);
    7
    super.addFileset(fs);
    7
    super.addFileset(fs);
    7
    super.addFileset(fs);
    Preondition Violations
    Super method call super.addFileset(fs); cannot be extracted from method
    Super method call super.addFileset(fs); cannot be extracted from method
    7
    super.addFileset(fs);
    Precondition Violations (2)
    Row Violation
    1Super method call super.addFileset(fs); cannot be extracted from method
    2Super method call super.addFileset(fs); cannot be extracted from method