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 (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 (comparatorClass != null) {↵ | | 1 | if (algorithmClass != null) {↵
|
2 | // use Algorithm specified by classname↵ | | 2 | // use Algorithm specified by classname↵
|
3 | comparator = (Comparator) loadClass(↵ | | 3 | algorithm = (Algorithm) loadClass(↵
|
4 | comparatorClass,↵ | | 4 | algorithmClass,↵
|
5 | "is not a Comparator.",↵ | | 5 | "is not an Algorithm.",↵
|
6 | Comparator.class);↵ | | 6 | Algorithm.class);↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | // nothing specified - use default↵ | | 8 | // nothing specified - use default↵
|
9 | comparator = defaultComparator;↵ | | 9 | algorithm = defaultAlgorithm;↵
|
10 | } | | 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) | 1.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 21 |
-
{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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
44 | if (comparatorClass != null) | | 30 | if (algorithmClass != null) |
| | | 31 | algorithm = (Algorithm)loadClass(algorithmClass, "is not an Algorithm.", Algorithm.class); |
45 | comparator = (Comparator)loadClass(comparatorClass, "is not a Comparator.", Comparator.class); | | | |
| | | | |
| | | 32 | algorithm = defaultAlgorithm; |
46 | comparator = defaultComparator; | | | |
Precondition Violations (0)
Row |
Violation |