for (Enumeration e = additionalUserProperties.keys(); e.hasMoreElements();) { String key = (String) e.nextElement(); String property = additionalUserProperties.getProperty(key); definedProps.put(key, property); }
for (Enumeration e = props.keys(); e.hasMoreElements();) { String key = (String) e.nextElement(); String value = props.getProperty(key); hash.put(key, value); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ReplaceTokens.java
Method name: void startAnt(String[], Properties, ClassLoader) Method name: void initialize()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (Enumeration e = additionalUserProperties.keys();
1
for (Enumeration e = 
2
                    e.hasMoreElements();) {
2
props.keys(); e.hasMoreElements();) {
3
                String key = (String) e.nextElement();
3
                            String key = (String) e.nextElement();
4
                String property = additionalUserProperties.getProperty(key);
4
                            String value = props.getProperty(key);
5
                definedProps.put(key, property);
5
                
6
            hash.put(key, value);
6
            }
7
                        }
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 different classes
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    for (Enumeration e = additionalUserProperties.keys(); e.hasMoreElements(); )
    5
    for (Enumeration e = additionalUserProperties.keys(); e.hasMoreElements(); )
    23
    for (Enumeration e = props.keys(); e.hasMoreElements(); )
    Differences
    Expression1Expression2Difference
    additionalUserPropertiespropsVARIABLE_NAME_MISMATCH
    23
    for (Enumeration e = props.keys(); e.hasMoreElements(); )
    6
    String key = (String)e.nextElement();
    24
    String key = (String)e.nextElement();
    7
    String property = additionalUserProperties.getProperty(key);
    7
    String property = additionalUserProperties.getProperty(key);
    25
    String value = props.getProperty(key);
    Differences
    Expression1Expression2Difference
    propertyvalueVARIABLE_NAME_MISMATCH
    additionalUserPropertiespropsVARIABLE_NAME_MISMATCH
    25
    String value = props.getProperty(key);
    8
    definedProps.put(key, property);
    8
    definedProps.put(key, property);
    26
    hash.put(key, value);
    Differences
    Expression1Expression2Difference
    propertyvalueVARIABLE_NAME_MISMATCH
    definedPropshashVARIABLE_NAME_MISMATCH
    java.util.Propertiesjava.util.HashtableSUBCLASS_TYPE_MISMATCH
    26
    hash.put(key, value);
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.apache.tools.ant.Main and org.apache.tools.ant.filters.ReplaceTokens do not have a common superclass