Enumeration e = inheritedProperties.keys(); while (e.hasMoreElements()) { String arg = e.nextElement().toString(); if (other.getUserProperty(arg) != null) { continue; } Object value = inheritedProperties.get(arg); other.setInheritedProperty(arg, value.toString()); }
Enumeration e = userProperties.keys(); while (e.hasMoreElements()) { Object arg = e.nextElement(); if (inheritedProperties.containsKey(arg)) { continue; } Object value = userProperties.get(arg); other.setUserProperty(arg.toString(), value.toString()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PropertyHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PropertyHelper.java
Method name: void copyInheritedProperties(Project) Method name: void copyUserProperties(Project)
Number of AST nodes: 7 Number of AST nodes: 7
1
Enumeration e = inheritedProperties.keys();
1
Enumeration e = userProperties.keys();
2
        while (e.hasMoreElements()) {
2
        while (e.hasMoreElements()) {
3
            String arg = e.nextElement().toString();
3
            Object arg = e.nextElement();
4
            if (other.getUserProperty(arg) != null) {
4
            if (inheritedProperties.containsKey(arg)) {
5
                continue;
5
                continue;
6
            }
6
            }
7
            Object value = inheritedProperties.get(arg);
7
            Object value = userProperties.get(arg);
8
            other.setInheritedProperty(arg, value.toString());
8
            other.setUserProperty(arg.toString(), value.toString());
9
        }
9
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons1