if (dialog.success()) { IFolder folder = dialog.getSelectedFolder(); String path = folder.getTreePath(); selectButton.setText(path); }
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/search/SearchFrame.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameManager.java
Method name: void actionPerformed(ActionEvent) Method name: IContainer getActiveFrameMediator()
Number of AST nodes: 4 Number of AST nodes: 5
1
if (dialog.success()) {
2
				IFolder folder = dialog.getSelectedFolder();
3
				String path = folder.getTreePath
1
while (it.hasNext()) {
2
			IContainer m = (IContainer) it.next();
4
();
3
			JFrame frame = m.getFrame();
5
				selectButton.setText(path)
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.4
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 fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)15.7
    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();
    9
    if (dialog.success())
    9
    if (dialog.success())
    5
    if (frame.isActive())
    Differences
    Expression1Expression2Difference
    successisActiveMETHOD_INVOCATION_NAME_MISMATCH
    dialogframeVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.tree.util.SelectSearchFolderDialogjavax.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())
                            
    6
    return m;
    Preondition Violations
    Unmatched return m;
    6
    return m;
    10
    IFolder folder = dialog.getSelectedFolder();
    10
    IFolder folder = dialog.getSelectedFolder();
    Preondition Violations
    Unmatched statement IFolder folder=dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                
    11
    String path = folder.getTreePath();
                                                                              
    12
    selectButton.setText(path);
    12
    selectButton.setText(path);
    Preondition Violations
    Unmatched statement selectButton.setText(path); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                  
    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 return m;
    5Unmatched statement IFolder folder=dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement selectButton.setText(path); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero