for (int i = 0; i < SHARE_TAGS.length; i++) { if (SHARE_TAGS[i].equals(mode)) { return i; } }
for (int i = 0; i < REDIRECT_CODES.length; i++) { if (REDIRECT_CODES[i].equals(code)) { return true; } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/config/CSVDataSetBeanInfo.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
Method name: int getShareModeAsInt(String) Method name: boolean isRedirect()
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < SHARE_TAGS.length; i++) {
1
for (int i = 0; i < REDIRECT_CODES.length; i++) {
2
            if (SHARE_TAGS[i].equals(mode)) {
2
			if (REDIRECT_CODES[i].equals(code)) {
3
                return i;
4
            }
5
        
3
				return true;
4
			}
6
}
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)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < SHARE_TAGS.length; i++)
    3
    for (int i = 0; i < SHARE_TAGS.length; i++)
    3
    for (int i = 0; i < REDIRECT_CODES.length; i++)
    Differences
    Expression1Expression2Difference
    SHARE_TAGSREDIRECT_CODESVARIABLE_NAME_MISMATCH
    3
    for (int i = 0; i < REDIRECT_CODES.length; i++)
    4
    if (SHARE_TAGS[i].equals(mode))
    4
    if (SHARE_TAGS[i].equals(mode))
    4
    if (REDIRECT_CODES[i].equals(code))
    Differences
    Expression1Expression2Difference
    modecodeVARIABLE_NAME_MISMATCH
    SHARE_TAGSREDIRECT_CODESVARIABLE_NAME_MISMATCH
    4
    if (REDIRECT_CODES[i].equals(code))
                                  
    5
    return true;
    Preondition Violations
    Unmatched return true;
    5
    return true;
    5
    return i;
    5
    return i;
    Preondition Violations
    Unmatched statement return i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return i;
                            
    Precondition Violations (5)
    Row Violation
    1Unmatched return true;
    2Unmatched statement return i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return i;
    4Clone fragment #1 returns variables i , while Clone fragment #2 returns variables
    5The refactoring of the clones is infeasible, because classes org.apache.jmeter.config.CSVDataSetBeanInfo and org.apache.jmeter.protocol.http.sampler.HTTPSampleResult do not have a common superclass