Iterator<IContactModelPartial> it = folder.getHeaderItemList()
.iterator();
while (it.hasNext()) {
IContactModelPartial itemPartial = it.next();
IContactItem item = createContactItem(itemPartial);
v.add(item);
}
Iterator<IContactModelPartial> it = folder.getHeaderItemList()
.iterator();
while (it.hasNext()) {
IContactModelPartial contactModel = it.next();
IContactItem item = createContactItem(contactModel);
v.add(item);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/facade/ContactFacade.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/facade/ContactFacade.java
|
Method name: List getAllHeaderItems(String, boolean)
|
|
Method name: List getAllContacts(String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Iterator<IContactModelPartial> it = folder.getHeaderItemList()↵ | | 1 | Iterator<IContactModelPartial> it = folder.getHeaderItemList()↵
|
2 | .iterator();↵ | | 2 | .iterator();↵
|
3 | while (it.hasNext()) {↵ | | 3 | while (it.hasNext()) {↵
|
4 | IContactModelPartial itemPartial = it.next();↵ | | 4 | IContactModelPartial contactModel = it.next();↵
|
|
5 | IContactItem item = createContactItem(itemPartial);↵ | | 5 | IContactItem item = createContactItem(contactModel);↵
|
|
6 | v.add(item);↵ | | 6 | v.add(item);↵
|
7 | } | | 7 | }
|
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 | 18 |
-
{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) | 19.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | Iterator<IContactModelPartial> it = folder.getHeaderItemList().iterator(); | | 12 | Iterator<IContactModelPartial> it = folder.getHeaderItemList().iterator(); |
13 | while (it.hasNext()) | | 13 | while (it.hasNext()) |
14 | IContactModelPartial itemPartial = it.next(); | | 14 | IContactModelPartial contactModel = it.next(); |
15 | IContactItem item = createContactItem(itemPartial); | | 15 | IContactItem item = createContactItem(contactModel); |
16 | | | 16 | |
Precondition Violations (0)
Row |
Violation |