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: void addContacts(IContactItem[])
|
Method name: void addContact(IContactItem)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if (contactItems == null)↵ | 1 | if (contactItem == null)↵ | |
2 | throw new IllegalArgumentException(↵ | 2 | throw new IllegalArgumentException(↵ | |
3 | "Zero IContactItem's were specified to add to addressbook folder");↵ | 3 | "IContactItem is null");↵ | |
4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | 4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | |
5 | SelectAddressbookFolderDialog dialog = new SelectAddressbookFolderDialog(↵ | 5 | SelectAddressbookFolderDialog dialog = new SelectAddressbookFolderDialog(↵ | |
6 | model);↵ | 6 | model);↵ | |
7 | if (dialog.success()) {↵ | 7 | if (dialog.success()) {↵ | |
8 | IFolder folder = dialog.getSelectedFolder();↵ | 8 | IFolder folder = dialog.getSelectedFolder();↵ | |
9 | String uid = folder.getId();↵ | 9 | String uid = folder.getId();↵ | |
10 | addContacts(uid, contactItems);↵ | 10 | addContact(uid, contactItem);↵ | |
11 | } else↵ | 11 | } else↵ | |
12 | return; | 12 |
| |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 33 |
Number of mapped statements | 8 |
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) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (contactItems == null) |
| 1 | if (contactItem == null) | ||||||||||||||
2 | throw new IllegalArgumentException("Zero IContactItem's were specified to add to addressbook folder"); |
| 2 | throw new IllegalArgumentException("IContactItem is null"); | ||||||||||||||
3 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | 3 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | |||||||||||||||
4 | SelectAddressbookFolderDialog dialog = new SelectAddressbookFolderDialog(model); | 4 | SelectAddressbookFolderDialog dialog = new SelectAddressbookFolderDialog(model); | |||||||||||||||
5 | if (dialog.success()) | 5 | if (dialog.success()) | |||||||||||||||
6 | IFolder folder = dialog.getSelectedFolder(); | 6 | IFolder folder = dialog.getSelectedFolder(); | |||||||||||||||
7 | String uid = folder.getId(); | 7 | String uid = folder.getId(); | |||||||||||||||
|
| 8 | addContact(uid, contactItem); | |||||||||||||||
8 | addContacts(uid, contactItems); |
| | |||||||||||||||
else | else | |||||||||||||||||
9 | return; | 9 | return; |
Row | Violation |
---|---|
1 | Type org.columba.addressbook.facade.IContactItem[] of variable contactItems does not match with type org.columba.addressbook.facade.IContactItem of variable contactItem |
2 | Unmatched statement addContact(uid,contactItem); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement addContact(uid,contactItem); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement addContacts(uid,contactItems); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement addContacts(uid,contactItems); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |