if (name == null) { return null; } Object o = getPropertyHook(ns, name, true); if (o != null) { return o; } return userProperties.get(name);
if (name == null) { return null; } Object o = getPropertyHook(ns, name, false); if (o != null) { return o; } return properties.get(name);
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: Object getUserProperty(String, String) Method name: Object getProperty(String, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (name == null) {
1
if (name == null) {
2
            return null;
2
            return null;
3
        }
3
        }
4
        Object o = getPropertyHook(ns, name, true);
4
        Object o = getPropertyHook(ns, name, false);
5
        if (o != null) {
5
        if (o != null) {
6
            return o;
6
            return o;
7
        }
7
        }
8
        return  userProperties.get(name);
8
        return properties.get(name);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (name == null)
    1
    if (name == null)
    2
    return null;
    2
    return null;
    3
    Object o = getPropertyHook(ns, name, true);
    3
    Object o = getPropertyHook(ns, name, true);
    3
    Object o = getPropertyHook(ns, name, false);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    3
    Object o = getPropertyHook(ns, name, false);
    4
    if (o != null)
    4
    if (o != null)
    5
    return o;
    5
    return o;
    6
    return userProperties.get(name);
    6
    return userProperties.get(name);
    6
    return properties.get(name);
    Differences
    Expression1Expression2Difference
    userPropertiespropertiesVARIABLE_NAME_MISMATCH
    6
    return properties.get(name);
    Precondition Violations (0)
    Row Violation