while (e.hasMoreElements()) { PropertySet ps = (PropertySet) e.nextElement(); allProps.putAll(ps.getProperties()); }
PropertySet ps = (PropertySet) e.nextElement(); p.putAll(ps.getProperties());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/EchoProperties.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/CommandlineJava.java
Method name: void execute() Method name: Properties mergePropertySets()
Number of AST nodes: 3 Number of AST nodes: 2
1
while (e.hasMoreElements()) {
2
            PropertySet ps = (PropertySet) e.nextElement();
1
PropertySet ps = (PropertySet) e.nextElement();
3
            allProps.putAll(ps.getProperties());
2
                p.putAll(ps.getProperties());
4
        }
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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
    27
    PropertySet ps = (PropertySet)e.nextElement();
    3
    PropertySet ps = (PropertySet)e.nextElement();
    28
    allProps.putAll(ps.getProperties());
    28
    allProps.putAll(ps.getProperties());
    4
    p.putAll(ps.getProperties());
    Differences
    Expression1Expression2Difference
    allPropspVARIABLE_NAME_MISMATCH
    java.util.Hashtablejava.util.PropertiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Hashtable of variable allProps does not match with type java.util.Properties of variable p
    • Make classes java.util.Hashtable and java.util.Properties extend a common superclass
    4
    p.putAll(ps.getProperties());
    Precondition Violations (1)
    Row Violation
    1Type java.util.Hashtable of variable allProps does not match with type java.util.Properties of variable p