if (comparatorClass != null) { // use Algorithm specified by classname comparator = (Comparator) loadClass( comparatorClass, "is not a Comparator.", Comparator.class); } else { // nothing specified - use default comparator = defaultComparator; }
if (cacheClass != null) { // use Cache specified by classname cache = (Cache) loadClass(cacheClass, "is not a Cache.", Cache.class); } else { // nothing specified - use default cache = defaultCache; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
Method name: void configure() Method name: void configure()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (comparatorClass != null) {
1
if (cacheClass != null) {
2
                // use Algorithm specified by classname
2
                // use Cache specified by classname
3
                comparator = (Comparator) loadClass(
3
                c
4
                    comparatorClass,
5
                    "is not a Comparator.",
6
                    Comparator.class);
4
ache = (Cache) loadClass(cacheClass, "is not a Cache.", Cache.class);
7
            } else {
5
            } else {
8
                // nothing specified - use default
6
                // nothing specified - use default
9
                comparator = defaultComparator;
7
                cache = defaultCache;
10
            }
8
            }
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.6
Clones locationClones are in the same method
Number of node comparisons15
  1. {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
    44
    if (comparatorClass != null)
    44
    if (comparatorClass != null)
    36
    if (cacheClass != null)
    Differences
    Expression1Expression2Difference
    comparatorClasscacheClassVARIABLE_NAME_MISMATCH
    36
    if (cacheClass != null)
                                                                                                                                              
    37
    cache = (Cache)loadClass(cacheClass, "is not a Cache.", Cache.class);
    45
    comparator = (Comparator)loadClass(comparatorClass, "is not a Comparator.", Comparator.class);
                                                                                                                                                                                                
    else
            
                                                  
    38
    cache = defaultCache;
    46
    comparator = defaultComparator;
                                                                      
    Precondition Violations (0)
    Row Violation