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);
if (folderId == null) throw new IllegalArgumentException("folderId = null"); if (emailAddress == null) throw new IllegalArgumentException("emailAddress == null"); AddressbookTreeModel model = AddressbookTreeModel.getInstance(); IFolder f = (IFolder) model.getFolder(folderId);
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: void addContacts(String, IContactItem[]) Method name: String findByEmailAddress(String, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (uid == null)
1
if (folderId == null)
2
			throw new IllegalArgumentException("uid == null");
2
			throw new IllegalArgumentException("folderId = null");
3
		if (contactItems == null)
3
		if (emailAddress == null)
4
			throw new IllegalArgumentException(
4
			throw new IllegalArgumentException(
5
					"Zero IContactItem's were specified to add to addressbook folder");
5
"emailAddress == null");
6
		AddressbookTreeModel model = AddressbookTreeModel.getInstance();
6
		AddressbookTreeModel model = AddressbookTreeModel.getInstance();
7
		IContactFolder folder = (IContactFolder) model.getFolder(uid);
7
		IFolder f = (IFolder) model.getFolder(folderId);
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 (uid == null)
    1
    if (uid == null)
    1
    if (folderId == null)
    Differences
    Expression1Expression2Difference
    uidfolderIdVARIABLE_NAME_MISMATCH
    1
    if (folderId == null)
    2
    throw new IllegalArgumentException("uid == null");
    2
    throw new IllegalArgumentException("uid == null");
    2
    throw new IllegalArgumentException("folderId = null");
    Differences
    Expression1Expression2Difference
    "uid == null""folderId = null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("folderId = null");
    3
    if (contactItems == null)
    3
    if (contactItems == null)
    3
    if (emailAddress == null)
    Differences
    Expression1Expression2Difference
    contactItemsemailAddressVARIABLE_NAME_MISMATCH
    org.columba.addressbook.facade.IContactItem[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.facade.IContactItem[] of variable contactItems does not match with type java.lang.String of variable emailAddress
    • Make classes org.columba.addressbook.facade.IContactItem[] and java.lang.String extend a common superclass
    3
    if (emailAddress == null)
    4
    throw new IllegalArgumentException("Zero IContactItem's were specified to add to addressbook folder");
    4
    throw new IllegalArgumentException("Zero IContactItem's were specified to add to addressbook folder");
    4
    throw new IllegalArgumentException("emailAddress == null");
    Differences
    Expression1Expression2Difference
    "Zero IContactItem's were specified to add to addressbook folder""emailAddress == null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("emailAddress == null");
    5
    AddressbookTreeModel model = AddressbookTreeModel.getInstance();
    5
    AddressbookTreeModel model = AddressbookTreeModel.getInstance();
                                                                                                    
    6
    IFolder f = (IFolder)model.getFolder(folderId);
    6
    IContactFolder folder = (IContactFolder)model.getFolder(uid);
                                                                                                                                
    Precondition Violations (1)
    Row Violation
    1Type org.columba.addressbook.facade.IContactItem[] of variable contactItems does not match with type java.lang.String of variable emailAddress