if (res != null) { res.setURL(u); res.setHTTPMethod(method); res.setRequestHeaders(getConnectionHeaders(conn)); res.setCookies(cookies); }
res.setResponseCodeOK(); res.setResponseMessageOK(); res.setSuccessful(true);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
Method name: HttpURLConnection setupConnection(URL, String, HTTPSampleResult) Method name: SampleResult sample(Entry)
Number of AST nodes: 5 Number of AST nodes: 3
1
if (res != null) {
2
            res.setURL(u);
3
            res.setHTTPMethod(method);
1
res.setResponseCodeOK();
4
            res.setRequestHeaders(getConnectionHeaders(conn));
2
			            res.setRe
5
      
3
sponseMessageOK();
6
      res.setCookies(cookies);
4
			    		res.set
7
        }
5
Successful(true);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    23
    res.setURL(u);
                                        
    24
    res.setHTTPMethod(method);
                                                                
    25
    res.setRequestHeaders(getConnectionHeaders(conn));
    25
    res.setRequestHeaders(getConnectionHeaders(conn));
    61
    res.setResponseMessageOK();
    Differences
    Expression1Expression2Difference
    setRequestHeaderssetResponseMessageOKMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.jmeter.protocol.http.sampler.HTTPSampleResultorg.apache.jmeter.samplers.SampleResultSUBCLASS_TYPE_MISMATCH
    res.setRequestHeaders(getConnectionHeaders(conn))res.setResponseMessageOK()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression res.setRequestHeaders(getConnectionHeaders(conn)) is a void method call, and thus it cannot be parameterized
    Expression res.setResponseMessageOK() is a void method call, and thus it cannot be parameterized
    Expression res.setRequestHeaders(getConnectionHeaders(conn)) is a void method call, and thus it cannot be parameterized
    Expression res.setResponseMessageOK() is a void method call, and thus it cannot be parameterized
    61
    res.setResponseMessageOK();
    26
    res.setCookies(cookies);
    26
    res.setCookies(cookies);
    60
    res.setResponseCodeOK();
    Differences
    Expression1Expression2Difference
    setCookiessetResponseCodeOKMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.jmeter.protocol.http.sampler.HTTPSampleResultorg.apache.jmeter.samplers.SampleResultSUBCLASS_TYPE_MISMATCH
    res.setCookies(cookies)res.setResponseCodeOK()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression res.setCookies(cookies) is a void method call, and thus it cannot be parameterized
    Expression res.setResponseCodeOK() is a void method call, and thus it cannot be parameterized
    Expression res.setCookies(cookies) is a void method call, and thus it cannot be parameterized
    Expression res.setResponseCodeOK() is a void method call, and thus it cannot be parameterized
    60
    res.setResponseCodeOK();
                                                            
    62
    res.setSuccessful(true);
    Precondition Violations (8)
    Row Violation
    1Expression res.setRequestHeaders(getConnectionHeaders(conn)) is a void method call, and thus it cannot be parameterized
    2Expression res.setResponseMessageOK() is a void method call, and thus it cannot be parameterized
    3Expression res.setRequestHeaders(getConnectionHeaders(conn)) is a void method call, and thus it cannot be parameterized
    4Expression res.setResponseMessageOK() is a void method call, and thus it cannot be parameterized
    5Expression res.setCookies(cookies) is a void method call, and thus it cannot be parameterized
    6Expression res.setResponseCodeOK() is a void method call, and thus it cannot be parameterized
    7Expression res.setCookies(cookies) is a void method call, and thus it cannot be parameterized
    8Expression res.setResponseCodeOK() is a void method call, and thus it cannot be parameterized