if (folderId == null) throw new IllegalArgumentException("folderId = null"); if (contactId == null) throw new IllegalArgumentException("contactId == null"); AddressbookTreeModel model = AddressbookTreeModel.getInstance(); IFolder f = (IFolder) model.getFolder(folderId);
if (uid == null) throw new IllegalArgumentException("uid == null"); if (contactItems == null) throw new IllegalArgumentException( "Zero IContactItem's were specified to add to addressbook folder"); AddressbookTreeModel model = AddressbookTreeModel.getInstance(); IContactFolder folder = (IContactFolder) model.getFolder(uid);
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: IContactItem getContactItem(String, String) Method name: void addContacts(String, IContactItem[])
Number of AST nodes: 6 Number of AST nodes: 6
1
if (folderId == null)
1
if (uid == null)
2
			throw new IllegalArgumentException("folderId = null");
2
			throw new IllegalArgumentException("uid == null");
3
		if (contactId == null)
3
		if (contactItems == null)
4
			throw new IllegalArgumentException("contactId == null
4
			throw new IllegalArgumentException(
5
");
5
					"Zero IContactItem's were specified to add to addressbook folder");
6
		AddressbookTreeModel model = AddressbookTreeModel.getInstance();
6
		AddressbookTreeModel model = AddressbookTreeModel.getInstance();
7
		IFolder f = (IFolder) model.getFolder(folderId);
7
		IContactFolder folder = (IContactFolder) model.getFolder(uid);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (folderId == null)
    1
    if (folderId == null)
    1
    if (uid == null)
    Differences
    Expression1Expression2Difference
    folderIduidVARIABLE_NAME_MISMATCH
    1
    if (uid == null)
    2
    throw new IllegalArgumentException("folderId = null");
    2
    throw new IllegalArgumentException("folderId = null");
    2
    throw new IllegalArgumentException("uid == null");
    Differences
    Expression1Expression2Difference
    "folderId = null""uid == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("uid == null");
    3
    if (contactId == null)
    3
    if (contactId == null)
    3
    if (contactItems == null)
    Differences
    Expression1Expression2Difference
    contactIdcontactItemsVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.columba.addressbook.facade.IContactItem[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable contactId does not match with type org.columba.addressbook.facade.IContactItem[] of variable contactItems
    • Make classes java.lang.String and org.columba.addressbook.facade.IContactItem[] extend a common superclass
    3
    if (contactItems == null)
    4
    throw new IllegalArgumentException("contactId == null");
    4
    throw new IllegalArgumentException("contactId == null");
    4
    throw new IllegalArgumentException("Zero IContactItem's were specified to add to addressbook folder");
    Differences
    Expression1Expression2Difference
    "contactId == null""Zero IContactItem's were specified to add to addressbook folder"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("Zero IContactItem's were specified to add to addressbook folder");
    5
    AddressbookTreeModel model = AddressbookTreeModel.getInstance();
    5
    AddressbookTreeModel model = AddressbookTreeModel.getInstance();
                                                                                                                                
    6
    IContactFolder folder = (IContactFolder)model.getFolder(uid);
    6
    IFolder f = (IFolder)model.getFolder(folderId);
                                                                                                    
    Precondition Violations (1)
    Row Violation
    1Type java.lang.String of variable contactId does not match with type org.columba.addressbook.facade.IContactItem[] of variable contactItems