res.sampleEnd(); // Done with the sampling proper. // Now collect the results into the HTTPSampleResult: res.setSampleLabel(httpMethod.getURI().toString()); // Pick up Actual path (after redirects) res.setResponseCode(Integer.toString(statusCode)); res.setSuccessful(isSuccessCode(statusCode)); res.setResponseMessage(httpMethod.getStatusText()); String ct = null; org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE); if (h != null)// Can be missing, e.g. on redirect { ct = h.getValue(); res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1 res.setEncodingAndType(ct); } res.setResponseHeaders(getResponseHeaders(httpMethod));
res.sampleEnd(); // Done with the sampling proper. // Now collect the results into the HTTPSampleResult: res.setSampleLabel(httpMethod.getURI().toString()); // Pick up Actual path (after redirects) res.setResponseCode(Integer.toString(statusCode)); res.setSuccessful(isSuccessCode(statusCode)); res.setResponseMessage(httpMethod.getStatusText()); String ct = null; org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE); if (h != null)// Can be missing, e.g. on redirect { ct = h.getValue(); res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1 res.setEncodingAndType(ct); } res.setResponseHeaders(getResponseHeaders(httpMethod));
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/SoapSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
Method name: HTTPSampleResult sample(URL, String, boolean, int) Method name: HTTPSampleResult sample(URL, String, boolean, int)
Number of AST nodes: 12 Number of AST nodes: 12
1
res.sampleEnd();
1
res.sampleEnd();
2
            // Done with the sampling proper.
2
			// Done with the sampling proper.
3
            // Now collect the results into the HTTPSampleResult:
3
			// Now collect the results into the HTTPSampleResult:
4
            res.setSampleLabel(httpMethod.getURI().toString());
4
			res.setSampleLabel(httpMethod.getURI().toString());
5
            // Pick up Actual path (after redirects)
5
            // Pick up Actual path (after redirects)
6
            
6
            
7
res.setResponseCode(Integer.toString(statusCode));
7
			res.setResponseCode(Integer.toString(statusCode));
8
            res.setSuccessful(isSuccessCode(statusCode));
8
			res.setSuccessful(isSuccessCode(statusCode));
9
            res.setResponseMessage(httpMethod.getStatusText());
9
			res.setResponseMessage(httpMethod.getStatusText());
10
            String ct = null;
10
			String ct = null;
11
            org.apache.commons.httpclient.Header h
11
			org.apache.commons.httpclient.Header h 
12
                    = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
12
                = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
13
            if (h != null)// Can be missing, e.g. on redirect
13
			if (h != null)// Can be missing, e.g. on redirect
14
            {
15
                
14
			{
16
ct = h.getValue();
15
				ct = h.getValue();
17
                res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1
16
				res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1
18
                res.setEncodingAndType(ct);
17
                res.setEncodingAndType(ct);
19
            }
20
            
18
			}
21
res.setResponseHeaders(getResponseHeaders(httpMethod));
19
			res.setResponseHeaders(getResponseHeaders(httpMethod));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are in different classes having the same super class
Number of node comparisons81
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)51.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    34
    res.sampleEnd();
    45
    res.sampleEnd();
    35
    res.setSampleLabel(httpMethod.getURI().toString());
    35
    res.setSampleLabel(httpMethod.getURI().toString());
    46
    res.setSampleLabel(httpMethod.getURI().toString());
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.methods.PostMethodorg.apache.commons.httpclient.HttpMethodBaseSUBCLASS_TYPE_MISMATCH
    46
    res.setSampleLabel(httpMethod.getURI().toString());
    36
    res.setResponseCode(Integer.toString(statusCode));
    47
    res.setResponseCode(Integer.toString(statusCode));
    37
    res.setSuccessful(isSuccessCode(statusCode));
    48
    res.setSuccessful(isSuccessCode(statusCode));
    38
    res.setResponseMessage(httpMethod.getStatusText());
    38
    res.setResponseMessage(httpMethod.getStatusText());
    49
    res.setResponseMessage(httpMethod.getStatusText());
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.methods.PostMethodorg.apache.commons.httpclient.HttpMethodBaseSUBCLASS_TYPE_MISMATCH
    49
    res.setResponseMessage(httpMethod.getStatusText());
    39
    String ct = null;
    50
    String ct = null;
    40
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    40
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    51
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.methods.PostMethodorg.apache.commons.httpclient.HttpMethodBaseSUBCLASS_TYPE_MISMATCH
    51
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    41
    if (h != null)
    52
    if (h != null)
    42
    ct = h.getValue();
    53
    ct = h.getValue();
    43
    res.setContentType(ct);
    54
    res.setContentType(ct);
    44
    res.setEncodingAndType(ct);
    55
    res.setEncodingAndType(ct);
    45
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    45
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    56
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.methods.PostMethodorg.apache.commons.httpclient.HttpMethodBaseSUBCLASS_TYPE_MISMATCH
    56
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    Precondition Violations (0)
    Row Violation