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)); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 81 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 51.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34 | res.sampleEnd(); | 45 | res.sampleEnd(); | |||||||||||
35 | res.setSampleLabel(httpMethod.getURI().toString()); |
| 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()); |
| 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); |
| 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)); |
| 56 | res.setResponseHeaders(getResponseHeaders(httpMethod)); |
Row | Violation |
---|