for (int i = 0; i < capas.length; i++) { if (capas[i].startsWith(command)) { return capas[i]; } }
for( int i=0; i<SaslMechanism.length; i++) { if( SaslMechanism[i].equalsIgnoreCase(mechanism)) { return SASL+i; } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/pop3/POP3Store.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/util/AuthenticationManager.java
Method name: String getCapa(String) Method name: int getSaslCode(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < capas.length; i++) {
1
for( int i=0; i<SaslMechanism.length; i++) {
2
			if (capas[i].startsWith(command)) {
2
			if( SaslMechanism[i].equalsIgnoreCase(mechanism)) {
3
				return capas[i];
3
				return SASL+i;
4
			}
4
			}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  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 fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int i = 0; i < capas.length; i++)
    2
    for (int i = 0; i < capas.length; i++)
    1
    for (int i = 0; i < SaslMechanism.length; i++)
    Differences
    Expression1Expression2Difference
    capasSaslMechanismVARIABLE_NAME_MISMATCH
    1
    for (int i = 0; i < SaslMechanism.length; i++)
    3
    if (capas[i].startsWith(command))
    3
    if (capas[i].startsWith(command))
    2
    if (SaslMechanism[i].equalsIgnoreCase(mechanism))
    Differences
    Expression1Expression2Difference
    startsWithequalsIgnoreCaseMETHOD_INVOCATION_NAME_MISMATCH
    commandmechanismVARIABLE_NAME_MISMATCH
    capasSaslMechanismVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression capas[i].startsWith(command) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression SaslMechanism[i].equalsIgnoreCase(mechanism) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (SaslMechanism[i].equalsIgnoreCase(mechanism))
                                          
    3
    return SASL + i;
    Preondition Violations
    Unmatched statement return SASL + i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return SASL + i;
    3
    return SASL + i;
    4
    return capas[i];
    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];
                                          
    Precondition Violations (6)
    Row Violation
    1Expression capas[i].startsWith(command) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression SaslMechanism[i].equalsIgnoreCase(mechanism) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement return SASL + i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return SASL + i;
    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];