for (int i = 0; i < max; i++) {
final int component1 = (i < components.length) ? components[ i ] : 0;
final int component2 = (i < other.components.length) ? other.components[ i ] : 0;
if (component2 > component1) {
return false;
}
if (component2 < component1) {
return true;
}
}
for (int i = 0; i < max; i++) {
final int component1 = (i < components.length) ? components[ i ] : 0;
final int component2 = (i < other.components.length) ? other.components[ i ] : 0;
if (component2 > component1) {
return false;
}
if (component2 < component1) {
return true;
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DeweyDecimal.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DeweyDecimal.java
|
Method name: boolean isGreaterThan(DeweyDecimal)
|
|
Method name: boolean isGreaterThanOrEqual(DeweyDecimal)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | for (int i = 0; i < max; i++) {↵ | | 1 | for (int i = 0; i < max; i++) {↵
|
2 | final int component1 = (i < components.length) ? components[ i ] : 0;↵ | | 2 | final int component1 = (i < components.length) ? components[ i ] : 0;↵
|
3 | final int component2 = (i < other.components.length) ? other.components[ i ] : 0;↵ | | 3 | final int component2 = (i < other.components.length) ? other.components[ i ] : 0;↵
|
|
4 | if (component2 > component1) {↵ | | 4 | if (component2 > component1) {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | }↵
|
7 | if (component2 < component1) {↵ | | 7 | if (component2 < component1) {↵
|
8 | return true;↵ | | 8 | return true;↵
|
9 | }↵ | | 9 | }↵
|
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) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (int i = 0; i < max; i++) | | 2 | for (int i = 0; i < max; i++) |
3 | final int component1 = (i < components.length) ? components[i] : 0; | | 3 | final int component1 = (i < components.length) ? components[i] : 0; |
4 | final int component2 = (i < other.components.length) ? other.components[i] : 0; | | 4 | final int component2 = (i < other.components.length) ? other.components[i] : 0; |
5 | if (component2 > component1) | | 5 | if (component2 > component1) |
6 | | | 6 | |
7 | if (component2 < component1) | | 7 | if (component2 < component1) |
8 | | | 8 | |
Precondition Violations (0)
Row |
Violation |