String providerTechnicalName = ref.getProviderTechnicalName(); ISearchProvider p = getProvider(providerTechnicalName); doExecute(ref.getSearchTerm(), p, ref .getSearchCriteriaTechnicalName(), ref.isSearchInside(), ref.getStartIndex(), ref .getResultCount());
if (dialog.success()) { IMailFolder selectedFolder = (IMailFolder) dialog .getSelectedFolder(); String path = selectedFolder.getTreePath(); templatesButton.setText(path); // int uid = selectedFolder.getUid(); // item.setTemplates( new Integer(uid).toString() ); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/search/SearchManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/SpecialFoldersPanel.java
Method name: void execute(IWorkerStatusController) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 4
1
String providerTechnicalName = ref.getProviderTechnicalName();
2
				ISearchProvider p = getProvider(providerTechnicalName);
3
				doExecute(ref.getSearchT
1
if (dialog.success()) {
2
				IMailFolder selectedFolder = (IMailFolder) dialog
4
erm(), p, ref
3
						.getSelectedFolder()
5
						.getSearchCriteriaTechnicalName(),
6
						ref.isSearchInside(), ref.getStartIndex(), ref
7
								.getResultCount
4
;
5
				String path = selectedFolder.getTreePath();
6
				templatesButton.setText(path);
7
				// int uid = selectedFolder.getUid();
8
());
8
				// item.setTemplates( new Integer(uid).toString() );
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
    20
    String providerTechnicalName = ref.getProviderTechnicalName();
                                                                                                                                    
    21
    ISearchProvider p = getProvider(providerTechnicalName);
    21
    ISearchProvider p = getProvider(providerTechnicalName);
    23
    IMailFolder selectedFolder = (IMailFolder)dialog.getSelectedFolder();
    Differences
    Expression1Expression2Difference
    org.columba.core.search.api.ISearchProviderorg.columba.mail.folder.IMailFolderSUBCLASS_TYPE_MISMATCH
    pselectedFolderVARIABLE_NAME_MISMATCH
    org.columba.core.search.api.ISearchProviderorg.columba.mail.folder.IMailFolderSUBCLASS_TYPE_MISMATCH
    org.columba.core.search.api.ISearchProviderorg.columba.mail.folder.IMailFolderSUBCLASS_TYPE_MISMATCH
    getProvider(providerTechnicalName)(IMailFolder)dialog.getSelectedFolder()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression getProvider(providerTechnicalName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23
    IMailFolder selectedFolder = (IMailFolder)dialog.getSelectedFolder();
    22
    doExecute(ref.getSearchTerm(), p, ref.getSearchCriteriaTechnicalName(), ref.isSearchInside(), ref.getStartIndex(), ref.getResultCount());
    22
    doExecute(ref.getSearchTerm(), p, ref.getSearchCriteriaTechnicalName(), ref.isSearchInside(), ref.getStartIndex(), ref.getResultCount());
    Preondition Violations
    Unmatched statement doExecute(ref.getSearchTerm(),p,ref.getSearchCriteriaTechnicalName(),ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                                    
                                                                                              
    24
    String path = selectedFolder.getTreePath();
    Preondition Violations
    Unmatched statement String path=selectedFolder.getTreePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    String path = selectedFolder.getTreePath();
                                                                        
    25
    templatesButton.setText(path);
    Preondition Violations
    Unmatched statement templatesButton.setText(path); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    25
    templatesButton.setText(path);
    Precondition Violations (6)
    Row Violation
    1Expression getProvider(providerTechnicalName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement doExecute(ref.getSearchTerm(),p,ref.getSearchCriteriaTechnicalName(),ref.isSearchInside(),ref.getStartIndex(),ref.getResultCount()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement String path=selectedFolder.getTreePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement templatesButton.setText(path); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Clone fragment #1 returns variable p with type org.columba.core.search.api.ISearchProvider , while Clone fragment #2 returns variable selectedFolder with type org.columba.mail.folder.IMailFolder
    6The refactoring of the clones is infeasible, because classes org.columba.core.search.SearchManager.SearchCommand and org.columba.mail.gui.config.account.SpecialFoldersPanel do not have a common superclass