for (int i = 0; i < tags.length; i++) { if (tags[i].equals(mode)) { return i; } }
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/timers/ConstantThroughputTimerBeanInfo.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
Method name: int getCalcModeAsInt(String) Method name: boolean isPartialMatch(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < tags.length; i++) {
1
for (int i=0;i<nonProxyHostSuffixSize;i++){
2
			if (tags[i].equals(mode)) {
2
            if (host.endsWith((String)nonProxyHostSuffix.get(i))) {
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.4
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)4.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < tags.length; i++)
    1
    for (int i = 0; i < tags.length; i++)
    1
    for (int i = 0; i < nonProxyHostSuffixSize; i++)
    Differences
    Expression1Expression2Difference
    tags.lengthnonProxyHostSuffixSizeTYPE_COMPATIBLE_REPLACEMENT
    1
    for (int i = 0; i < nonProxyHostSuffixSize; i++)
    2
    if (tags[i].equals(mode))
    2
    if (tags[i].equals(mode))
    2
    if (host.endsWith((String)nonProxyHostSuffix.get(i)))
    Differences
    Expression1Expression2Difference
    mode(String)nonProxyHostSuffix.get(i)TYPE_COMPATIBLE_REPLACEMENT
    equalsendsWithMETHOD_INVOCATION_NAME_MISMATCH
    tags[i]hostTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (String)nonProxyHostSuffix.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tags[i].equals(mode) 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 tags[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;
    3
    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 (9)
    Row Violation
    1Expression (String)nonProxyHostSuffix.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression tags[i].equals(mode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression host.endsWith((String)nonProxyHostSuffix.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression tags[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched return true;
    6Unmatched statement return i; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return i;
    8Clone fragment #1 returns variables i , while Clone fragment #2 returns variables
    9The refactoring of the clones is infeasible, because classes org.apache.jmeter.timers.ConstantThroughputTimerBeanInfo and org.apache.jmeter.protocol.http.sampler.HTTPSampler2 do not have a common superclass