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/HTTPSampler2.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/SoapSampler.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)1.0
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)7.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    45
    res.sampleEnd();
    34
    res.sampleEnd();
    46
    res.setSampleLabel(httpMethod.getURI().toString());
    46
    res.setSampleLabel(httpMethod.getURI().toString());
    35
    res.setSampleLabel(httpMethod.getURI().toString());
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.HttpMethodBaseorg.apache.commons.httpclient.methods.PostMethodSUBCLASS_TYPE_MISMATCH
    35
    res.setSampleLabel(httpMethod.getURI().toString());
    47
    res.setResponseCode(Integer.toString(statusCode));
    36
    res.setResponseCode(Integer.toString(statusCode));
    48
    res.setSuccessful(isSuccessCode(statusCode));
    37
    res.setSuccessful(isSuccessCode(statusCode));
    49
    res.setResponseMessage(httpMethod.getStatusText());
    49
    res.setResponseMessage(httpMethod.getStatusText());
    38
    res.setResponseMessage(httpMethod.getStatusText());
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.HttpMethodBaseorg.apache.commons.httpclient.methods.PostMethodSUBCLASS_TYPE_MISMATCH
    38
    res.setResponseMessage(httpMethod.getStatusText());
    50
    String ct = null;
    39
    String ct = null;
    51
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    51
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    40
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.HttpMethodBaseorg.apache.commons.httpclient.methods.PostMethodSUBCLASS_TYPE_MISMATCH
    40
    org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
    52
    if (h != null)
    41
    if (h != null)
    53
    ct = h.getValue();
    42
    ct = h.getValue();
    54
    res.setContentType(ct);
    43
    res.setContentType(ct);
    55
    res.setEncodingAndType(ct);
    44
    res.setEncodingAndType(ct);
    56
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    56
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    45
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    Differences
    Expression1Expression2Difference
    org.apache.commons.httpclient.HttpMethodBaseorg.apache.commons.httpclient.methods.PostMethodSUBCLASS_TYPE_MISMATCH
    45
    res.setResponseHeaders(getResponseHeaders(httpMethod));
    Precondition Violations (0)
    Row Violation