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/PostWriter.java | |||
Method name: String sendPostData(PostMethod)
|
Method name: void setHeaders(URLConnection, HTTPSampler)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | HTTPFileArg file = files[0];↵ | 1 | HTTPFileArg file = files[0];↵ | |
2 | if(!hasContentTypeHeader) {↵ | 2 | if(!hasContentTypeHeader) {↵ | |
3 | // Allow the mimetype of the file to control the content type↵ | 3 | // Allow the mimetype of the file to control the content type↵ | |
4 | if(file.getMimeType() != null && file.getMimeType().length() > 0) {↵ | 4 | if(file.getMimeType() != null && file.getMimeType().length() > 0) {↵ | |
5 | post.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType());↵ | 5 | connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType());↵ | |
6 | }↵ | 6 | }↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | post.setRequestHeader(HEADER_CONTENT_TYPE, APPLICATION_X_WWW_FORM_URLENCODED);↵ | 8 | connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED);↵ | |
9 | }↵ | 9 | }↵ | |
10 | } | 10 |
| |
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.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 9.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
44 | HTTPFileArg file = files[0]; | 45 | HTTPFileArg file = files[0]; | |||||
45 | if (!hasContentTypeHeader) | 46 | if (!hasContentTypeHeader) | |||||
46 | if (file.getMimeType() != null && file.getMimeType().length() > 0) | 47 | if (file.getMimeType() != null && file.getMimeType().length() > 0) | |||||
47 | post.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType()); |
| | |||||
else | | |||||||
48 | post.setRequestHeader(HEADER_CONTENT_TYPE, APPLICATION_X_WWW_FORM_URLENCODED); | | ||||||
|
| 49 | connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED); | |||||
|
| 48 | connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType()); |
Row | Violation |
---|---|
1 | Unmatched statement post.setRequestHeader(HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement post.setRequestHeader(HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |