File resource = new File(element, resourceLocation); if (resource.exists()) { return resource; }
File resource = new File(file, resourceName); if (resource.exists()) { return new FileInputStream(resource); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/depend/AbstractAnalyzer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
Method name: File getResourceContainer(String, String[]) Method name: InputStream getResourceStream(File, String)
Number of AST nodes: 3 Number of AST nodes: 3
1
File resource = new File(element, resourceLocation);
1
File resource = new File(file, resourceName);
2
                if (resource.exists()) {
2
                if (resource.exists()) {
3
                    return resource;
3
                    return new FileInputStream(resource);
4
                }
4
                }
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    File resource = new File(element, resourceLocation);
    6
    File resource = new File(element, resourceLocation);
    5
    File resource = new File(file, resourceName);
    Differences
    Expression1Expression2Difference
    elementfileVARIABLE_NAME_MISMATCH
    resourceLocationresourceNameVARIABLE_NAME_MISMATCH
    5
    File resource = new File(file, resourceName);
    7
    if (resource.exists())
    6
    if (resource.exists())
                                                                                    
    7
    return new FileInputStream(resource);
    8
    return resource;
    8
    return resource;
    Preondition Violations
    Unmatched statement return resource; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return resource;
                                          
    Precondition Violations (2)
    Row Violation
    1Unmatched statement return resource; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return resource;