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)); | |
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) | 1.0 |
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) | 7.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
45 | res.sampleEnd(); | 34 | res.sampleEnd(); | |||||||||||
46 | res.setSampleLabel(httpMethod.getURI().toString()); |
| 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()); |
| 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); |
| 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)); |
| 45 | res.setResponseHeaders(getResponseHeaders(httpMethod)); |
Row | Violation |
---|