log("force loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findClass(classname); } return theClass;
log("force system loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findBaseClass(classname); } return theClass;
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: Class forceLoadClass(String) Method name: Class forceLoadSystemClass(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
log("force loading " + classname, Project.MSG_DEBUG);
1
log("force system loading " + classname, Project.MSG_DEBUG);
2
        Class theClass = findLoadedClass(classname);
2
        Class theClass = findLoadedClass(classname);
3
        if (theClass == null) {
3
        if (theClass == null) {
4
            theClass = findClass(classname);
4
            theClass = findBaseClass(classname);
5
        }
5
        }
6
        return theClass;
6
        return theClass;
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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    log("force loading " + classname, Project.MSG_DEBUG);
    1
    log("force loading " + classname, Project.MSG_DEBUG);
    1
    log("force system loading " + classname, Project.MSG_DEBUG);
    Differences
    Expression1Expression2Difference
    "force loading ""force system loading "LITERAL_VALUE_MISMATCH
    1
    log("force system loading " + classname, Project.MSG_DEBUG);
    2
    Class theClass = findLoadedClass(classname);
    2
    Class theClass = findLoadedClass(classname);
    3
    if (theClass == null)
    3
    if (theClass == null)
    4
    theClass = findClass(classname);
    4
    theClass = findClass(classname);
    4
    theClass = findBaseClass(classname);
    Differences
    Expression1Expression2Difference
    findClassfindBaseClassMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression findClass(classname) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression findBaseClass(classname) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method findBaseClass
    4
    theClass = findBaseClass(classname);
    5
    return theClass;
    5
    return theClass;
    Precondition Violations (2)
    Row Violation
    1Expression findClass(classname) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression findBaseClass(classname) is a method call throwing exception(s) that should be caught by a try block that will be extracted