if (item == null) {
item = new ContactModelPartial(str);
} else {
item = (IBasicModelPartial) item.clone();
}
if (item == null) {
item = new ContactModelPartial(selected);
} else {
item = (IBasicModelPartial) item.clone();
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/autocomplete/AddressAutoCompleter.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/autocomplete/AddressAutoCompleter.java
|
Method name: void autoComplete(String, int)
|
|
Method name: void itemStateChanged(ItemEvent)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (item == null) {↵ | | 1 | if (item == null) {↵
|
2 | item = new ContactModelPartial(str);↵ | | 2 | item = new ContactModelPartial(selected);↵
|
3 | ↵ | | 3 | ↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | item = (IBasicModelPartial) item.clone();↵ | | 5 | item = (IBasicModelPartial) item.clone();↵
|
6 | } | | 6 | }
|
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 declared in the same class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | if (item == null) | | 4 | if (item == null) |
8 | item = new ContactModelPartial(str); | | 5 | item = new ContactModelPartial(selected); |
| | | | |
9 | item = (IBasicModelPartial)item.clone(); | | 6 | item = (IBasicModelPartial)item.clone(); |
Precondition Violations (0)
Row |
Violation |