if (dialog.success()) { IMailFolder folder = (IMailFolder) dialog.getSelectedFolder(); String treePath = folder.getTreePath(); treePathButton.setText(treePath); }
while (it.hasNext()) { IContainer m = (IContainer) it.next(); JFrame frame = m.getFrame(); if (frame.isActive()) return m; }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/plugins/FolderChooserActionRow.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameManager.java
Method name: void promptUserForFolder() Method name: IContainer getActiveFrameMediator()
Number of AST nodes: 4 Number of AST nodes: 5
1
if (dialog.success()) {
2
			IMailFolder folder = (IMailFolder) dialog.getSelectedFolder
1
while (it.hasNext()) {
3
();
2
			IContainer m = (IContainer) it.next();
4
			String treePath = folder.getTreePath();
3
			JFrame frame = m.getFrame();
5
			treePathButton.setText(treePath)
4
			if (frame.isActive())
6
;
5
				return m;
7
		}
6
		}
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.3
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)13.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                
    3
    IContainer m = (IContainer)it.next();
    Preondition Violations
    Unmatched statement IContainer m=(IContainer)it.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    IContainer m = (IContainer)it.next();
                                                              
    4
    JFrame frame = m.getFrame();
    Preondition Violations
    Unmatched statement JFrame frame=m.getFrame(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    JFrame frame = m.getFrame();
    2
    if (dialog.success())
    2
    if (dialog.success())
    5
    if (frame.isActive())
    Differences
    Expression1Expression2Difference
    successisActiveMETHOD_INVOCATION_NAME_MISMATCH
    dialogframeVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.tree.util.SelectFolderDialogjavax.swing.JFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression frame.isActive() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (frame.isActive())
    3
    IMailFolder folder = (IMailFolder)dialog.getSelectedFolder();
    3
    IMailFolder folder = (IMailFolder)dialog.getSelectedFolder();
    Preondition Violations
    Unmatched statement IMailFolder folder=(IMailFolder)dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                
    4
    String treePath = folder.getTreePath();
                                                                                    
    5
    treePathButton.setText(treePath);
    5
    treePathButton.setText(treePath);
    Preondition Violations
    Unmatched statement treePathButton.setText(treePath); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                            
                            
    6
    return m;
    Preondition Violations
    Unmatched return m;
    6
    return m;
    Precondition Violations (7)
    Row Violation
    1Unmatched statement IContainer m=(IContainer)it.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement JFrame frame=m.getFrame(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression frame.isActive() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement IMailFolder folder=(IMailFolder)dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement treePathButton.setText(treePath); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return m;
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero