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: 3 Number of AST nodes: 4
1
for (Enumeration e = props.keys(); e.hasMoreElements();) {
1
String key = (String) e.nextElement();
2
                            String key = (String) e.nextElement();
2
                String property = additionalUserProperties.getProperty(key);
3
                            String value = props.getProperty(key);
3
                definedProps.put(key, property);
4
                            hash.put(key, value);
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
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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.HashtableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Properties of variable definedProps does not match with type java.util.Hashtable of variable hash
    • Make classes java.util.Properties and java.util.Hashtable extend a common superclass
    26
    hash.put(key, value);
    Precondition Violations (1)
    Row Violation
    1Type java.util.Properties of variable definedProps does not match with type java.util.Hashtable of variable hash