if (parent == null) { return getSystemResourceAsStream(name); } else { return parent.getResourceAsStream(name); }
if (parent == null) { return findSystemClass(name); } else { return parent.loadClass(name); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
Method name: InputStream loadBaseResource(String) Method name: Class findBaseClass(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (parent == null) {
1
if (parent == null) {
2
            return getSystemResourceAsStream(name);
2
            return findSystemClass(name);
3
        } else {
3
        } else {
4
            return parent.getResourceAsStream(name);
4
            return parent.loadClass(name);
5
        }
5
        }
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 declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (parent == null)
    1
    if (parent == null)
                                                                    
    2
    return findSystemClass(name);
    Preondition Violations
    Unmatched return findSystemClass(name);
    2
    return findSystemClass(name);
    2
    return getSystemResourceAsStream(name);
    2
    return getSystemResourceAsStream(name);
    Preondition Violations
    Unmatched return getSystemResourceAsStream(name);
                                                                                        
    else
            
                                                                      
    3
    return parent.loadClass(name);
    Preondition Violations
    Unmatched statement return parent.loadClass(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return parent.loadClass(name);
    3
    return parent.loadClass(name);
    3
    return parent.getResourceAsStream(name);
    3
    return parent.getResourceAsStream(name);
    Preondition Violations
    Unmatched statement return parent.getResourceAsStream(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return parent.getResourceAsStream(name);
                                                                                          
    Precondition Violations (6)
    Row Violation
    1Unmatched return findSystemClass(name);
    2Unmatched return getSystemResourceAsStream(name);
    3Unmatched statement return parent.loadClass(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return parent.loadClass(name);
    5Unmatched statement return parent.getResourceAsStream(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return parent.getResourceAsStream(name);