for(int i=0; i < headerTransArray.length; i++) { if(headerTransArray[i].equalsIgnoreCase(n)) { return i+1; } }
for (int i=0;i<nonProxyHostSuffixSize;i++){ if (host.endsWith((String)nonProxyHostSuffix.get(i))) { return true; } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
Method name: int translateHeader(String) Method name: boolean isPartialMatch(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
for(int i=0; i < headerTransArray.length; i++) {
1
for (int i=0;i<nonProxyHostSuffixSize;i++){
2
            if(headerTransArray[i].equalsIgnoreCase(n)) {
2
            if (host.endsWith((String)nonProxyHostSuffix.get(i))) {
3
                return i+1;
3
                return true;
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 having the same super class
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)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < headerTransArray.length; i++)
    1
    for (int i = 0; i < headerTransArray.length; i++)
    1
    for (int i = 0; i < nonProxyHostSuffixSize; i++)
    Differences
    Expression1Expression2Difference
    headerTransArray.lengthnonProxyHostSuffixSizeTYPE_COMPATIBLE_REPLACEMENT
    1
    for (int i = 0; i < nonProxyHostSuffixSize; i++)
    2
    if (headerTransArray[i].equalsIgnoreCase(n))
    2
    if (headerTransArray[i].equalsIgnoreCase(n))
    2
    if (host.endsWith((String)nonProxyHostSuffix.get(i)))
    Differences
    Expression1Expression2Difference
    equalsIgnoreCaseendsWithMETHOD_INVOCATION_NAME_MISMATCH
    n(String)nonProxyHostSuffix.get(i)TYPE_COMPATIBLE_REPLACEMENT
    headerTransArray[i]hostTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression headerTransArray[i].equalsIgnoreCase(n) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression host.endsWith((String)nonProxyHostSuffix.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (String)nonProxyHostSuffix.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression headerTransArray[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (host.endsWith((String)nonProxyHostSuffix.get(i)))
                                  
    3
    return true;
    Preondition Violations
    Unmatched return true;
    3
    return true;
    3
    return i + 1;
    3
    return i + 1;
    Preondition Violations
    Unmatched statement return i + 1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return i + 1;
                                    
    Precondition Violations (8)
    Row Violation
    1Expression headerTransArray[i].equalsIgnoreCase(n) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression host.endsWith((String)nonProxyHostSuffix.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression (String)nonProxyHostSuffix.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression headerTransArray[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched return true;
    6Unmatched statement return i + 1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return i + 1;
    8Clone fragment #1 returns variables i , while Clone fragment #2 returns variables