for (Enumeration e = vendorTools.elements(); e.hasMoreElements();) { HotDeploymentTool tool = (HotDeploymentTool) e.nextElement(); tool.validateAttributes(); tool.deploy(); }
if (!(sysprops.isEmpty())) { for (Enumeration en = sysprops.elements(); en.hasMoreElements();) { Environment.Variable entry = (Environment.Variable) en.nextElement(); javaTask.addSysproperty(entry); } }
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/ejb/WeblogicDeploymentTool.java
Method name: void execute() Method name: void buildWeblogicJar(File, File, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (!(sysprops.isEmpty())) {
1
for (Enumeration e = vendorTools.elements();
2
                for (Enumeration en = sysprops.elements();
2
             e.hasMoreElements();) {
3
 en.hasMoreElements();) {
3
            HotDeploymentTool tool = (HotDeploymentTool
4
                    Environment.Variable entry
4
) e.nextElement();
5
                        = (Environment.Variable) en.nextElement();
5
            tool.validateAttributes();
6
            
6
            tool.deploy();
7
        javaTask.addSysproperty(entry);
8
                }
7
        }
9
            }
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
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.8
    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(); )
    14
    for (Enumeration en = sysprops.elements(); en.hasMoreElements(); )
    Differences
    Expression1Expression2Difference
    eenVARIABLE_NAME_MISMATCH
    vendorToolssyspropsVARIABLE_NAME_MISMATCH
    eenVARIABLE_NAME_MISMATCH
    14
    for (Enumeration en = sysprops.elements(); en.hasMoreElements(); )
    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
    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
                                      
                                                                                                                                                
    15
    Environment.Variable entry = (Environment.Variable)en.nextElement();
    Preondition Violations
    Unmatched statement Environment.Variable entry=(Environment.Variable)en.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    Environment.Variable entry = (Environment.Variable)en.nextElement();
                                                                          
    16
    javaTask.addSysproperty(entry);
    Precondition Violations (4)
    Row Violation
    1Unmatched 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
    2Unmatched statement tool.validateAttributes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement tool.deploy(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement Environment.Variable entry=(Environment.Variable)en.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted