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 | }
|
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.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 17 |
-
{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 |
36 | if (cacheClass != null) | | 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); | | | |
| | | | |
| | | 32 | algorithm = defaultAlgorithm; |
38 | | | | |
Precondition Violations (0)
Row |
Violation |