if (firstLogin) { if( firstLoginAction != null) { firstLoginAction.actionPerformed(); } }
if (filter != null) { getRoot().insertElement(filter.getRoot(), index); }
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/core/src/main/java/org/columba/core/filter/FilterList.java
Method name: void login() Method name: void insert(IFilter, int)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (firstLogin) {
1
if (fi
2
			if( firstLoginAction != null) {
2
lter != null) {
3
				firstLoginAction.actionPerformed();
3
			
4
			}
4
getRoot().insertElement(filter.getRoot(), index);
5
		}
5
		}
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    29
    if (firstLoginAction != null)
    29
    if (firstLoginAction != null)
    1
    if (filter != null)
    Differences
    Expression1Expression2Difference
    firstLoginActionfilterVARIABLE_NAME_MISMATCH
    org.columba.mail.imap.IFirstLoginActionorg.columba.core.filter.IFilterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.imap.IFirstLoginAction of variable firstLoginAction does not match with type org.columba.core.filter.IFilter of variable filter
    • Make classes org.columba.mail.imap.IFirstLoginAction and org.columba.core.filter.IFilter extend a common superclass
    1
    if (filter != null)
                                                                                                          
    2
    getRoot().insertElement(filter.getRoot(), index);
    Preondition Violations
    Unmatched statement getRoot().insertElement(filter.getRoot(),index); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    getRoot().insertElement(filter.getRoot(), index);
    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
                                                                                  
    Precondition Violations (4)
    Row Violation
    1Type org.columba.mail.imap.IFirstLoginAction of variable firstLoginAction does not match with type org.columba.core.filter.IFilter of variable filter
    2Unmatched statement getRoot().insertElement(filter.getRoot(),index); 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
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero