throw new IllegalArgumentException("folderId = null");
AddressbookTreeModel model = AddressbookTreeModel.getInstance();
IFolder f = (IFolder) model.getFolder(folderId);
if (f == null)
throw new IllegalArgumentException("contact folder does not exist");
throw new IllegalArgumentException("contactId == null");
AddressbookTreeModel model = AddressbookTreeModel.getInstance();
IFolder f = (IFolder) model.getFolder(folderId);
if (f == null)
throw new IllegalArgumentException("contact folder does not exist");
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 getAllGroups(String)
|
|
Method name: IContactItem getContactItem(String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | throw new IllegalArgumentException("folderId = null");↵ | | 1 | throw new IllegalArgumentException("contactId == null");↵
|
|
2 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵ | | 2 | AddressbookTreeModel model = AddressbookTreeModel.getInstance();↵
|
3 | IFolder f = (IFolder) model.getFolder(folderId);↵ | | 3 | IFolder f = (IFolder) model.getFolder(folderId);↵
|
4 | if (f == null)↵ | | 4 | if (f == null)↵
|
5 | throw new IllegalArgumentException("contact folder does not exist"); | | 5 | throw new IllegalArgumentException("contact folder does not exist");
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); | | 5 | AddressbookTreeModel model = AddressbookTreeModel.getInstance(); |
4 | IFolder f = (IFolder)model.getFolder(folderId); | | 6 | IFolder f = (IFolder)model.getFolder(folderId); |
5 | if (f == null) | | 7 | if (f == null) |
6 | throw new IllegalArgumentException("contact folder does not exist"); | | 8 | throw new IllegalArgumentException("contact folder does not exist"); |
Precondition Violations (0)
Row |
Violation |