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; }
if (algorithmClass != null) { // use Algorithm specified by classname algorithm = (Algorithm) loadClass( algorithmClass, "is not an Algorithm.", Algorithm.class); } else { // nothing specified - use default algorithm = defaultAlgorithm; }
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 (cacheClass != null) {
1
if (algorithmClass != null) {
2
                // use Cache specified by classname
2
                // use Algorithm specified by classname
3
                cache = (Cache) loadClass(cacheClass, "is not a Cache.", Cache
3
                algorithm = (Algorithm) loadClass(
4
                    algorithmClass,
5
                    "is not an Algorithm.",
4
.class);
6
                    Algorithm.class);
5
            } else {
7
            } else {
6
                // nothing specified - use default
8
                // nothing specified - use default
7
                cache = defaultCache;
9
                algorithm = defaultAlgorithm;
8
            }
10
            }
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.7
Clones locationClones are in the same method
Number of node comparisons17
  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
    36
    if (cacheClass != null)
    36
    if (cacheClass != null)
    30
    if (algorithmClass != null)
    Differences
    Expression1Expression2Difference
    cacheClassalgorithmClassVARIABLE_NAME_MISMATCH
    30
    if (algorithmClass != null)
                                                                                                                                                                                        
    31
    algorithm = (Algorithm)loadClass(algorithmClass, "is not an Algorithm.", Algorithm.class);
    37
    cache = (Cache)loadClass(cacheClass, "is not a Cache.", Cache.class);
                                                                                                                                              
    else
            
                                                                  
    32
    algorithm = defaultAlgorithm;
    38
    cache = defaultCache;
                                                  
    Precondition Violations (0)
    Row Violation