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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
44 | if (comparatorClass != null) | | 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); | | | |
| | | | |
| | | 38 | |
46 | comparator = defaultComparator; | | | |
Precondition Violations (0)
Row |
Violation |