fetchCapas(); for (int i = 0; i < capabilities.length; i++) { if (capabilities[i].startsWith(command)) { return true; } } return false;
fetchCapas(); for (int i = 0; i < capas.length; i++) { if (capas[i].startsWith(command)) { return capas[i]; } } return null;
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/pop3/POP3Store.java
Method name: boolean isSupported(String) Method name: String getCapa(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
fetchCapas();
1
fetchCapas();
2
		for (int i = 0; i < capabilities.length; i++) {
2
		for (int i = 0; i < capas.length; i++) {
3
			if (capabilities[i].startsWith(command)) {
3
			if (capas[i].startsWith(command)) {
4
				return true;
4
				return capas[i];
5
			}
5
			}
6
		}
6
		}
7
		return false;
7
		return null;
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.3
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    fetchCapas();
    1
    fetchCapas();
    2
    for (int i = 0; i < capabilities.length; i++)
    2
    for (int i = 0; i < capabilities.length; i++)
    2
    for (int i = 0; i < capas.length; i++)
    Differences
    Expression1Expression2Difference
    capabilitiescapasVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression capabilities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression capas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    for (int i = 0; i < capas.length; i++)
    3
    if (capabilities[i].startsWith(command))
    3
    if (capabilities[i].startsWith(command))
    3
    if (capas[i].startsWith(command))
    Differences
    Expression1Expression2Difference
    capabilitiescapasVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression capabilities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression capas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (capas[i].startsWith(command))
                                          
    4
    return capas[i];
    Preondition Violations
    Unmatched statement return capas[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return capas[i];
    4
    return capas[i];
    4
    return true;
    4
    return true;
    Preondition Violations
    Unmatched return true;
                                  
                                  
    5
    return null;
    Preondition Violations
    Unmatched return null;
    5
    return null;
    5
    return false;
    5
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    Precondition Violations (10)
    Row Violation
    1Expression capabilities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression capas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression capabilities cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression capas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement return capas[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return capas[i];
    7Unmatched return true;
    8Unmatched return null;
    9Unmatched return false;
    10Clone fragment #1 returns variables , while Clone fragment #2 returns variables i