if (a.size() != 1) { throw new BuildException("only single argument resource collections" + " are supported as archives"); } setSrcResource((Resource) a.iterator().next());
if (rc.size() != 1) { throw new BuildException("The style element must be specified" + " with exactly one nested resource."); } setXslResource((Resource) rc.iterator().next());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XmlProperty.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XSLTProcess.java
Method name: void addConfigured(ResourceCollection) Method name: void addConfiguredStyle(Resources)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (a.size() != 1) {
1
if (rc.size() != 1) {
2
            throw new BuildException("only single argument resource collections"
2
            throw new BuildException("
3
                                     + " are supported as archives
3
The style element must be specified"
4
");
4
                    + " with exactly one nested resource.");
5
        }
5
        }
6
        setSrcResource((Resource) a.iterator().next());
6
        setXslResource((Resource) rc.iterator().next());
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 having the same super class
Number of node comparisons5
  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 fragment1
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (a.size() != 1)
    1
    if (a.size() != 1)
    1
    if (rc.size() != 1)
    Differences
    Expression1Expression2Difference
    arcVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.ResourceCollectionorg.apache.tools.ant.types.resources.ResourcesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.ResourceCollection of variable a does not match with type org.apache.tools.ant.types.resources.Resources of variable rc
    • Make classes org.apache.tools.ant.types.ResourceCollection and org.apache.tools.ant.types.resources.Resources extend a common superclass
    1
    if (rc.size() != 1)
    2
    throw new BuildException("only single argument resource collections" + " are supported as archives");
    2
    throw new BuildException("only single argument resource collections" + " are supported as archives");
    2
    throw new BuildException("The style element must be specified" + " with exactly one nested resource.");
    Differences
    Expression1Expression2Difference
    "only single argument resource collections""The style element must be specified"LITERAL_VALUE_MISMATCH
    " are supported as archives"" with exactly one nested resource."LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("The style element must be specified" + " with exactly one nested resource.");
                                                                                                        
    3
    setXslResource((Resource)rc.iterator().next());
    Preondition Violations
    Unmatched statement setXslResource((Resource)rc.iterator().next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    setXslResource((Resource)rc.iterator().next());
    3
    setSrcResource((Resource)a.iterator().next());
    3
    setSrcResource((Resource)a.iterator().next());
    Preondition Violations
    Unmatched statement setSrcResource((Resource)a.iterator().next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.types.ResourceCollection of variable a does not match with type org.apache.tools.ant.types.resources.Resources of variable rc
    2Unmatched statement setXslResource((Resource)rc.iterator().next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement setSrcResource((Resource)a.iterator().next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted