if (rc.size() != 1) { throw new BuildException("The style element must be specified" + " with exactly one nested resource."); } setXslResource((Resource) rc.iterator().next());
if (a.size() != 1) { throw new BuildException("only single argument resource collections" + " are supported as archives"); } setSrcResource((Resource) a.iterator().next());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XSLTProcess.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Pack.java
Method name: void addConfiguredStyle(Resources) Method name: void addConfigured(ResourceCollection)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (rc.size() != 1) {
1
if (a.size() != 1) {
2
            throw new BuildException("The style element must be specified"
2
            throw new BuildException("
3
                    + " with exactly one nested resource.
3
only single argument resource collections"
4
");
4
                                     + " are supported as archives");
5
        }
5
        }
6
        setXslResource((Resource) rc.iterator().next());
6
        setSrcResource((Resource) a.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.1
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)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (rc.size() != 1)
    1
    if (rc.size() != 1)
    1
    if (a.size() != 1)
    Differences
    Expression1Expression2Difference
    rcaVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.resources.Resourcesorg.apache.tools.ant.types.ResourceCollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.resources.Resources of variable rc does not match with type org.apache.tools.ant.types.ResourceCollection of variable a
    • Make classes org.apache.tools.ant.types.resources.Resources and org.apache.tools.ant.types.ResourceCollection extend a common superclass
    1
    if (a.size() != 1)
    2
    throw new BuildException("The style element must be specified" + " with exactly one nested resource.");
    2
    throw new BuildException("The style element must be specified" + " with exactly one nested resource.");
    2
    throw new BuildException("only single argument resource collections" + " are supported as archives");
    Differences
    Expression1Expression2Difference
    "The style element must be specified""only single argument resource collections"LITERAL_VALUE_MISMATCH
    " with exactly one nested resource."" are supported as archives"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("only single argument resource collections" + " are supported as archives");
                                                                                                      
    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
    3
    setSrcResource((Resource)a.iterator().next());
    3
    setXslResource((Resource)rc.iterator().next());
    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
                                                                                                        
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.types.resources.Resources of variable rc does not match with type org.apache.tools.ant.types.ResourceCollection of variable a
    2Unmatched 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
    3Unmatched 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