Object returnValue;
if (index < filteredList.size()) {
returnValue = filteredList.get(index);
} else {
returnValue = null;
}
return returnValue;
Object returnValue;
if (index < filteredList.size()) {
returnValue = filteredList.get(index);
} else {
returnValue = null;
}
return returnValue;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/FilteringModel.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/FilteringModel.java
|
Method name: Object getElementAt(int)
|
|
Method name: Object getElementAt(int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Object returnValue;↵ | | 1 | Object returnValue;↵
|
2 | if (index < filteredList.size()) {↵ | | 2 | if (index < filteredList.size()) {↵
|
3 | returnValue = filteredList.get(index);↵ | | 3 | returnValue = filteredList.get(index);↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | returnValue = null;↵ | | 5 | returnValue = null;↵
|
6 | }↵ | | 6 | }↵
|
7 | return returnValue; | | 7 | return returnValue;
|
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 different classes having the same super class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Object returnValue; | | 1 | Object returnValue; |
2 | if (index < filteredList.size()) | | 2 | if (index < filteredList.size()) |
3 | returnValue = filteredList.get(index); | | 3 | returnValue = filteredList.get(index); |
| | | | |
4 | | | 4 | |
5 | return returnValue; | | 5 | return returnValue; |
Precondition Violations (0)
Row |
Violation |