while (it.hasNext()) {
IContactModelPartial contactModel = it.next();
IContactItem item = createContactItem(contactModel);
v.add(item);
}
while (it.hasNext()) {
IContactModelPartial itemPartial = it.next();
IContactItem item = createContactItem(itemPartial);
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 getAllContacts(String)
|
|
Method name: List getAllHeaderItems(String, boolean)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while (it.hasNext()) {↵ | | 1 | while (it.hasNext()) {↵
|
2 | IContactModelPartial contactModel = it.next();↵ | | 2 | IContactModelPartial itemPartial = it.next();↵
|
|
3 | IContactItem item = createContactItem(contactModel);↵ | | 3 | IContactItem item = createContactItem(itemPartial);↵
|
|
4 | v.add(item);↵ | | 4 | v.add(item);↵
|
5 | } | | 5 | }
|
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 declared in the same class |
Number of node comparisons | 17 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 6.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
13 | while (it.hasNext()) | | 13 | while (it.hasNext()) |
14 | IContactModelPartial contactModel = it.next(); | | 14 | IContactModelPartial itemPartial = it.next(); |
15 | IContactItem item = createContactItem(contactModel); | | 15 | IContactItem item = createContactItem(itemPartial); |
16 | | | 16 | |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.Vector<org.columba.addressbook.facade.IContactItem> of variable v does not match with type java.util.Vector<org.columba.addressbook.facade.IHeaderItem> of variable v |