if (!f.delete()) { throw new BuildException("Unable to delete file " + f.getAbsolutePath()); }
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/taskdefs/Deltree.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ProjectHelper.java
Method name: void removeDir(File) Method name: ClassLoader getContextClassLoader()
Number of AST nodes: 2 Number of AST nodes: 3
1
if (!f.delete()) {
1
if (!
2
                    throw new BuildException("Unable to delete file "
2
LoaderUtils.isContextLoaderAvailable()) {
3
            return null;
3
        
4
        }
4
                                     + f.getAbsolutePath());
5
        
5
                }
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.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    7
    if (!f.delete())
    7
    if (!f.delete())
    1
    if (!LoaderUtils.isContextLoaderAvailable())
    Differences
    Expression1Expression2Difference
    deleteisContextLoaderAvailableMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Fileorg.apache.tools.ant.util.LoaderUtilsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File of variable f does not match with type org.apache.tools.ant.util.LoaderUtils of variable LoaderUtils
    • Make classes java.io.File 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;
    8
    throw new BuildException("Unable to delete file " + f.getAbsolutePath());
    8
    throw new BuildException("Unable to delete file " + f.getAbsolutePath());
    Preondition Violations
    Unmatched throw new BuildException("Unable to delete file " + f.getAbsolutePath());
                                                                                                                                                            
                                                                                                
    3
    return LoaderUtils.getContextClassLoader();
    Preondition Violations
    Unmatched return LoaderUtils.getContextClassLoader();
    3
    return LoaderUtils.getContextClassLoader();
    Precondition Violations (4)
    Row Violation
    1Type java.io.File of variable f does not match with type org.apache.tools.ant.util.LoaderUtils of variable LoaderUtils
    2Unmatched return null;
    3Unmatched throw new BuildException("Unable to delete file " + f.getAbsolutePath());
    4Unmatched return LoaderUtils.getContextClassLoader();