for (Enumeration e = vendorTools.elements(); e.hasMoreElements();) { HotDeploymentTool tool = (HotDeploymentTool) e.nextElement(); tool.validateAttributes(); tool.deploy(); }
for (Enumeration e = entries.elements(); e.hasMoreElements();) { Entry entry = (Entry) e.nextElement(); entry.executeOn(properties); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Method name: void execute() Method name: void executeOperation()
Number of AST nodes: 4 Number of AST nodes: 3
1
for (Enumeration e = vendorTools.elements();
1
for (Enumeration e = entries.elements();
2
             e.hasMoreElements();) {
2
 e.hasMoreElements();) {
3
            HotDeploymentTool tool = (HotDeploymentTool) e.nextElement();
3
            Entry entry = (Entry) e.nextElement();
4
            tool.validateAttributes();
4
            
5
            tool.deploy();
5
entry.executeOn(properties);
6
        }
6
        }
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 comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (Enumeration e = vendorTools.elements(); e.hasMoreElements(); )
    1
    for (Enumeration e = vendorTools.elements(); e.hasMoreElements(); )
    1
    for (Enumeration e = entries.elements(); e.hasMoreElements(); )
    Differences
    Expression1Expression2Difference
    vendorToolsentriesVARIABLE_NAME_MISMATCH
    1
    for (Enumeration e = entries.elements(); e.hasMoreElements(); )
                                                                                
    2
    Entry entry = (Entry)e.nextElement();
    Preondition Violations
    Unmatched statement Entry entry=(Entry)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    Entry entry = (Entry)e.nextElement();
    2
    HotDeploymentTool tool = (HotDeploymentTool)e.nextElement();
    2
    HotDeploymentTool tool = (HotDeploymentTool)e.nextElement();
    Preondition Violations
    Unmatched statement HotDeploymentTool tool=(HotDeploymentTool)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
                                                                  
    3
    entry.executeOn(properties);
    Preondition Violations
    Unmatched statement entry.executeOn(properties); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    entry.executeOn(properties);
    3
    tool.validateAttributes();
    3
    tool.validateAttributes();
    Preondition Violations
    Unmatched statement tool.validateAttributes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    4
    tool.deploy();
    4
    tool.deploy();
    Preondition Violations
    Unmatched statement tool.deploy(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                      
    Precondition Violations (5)
    Row Violation
    1Unmatched statement Entry entry=(Entry)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement HotDeploymentTool tool=(HotDeploymentTool)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement entry.executeOn(properties); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement tool.validateAttributes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement tool.deploy(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted