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/HTTPSampler2.java | |||
Method name: String sendPutData(PutMethod)
|
Method name: String sendPostData(PostMethod)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if(put.getRequestEntity().isRepeatable()) {↵ | 1 | if(post.getRequestEntity().isRepeatable()) {↵ | |
2 | ByteArrayOutputStream bos = new ByteArrayOutputStream();↵ | 2 | ByteArrayOutputStream bos = new ByteArrayOutputStream();↵ | |
3 | put.getRequestEntity().writeRequest(bos);↵ | 3 | post.getRequestEntity().writeRequest(bos);↵ | |
4 | bos.flush();↵ | 4 | bos.flush();↵ | |
5 | // We get the posted bytes as UTF-8, since java is using UTF-8↵ | 5 | // We get the posted bytes as UTF-8, since java is using UTF-8↵ | |
6 | putBody.append(new String(bos.toByteArray() , "UTF-8")); // $NON-NLS-1$↵ | 6 | postedBody.append(new String(bos.toByteArray() , "UTF-8")); // $NON-NLS-1$↵ | |
7 | bos.close();↵ | 7 | bos.close();↵ | |
8 | }↵ | 8 | ↵ | |
9 | }↵ | |||
9 | else {↵ | 10 | else {↵ | |
10 | putBody.append("<RequestEntity was not repeatable, cannot view what was sent>");↵ | 11 | postedBody.append("<RequestEntity was not repeatable, cannot view what was sent>");↵ | |
11 | } | 12 | } | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 49 |
Number of mapped statements | 7 |
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) | 4.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33 | if (put.getRequestEntity().isRepeatable()) |
| 90 | if (post.getRequestEntity().isRepeatable()) | |||||||||||||
34 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); | 91 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); | ||||||||||||||
35 | put.getRequestEntity().writeRequest(bos); |
| 92 | post.getRequestEntity().writeRequest(bos); | |||||||||||||
36 | bos.flush(); | 93 | bos.flush(); | ||||||||||||||
37 | putBody.append(new String(bos.toByteArray(), "UTF-8")); |
| 94 | postedBody.append(new String(bos.toByteArray(), "UTF-8")); | |||||||||||||
38 | bos.close(); | 95 | bos.close(); | ||||||||||||||
else | else | ||||||||||||||||
39 | putBody.append("<RequestEntity was not repeatable, cannot view what was sent>"); |
| 96 | postedBody.append("<RequestEntity was not repeatable, cannot view what was sent>"); |
Row | Violation |
---|