while (it.hasNext()) { IContainer m = (IContainer) it.next(); JFrame frame = m.getFrame(); if (frame.isActive()) return m; }
if (dialog.success()) { IMailFolder selectedFolder = (IMailFolder) dialog .getSelectedFolder(); String path = selectedFolder.getTreePath(); sentButton.setText(path); // int uid = selectedFolder.getUid(); // item.setSent( new Integer(uid).toString() ); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/SpecialFoldersPanel.java
Method name: IContainer getActiveFrameMediator() Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 5 Number of AST nodes: 4
1
while (it.hasNext()) {
2
			IContainer m = (IContainer) it.next();
3
			JFrame frame = m.getFrame(
1
if (dialog.success()) {
2
				IMailFolder selectedFolder = (IMailFolder) dialog
3
						.getSelectedFolder();
4
				String path = selectedFolder.getTreePath();
4
);
5
				sentButton.setText(path);
5
			if (frame.isActive())
6
				// int uid = selectedFolder.getUid();
6
				return m;
7
				// item.setSent( new Integer(uid).toString() );
7
		}
8
			}
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.5
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)14.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    IContainer m = (IContainer)it.next();
    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
                                                                                
    4
    JFrame frame = m.getFrame();
    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
                                                              
    5
    if (frame.isActive())
    5
    if (frame.isActive())
    28
    if (dialog.success())
    Differences
    Expression1Expression2Difference
    isActivesuccessMETHOD_INVOCATION_NAME_MISMATCH
    framedialogVARIABLE_NAME_MISMATCH
    javax.swing.JFrameorg.columba.mail.gui.tree.util.SelectFolderDialogSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression frame.isActive() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28
    if (dialog.success())
    6
    return m;
    6
    return m;
    Preondition Violations
    Unmatched return m;
                            
                                                                                                                                                  
    29
    IMailFolder selectedFolder = (IMailFolder)dialog.getSelectedFolder();
    Preondition Violations
    Unmatched statement IMailFolder selectedFolder=(IMailFolder)dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    29
    IMailFolder selectedFolder = (IMailFolder)dialog.getSelectedFolder();
                                                                                              
    30
    String path = selectedFolder.getTreePath();
                                                              
    31
    sentButton.setText(path);
    Preondition Violations
    Unmatched statement sentButton.setText(path); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    31
    sentButton.setText(path);
    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 IMailFolder selectedFolder=(IMailFolder)dialog.getSelectedFolder(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement sentButton.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