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
|
Method name: List
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | if (folderId == null)↵ | 1 | if (folderId == null)↵ | |
2 | throw new IllegalArgumentException("folderId == null");↵ | 2 | throw new IllegalArgumentException("folderId == null");↵ | |
3 | Vector<IContactItem> v = new Vector<IContactItem>();↵ | 3 | Vector<IHeaderItem> v = new Vector<IHeaderItem>();↵ | |
4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | 4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | |
5 | IFolder f = model.getFolder(folderId);↵ | 5 | IFolder f = model.getFolder(folderId);↵ | |
6 | if (f == null)↵ | 6 | if (f == null)↵ | |
7 | return v;↵ | 7 | return v;↵ | |
8 | if (!(f instanceof IContactFolder))↵ | 8 | if (!(f instanceof IContactFolder))↵ | |
9 | return v;↵ | 9 | return v;↵ | |
10 | IContactFolder folder = (IContactFolder) f;↵ | 10 | IContactFolder folder = (IContactFolder) f;↵ | |
11 | try {↵ | 11 | try {↵ | |
12 | Iterator<IContactModelPartial> it = folder.getHeaderItemList()↵ | 12 | Iterator<IContactModelPartial> it = folder.getHeaderItemList()↵ | |
13 | .iterator();↵ | 13 | .iterator();↵ | |
14 | while (it.hasNext()) {↵ | 14 | while (it.hasNext()) {↵ | |
15 | IContactModelPartial contactModel = it.next();↵ | 15 | IContactModelPartial itemPartial = it.next();↵ | |
16 | IContactItem item = createContactItem(contactModel);↵ | 16 | IContactItem item = createContactItem(itemPartial);↵ | |
17 | v.add(item);↵ | 17 | v.add(item);↵ | |
18 | } | 18 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
Number of mapped statements | 9 |
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) | 2.4 |
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 | Vector<IContactItem> v = new Vector<IContactItem>(); |
| 3 | Vector<IHeaderItem> v = new Vector<IHeaderItem>(); | |||||||||||||
4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | 4 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | ||||||||||||||
5 | IFolder f = model.getFolder(folderId); | 5 | IFolder f = model.getFolder(folderId); | ||||||||||||||
6 | if (f == null) | 6 | if (f == null) | ||||||||||||||
7 | return v; | 7 | return v; | ||||||||||||||
8 | if (!(f instanceof IContactFolder)) | 8 | if (!(f instanceof IContactFolder)) | ||||||||||||||
9 | return v; | 9 | return v; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables f, v , while Clone fragment #2 returns variables f, v |
2 | Not all possible execution flows end in a return statement |