IFolder folder = dialog.getSelectedFolder(); String uid = folder.getId(); addContacts(uid, contactItems);
while (it2.hasNext()) { ISearchCriteria c = it2.next(); String searchCriteriaTechnicalName = c.getTechnicalName(); // execute search doExecute(ref.getSearchTerm(), p, searchCriteriaTechnicalName, ref.isSearchInside(), ref.getStartIndex(), ref.getResultCount()); }
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/core/src/main/java/org/columba/core/search/SearchManager.java
Method name: void addContacts(IContactItem[]) Method name: void execute(IWorkerStatusController)
Number of AST nodes: 3 Number of AST nodes: 4
1
IFolder folder = dialog.getSelectedFolder
1
while (it2.hasNext()) {
2
();
2
					ISearchCriteria c = it2.next();
3
			String uid = folder.getId();
3
					String 
4
			addContacts(uid, con
4
searchCriteriaTechnicalName = c.getTechnicalName();
5
					// execute search
6
					doExecute(ref.getSearchTerm(), p,
7
							searchCriteriaTechnicalName, ref.isSearchInside(),
5
tactItems);
8
							ref.getStartIndex(), ref.getResultCount());
9
				}
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.0
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    IFolder folder = dialog.getSelectedFolder();
                                                                                              
    7
    String uid = folder.getId();
                                                              
                                                                      
    16
    ISearchCriteria c = it2.next();
    Preondition Violations
    Unmatched statement ISearchCriteria c=it2.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    16
    ISearchCriteria c = it2.next();
                                                                                                                            
    17
    String searchCriteriaTechnicalName = c.getTechnicalName();
    Preondition Violations
    Unmatched statement String searchCriteriaTechnicalName=c.getTechnicalName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17
    String searchCriteriaTechnicalName = c.getTechnicalName();
    8
    addContacts(uid, contactItems);
    8
    addContacts(uid, contactItems);
    18
    doExecute(ref.getSearchTerm(), p, searchCriteriaTechnicalName, ref.isSearchInside(), ref.getStartIndex(), ref.getResultCount());
    Differences
    Expression1Expression2Difference
    addContactsdoExecuteMETHOD_INVOCATION_NAME_MISMATCH
    addContacts(uid,contactItems)doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression addContacts(uid,contactItems) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method doExecute
    Expression addContacts(uid,contactItems) is a void method call, and thus it cannot be parameterized
    Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) is a void method call, and thus it cannot be parameterized
    Expression addContacts(uid,contactItems) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method doExecute
    Expression addContacts(uid,contactItems) is a void method call, and thus it cannot be parameterized
    Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) is a void method call, and thus it cannot be parameterized
    18
    doExecute(ref.getSearchTerm(), p, searchCriteriaTechnicalName, ref.isSearchInside(), ref.getStartIndex(), ref.getResultCount());
    Precondition Violations (11)
    Row Violation
    1Unmatched statement ISearchCriteria c=it2.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement String searchCriteriaTechnicalName=c.getTechnicalName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression addContacts(uid,contactItems) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression addContacts(uid,contactItems) is a void method call, and thus it cannot be parameterized
    6Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) is a void method call, and thus it cannot be parameterized
    7Expression addContacts(uid,contactItems) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression addContacts(uid,contactItems) is a void method call, and thus it cannot be parameterized
    10Expression doExecute(ref.getSearchTerm(),p,searchCriteriaTechnicalName,ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()) is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes org.columba.addressbook.facade.ContactFacade and org.columba.core.search.SearchManager.SearchCommand do not have a common superclass