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: String findByName(String, String)
|
Method name: IContactItem getContactItem(String, String)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (folderId == null)↵ | 1 | if (folderId == null)↵ | |
2 | throw new IllegalArgumentException("folderId = null");↵ | 2 | throw new IllegalArgumentException("folderId = null");↵ | |
3 | if (name == null)↵ | 3 | if (contactId == null)↵ | |
4 | throw new IllegalArgumentException("name == null");↵ | 4 | throw new IllegalArgumentException("contactId == null");↵ | |
5 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | 5 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | |
6 | IFolder f = (IFolder) model.getFolder(folderId);↵ | 6 | IFolder f = (IFolder) model.getFolder(folderId);↵ | |
7 | if (f == null)↵ | 7 | if (f == null)↵ | |
8 | throw new IllegalArgumentException("contact folder does not exist");↵ | 8 | throw new IllegalArgumentException("contact folder does not exist");↵ | |
9 | if (!(f instanceof IContactFolder))↵ | 9 | if (!(f instanceof IContactFolder))↵ | |
10 | return null;↵ | 10 | return null;↵ | |
11 | IContactFolder contactFolder = (IContactFolder) f; | 11 |
| |
See real code fragment | See real code fragment |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 55 |
Number of mapped statements | 11 |
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) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (folderId == null) | 1 | if (folderId == null) | |||||||||||
2 | throw new IllegalArgumentException("folderId = null"); | 2 | throw new IllegalArgumentException("folderId = null"); | |||||||||||
3 | if (name == null) |
| 3 | if (contactId == null) | ||||||||||
4 | throw new IllegalArgumentException("name == null"); |
| 4 | throw new IllegalArgumentException("contactId == null"); | ||||||||||
5 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | 5 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | |||||||||||
6 | IFolder f = (IFolder)model.getFolder(folderId); | 6 | IFolder f = (IFolder)model.getFolder(folderId); | |||||||||||
7 | if (f == null) | 7 | if (f == null) | |||||||||||
8 | throw new IllegalArgumentException("contact folder does not exist"); | 8 | throw new IllegalArgumentException("contact folder does not exist"); | |||||||||||
9 | if (!(f instanceof IContactFolder)) | 9 | if (!(f instanceof IContactFolder)) | |||||||||||
10 | return null; | 10 | return null; | |||||||||||
11 | IContactFolder contactFolder = (IContactFolder)f; | 11 | IContactFolder contactFolder = (IContactFolder)f; |
Row | Violation |
---|