if (firstLogin) { if( firstLoginAction != null) { firstLoginAction.actionPerformed(); } }
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/imap/IMAPServer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java
Method name: void login() Method name: void existsChanged(String, int)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (firstLogin) {
1
if (
2
			if( firstLogin
2
updatesEnabled) {
3
Action != null) {
3
			if( existsChangedAction != null) {
4
				firstLoginAction.actionPerformed();
4
				existsChangedAction.actionPerformed(
5
			}
5
selectedFolder);
6
			}
7
			LOG.fine("Exists changed -> triggering update");
6
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    28
    if (firstLogin)
    28
    if (firstLogin)
    5
    if (updatesEnabled)
    Differences
    Expression1Expression2Difference
    firstLoginupdatesEnabledVARIABLE_NAME_MISMATCH
    5
    if (updatesEnabled)
    29
    if (firstLoginAction != null)
    29
    if (firstLoginAction != null)
    6
    if (existsChangedAction != null)
    Differences
    Expression1Expression2Difference
    firstLoginActionexistsChangedActionVARIABLE_NAME_MISMATCH
    org.columba.mail.imap.IFirstLoginActionorg.columba.mail.imap.IExistsChangedActionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.imap.IFirstLoginAction of variable firstLoginAction does not match with type org.columba.mail.imap.IExistsChangedAction of variable existsChangedAction
    • Make classes org.columba.mail.imap.IFirstLoginAction and org.columba.mail.imap.IExistsChangedAction extend a common superclass
    6
    if (existsChangedAction != null)
                                                                                                                  
    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);
    30
    firstLoginAction.actionPerformed();
    30
    firstLoginAction.actionPerformed();
    Preondition Violations
    Unmatched statement firstLoginAction.actionPerformed(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                  
                                                                                                          
    8
    LOG.fine("Exists changed -> triggering update");
    Precondition Violations (3)
    Row Violation
    1Type org.columba.mail.imap.IFirstLoginAction of variable firstLoginAction does not match with type org.columba.mail.imap.IExistsChangedAction of variable existsChangedAction
    2Unmatched statement existsChangedAction.actionPerformed(selectedFolder); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement firstLoginAction.actionPerformed(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted