for (Enumeration e = filesets.elements(); e.hasMoreElements();) { tar((TarFileSet) e.nextElement(), tOut); }
for (Enumeration e = resourceCollections.elements(); e.hasMoreElements();) { tar((ResourceCollection) e.nextElement(), tOut); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Tar.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Tar.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (Enumeration e = filesets.elements();
1
for (Enumeration e = resourceCollections.elements();
2
                     e.hasMoreElements();) {
2
                     e.hasMoreElements();) {
3
                    tar((TarFileSet) e.nextElement(), tOut);
3
                    tar((ResourceCollection) e.nextElement(), tOut);
4
                }
4
                }
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.5
Clones locationClones are in the same method
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    36
    for (Enumeration e = filesets.elements(); e.hasMoreElements(); )
    36
    for (Enumeration e = filesets.elements(); e.hasMoreElements(); )
    38
    for (Enumeration e = resourceCollections.elements(); e.hasMoreElements(); )
    Differences
    Expression1Expression2Difference
    filesetsresourceCollectionsVARIABLE_NAME_MISMATCH
    38
    for (Enumeration e = resourceCollections.elements(); e.hasMoreElements(); )
    37
    tar((TarFileSet)e.nextElement(), tOut);
    37
    tar((TarFileSet)e.nextElement(), tOut);
    39
    tar((ResourceCollection)e.nextElement(), tOut);
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.Tar.TarFileSetorg.apache.tools.ant.types.ResourceCollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression (TarFileSet)e.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ResourceCollection)e.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.taskdefs.Tar.TarFileSet of variable (TarFileSet)e.nextElement() does not match with type org.apache.tools.ant.types.ResourceCollection of variable (ResourceCollection)e.nextElement()
    • Make classes org.apache.tools.ant.taskdefs.Tar.TarFileSet and org.apache.tools.ant.types.ResourceCollection extend a common superclass
    39
    tar((ResourceCollection)e.nextElement(), tOut);
    Precondition Violations (3)
    Row Violation
    1Expression (TarFileSet)e.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (ResourceCollection)e.nextElement() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.apache.tools.ant.taskdefs.Tar.TarFileSet of variable (TarFileSet)e.nextElement() does not match with type org.apache.tools.ant.types.ResourceCollection of variable (ResourceCollection)e.nextElement()