while (e.hasMoreElements()) { String arg = e.nextElement().toString(); if (other.getUserProperty(arg) != null) { continue; } Object value = inheritedProperties.get(arg); other.setInheritedProperty(arg, value.toString()); }
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: 6 Number of AST nodes: 6
1
while (e.hasMoreElements()) {
1
while (e.hasMoreElements()) {
2
            String arg = e.nextElement().toString();
2
            Object arg = e.nextElement();
3
            if (other.getUserProperty(arg) != null) {
3
            if (inheritedProperties.containsKey(arg)) {
4
                continue;
4
                continue;
5
            }
5
            }
6
            Object value = inheritedProperties.get(arg);
6
            Object value = userProperties.get(arg);
7
            other.setInheritedProperty(arg, value.toString());
7
            other.setUserProperty(arg.toString(), value.toString());
8
        }
8
        }
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