if (aktMessage != null) { aktMessage.close(); aktMessage = null; } super.expungeFolder();
if (updatesEnabled) { if( existsChangedAction != null) { existsChangedAction.actionPerformed(selectedFolder); } LOG.fine("Exists changed -> triggering update"); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/AbstractLocalFolder.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java
Method name: void expungeFolder() Method name: void existsChanged(String, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (aktMessage != null) {
1
if (
2
			aktMessage.close();
3
			aktMessage = null
2
updatesEnabled) {
3
			if( existsChangedAction != null) {
4
;
4
				existsChangedAction.actionPerformed(selectedFolder);
5
		}
5
			}
6
		super.expungeFolder();
6
			LOG.fine("Exists changed -> triggering update");
7
		}
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.1
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (aktMessage != null)
    1
    if (aktMessage != null)
    6
    if (existsChangedAction != null)
    Differences
    Expression1Expression2Difference
    aktMessageexistsChangedActionVARIABLE_NAME_MISMATCH
    org.columba.mail.message.ColumbaMessageorg.columba.mail.imap.IExistsChangedActionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.message.ColumbaMessage of variable aktMessage does not match with type org.columba.mail.imap.IExistsChangedAction of variable existsChangedAction
    • Make classes org.columba.mail.message.ColumbaMessage and org.columba.mail.imap.IExistsChangedAction extend a common superclass
    6
    if (existsChangedAction != null)
    2
    aktMessage.close();
    2
    aktMessage.close();
    Preondition Violations
    Unmatched statement aktMessage.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                
    3
    aktMessage = null;
    3
    aktMessage = null;
    Preondition Violations
    Unmatched statement aktMessage=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
                                                                                                                  
    7
    existsChangedAction.actionPerformed(selectedFolder);
    Preondition Violations
    Unmatched statement existsChangedAction.actionPerformed(selectedFolder); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7
    existsChangedAction.actionPerformed(selectedFolder);
    4
    super.expungeFolder();
    4
    super.expungeFolder();
    8
    LOG.fine("Exists changed -> triggering update");
    Differences
    Expression1Expression2Difference
    super.expungeFolder()LOG.fine("Exists changed -> triggering update")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.expungeFolder() is a void method call, and thus it cannot be parameterized
    Expression LOG.fine("Exists changed -> triggering update") is a void method call, and thus it cannot be parameterized
    Super method call super.expungeFolder(); cannot be extracted from method
    8
    LOG.fine("Exists changed -> triggering update");
    Precondition Violations (8)
    Row Violation
    1Type org.columba.mail.message.ColumbaMessage of variable aktMessage does not match with type org.columba.mail.imap.IExistsChangedAction of variable existsChangedAction
    2Unmatched statement aktMessage.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement aktMessage=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement existsChangedAction.actionPerformed(selectedFolder); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Expression super.expungeFolder() is a void method call, and thus it cannot be parameterized
    6Expression LOG.fine("Exists changed -> triggering update") is a void method call, and thus it cannot be parameterized
    7Super method call super.expungeFolder(); cannot be extracted from method
    8The refactoring of the clones is infeasible, because classes org.columba.mail.folder.AbstractLocalFolder and org.columba.mail.imap.IMAPServer do not have a common superclass