boolean f1 = ((Boolean) header1.get("columba.attachment"))
.booleanValue();
boolean f2 = ((Boolean) header2.get("columba.attachment"))
.booleanValue();
if (f1 == f2) {
result = 0;
} else if (f1) { // define false < true
result = 1;
} else {
result = -1;
}
boolean f1 = ((Boolean) header1.get("columba.spam"))
.booleanValue();
boolean f2 = ((Boolean) header2.get("columba.spam"))
.booleanValue();
if (f1 == f2) {
result = 0;
} else if (f1) { // define false < true
result = 1;
} else {
result = -1;
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/model/TableModelSorter.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/model/TableModelSorter.java
|
Method name: int compare(Object, Object)
|
|
Method name: int compare(Object, Object)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | boolean f1 = ((Boolean) header1.get("columba.attachment"))↵ | | 1 | boolean f1 = ((Boolean) header1.get("columba.spam"))↵
|
2 | .booleanValue();↵ | | 2 | .booleanValue();↵
|
3 | boolean f2 = ((Boolean) header2.get("columba.attachment"))↵ | | 3 | boolean f2 = ((Boolean) header2.get("columba.spam"))↵
|
4 | .booleanValue();↵ | | 4 | .booleanValue();↵
|
|
5 | if (f1 == f2) {↵ | | 5 | if (f1 == f2) {↵
|
6 | result = 0;↵ | | 6 | result = 0;↵
|
7 | } else if (f1) { // define false < true↵ | | 7 | } else if (f1) { // define false < true↵
|
8 | result = 1;↵ | | 8 | result = 1;↵
|
9 | } else {↵ | | 9 | } else {↵
|
10 | result = -1;↵ | | 10 | result = -1;↵
|
11 | } | | 11 | }
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 25 |
-
{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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
29 | boolean f1 = ((Boolean)header1.get("columba.attachment")).booleanValue(); | | 51 | boolean f1 = ((Boolean)header1.get("columba.spam")).booleanValue(); |
30 | boolean f2 = ((Boolean)header2.get("columba.attachment")).booleanValue(); | | 52 | boolean f2 = ((Boolean)header2.get("columba.spam")).booleanValue(); |
31 | if (f1 == f2) | | 53 | if (f1 == f2) |
32 | | | 54 | |
33 | | | 55 | |
34 | | | 56 | |
| | | | |
35 | | | 57 | |
Precondition Violations (0)
Row |
Violation |