if (value != null) { // What's the difference between id and name ? if (!context.isIgnoringProjectTag()) { project.addReference(value, project); } }
if (!LoaderUtils.isContextLoaderAvailable()) { return null; } return LoaderUtils.getContextClassLoader();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/ProjectHelper2.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ProjectHelper.java
Method name: void onStartElement(String, String, String, Attributes, AntXMLContext) Method name: ClassLoader getContextClassLoader()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (value != null) {
1
if (
2
                        // What's the difference between id and name ?
3
                        if (!context.isIgnoringProjectTag()) {
2
!LoaderUtils.isContextLoaderAvailable()) {
4
             
3
            return null;
5
       
4
        }
6
        project.addReference(value, project);
5
        
7
                        }
8
                    }
6
return LoaderUtils.getContextClassLoader();
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.1
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    24
    if (!context.isIgnoringProjectTag())
    24
    if (!context.isIgnoringProjectTag())
    1
    if (!LoaderUtils.isContextLoaderAvailable())
    Differences
    Expression1Expression2Difference
    isIgnoringProjectTagisContextLoaderAvailableMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.helper.AntXMLContextorg.apache.tools.ant.util.LoaderUtilsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.helper.AntXMLContext of variable context does not match with type org.apache.tools.ant.util.LoaderUtils of variable LoaderUtils
    • Make classes org.apache.tools.ant.helper.AntXMLContext and org.apache.tools.ant.util.LoaderUtils extend a common superclass
    1
    if (!LoaderUtils.isContextLoaderAvailable())
                                  
    2
    return null;
    Preondition Violations
    Unmatched return null;
    2
    return null;
    25
    project.addReference(value, project);
                                                                                    
                                                                                                
    3
    return LoaderUtils.getContextClassLoader();
    Preondition Violations
    Unmatched return LoaderUtils.getContextClassLoader();
    3
    return LoaderUtils.getContextClassLoader();
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.helper.AntXMLContext of variable context does not match with type org.apache.tools.ant.util.LoaderUtils of variable LoaderUtils
    2Unmatched return null;
    3Unmatched return LoaderUtils.getContextClassLoader();