Iterator<IEventInfo> it = list.iterator();
while (it.hasNext()) {
addElement(it.next());
}
Iterator<IContactModelPartial> it = list.iterator();
while (it.hasNext()) {
addElement(it.next());
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/CalendarList.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactList.java
|
Method name: void addAll(List)
|
|
Method name: void addAll(List)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | Iterator<IEventInfo> it = list.iterator();↵ | | 1 | Iterator<IContactModelPartial> it = list.iterator();↵
|
2 | while (it.hasNext()) {↵ | | 2 | while (it.hasNext()) {↵
|
3 | addElement(it.next());↵ | | 3 | addElement(it.next());↵
|
4 | } | | 4 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 18.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | Iterator<IContactModelPartial> it = list.iterator(); |
1 | Iterator<IEventInfo> it = list.iterator(); | | | |
2 | while (it.hasNext()) | | 2 | while (it.hasNext()) |
3 | | | 3 | |
Precondition Violations (5)
Row |
Violation |
1 | Type java.util.Iterator<org.columba.calendar.model.api.IEventInfo> of variable it does not match with type java.util.Iterator<org.columba.addressbook.model.IContactModelPartial> of variable it |
2 | Expression it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type org.columba.calendar.model.api.IEventInfo of variable it.next() does not match with type org.columba.addressbook.model.IContactModelPartial of variable it.next() |
5 | Type java.util.Iterator<org.columba.calendar.model.api.IEventInfo> of variable it does not match with type java.util.Iterator<org.columba.addressbook.model.IContactModelPartial> of variable it |