Path result = (Path) super.clone(); result.union = union == null ? union : (Union) union.clone(); return result;
while (e.hasMoreElements()) { Property p = (Property) e.nextElement(); p.setProject(newProject); p.execute(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Path.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Ant.java
Method name: Object clone() Method name: void overrideProperties()
Number of AST nodes: 3 Number of AST nodes: 4
1
Path result = (Path) super.clone();
2
            result.union = union == null ? union : (Union) union.clone();
3
            return result;
1
while (e.hasMoreElements()) {
2
            Property p = (Property) e.nextElement();
3
            p.setProject(newProject);
4
            p.execute();
5
        }
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    Path result = (Path)super.clone();
    2
    Path result = (Path)super.clone();
    10
    Property p = (Property)e.nextElement();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.taskdefs.PropertySUBCLASS_TYPE_MISMATCH
    resultpVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.taskdefs.PropertySUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.Pathorg.apache.tools.ant.taskdefs.PropertySUBCLASS_TYPE_MISMATCH
    super.clone()e.nextElement()TYPE_COMPATIBLE_REPLACEMENT
    10
    Property p = (Property)e.nextElement();
                                                              
    11
    p.setProject(newProject);
    Preondition Violations
    Unmatched statement p.setProject(newProject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    p.setProject(newProject);
                                    
    12
    p.execute();
    Preondition Violations
    Unmatched statement p.execute(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    p.execute();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement p.setProject(newProject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement p.execute(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variable result with type org.apache.tools.ant.types.Path , while Clone fragment #2 returns variable p with type org.apache.tools.ant.taskdefs.Property