File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java | |||
Method name: byte[] createExpectedFilepartOutput(String, String, File, String, byte[], boolean, boolean)
|
Method name: byte[] createExpectedFilepartOutput(String, String, File, String, byte[], boolean, boolean)
|
|||
Number of AST nodes: 25 | Number of AST nodes: 25 | |||
1 | if(firstMultipart) {↵ | 1 | if(firstMultipart) {↵ | |
2 | output.write(DASH_DASH);↵ | 2 | output.write(DASH_DASH);↵ | |
3 | output.write(boundaryString.getBytes(httpEncoding));↵ | 3 | output.write(boundaryString.getBytes(ISO_8859_1));↵ | |
4 | output.write(CRLF);↵ | 4 | output.write(CRLF);↵ | |
5 | }↵ | 5 | }↵ | |
6 | // replace all backslash with double backslash↵ | 6 | // replace all backslash with double backslash↵ | |
7 | String filename = file.getName();↵ | 7 | String filename = file.getName();↵ | |
8 | output.write("Content-Disposition: form-data; name=\"".getBytes(httpEncoding));↵ | 8 | output.write("Content-Disposition: form-data; name=\"".getBytes(ISO_8859_1));↵ | |
9 | output.write(fileField.getBytes(httpEncoding));↵ | 9 | output.write(fileField.getBytes(ISO_8859_1));↵ | |
10 | output.write(("\"; filename=\"" + filename + "\"").getBytes(httpEncoding));↵ | 10 | output.write(("\"; filename=\"" + filename + "\"").getBytes(ISO_8859_1));↵ | |
11 | output.write(CRLF);↵ | 11 | output.write(CRLF);↵ | |
12 | output.write("Content-Type: ".getBytes(httpEncoding));↵ | 12 | output.write("Content-Type: ".getBytes(ISO_8859_1));↵ | |
13 | output.write(mimeType.getBytes(httpEncoding));↵ | 13 | output.write(mimeType.getBytes(ISO_8859_1));↵ | |
14 | output.write(CRLF);↵ | 14 | output.write(CRLF);↵ | |
15 | output.write("Content-Transfer-Encoding: binary".getBytes(httpEncoding));↵ | 15 | output.write("Content-Transfer-Encoding: binary".getBytes(ISO_8859_1));↵ | |
16 | output.write(CRLF);↵ | 16 | output.write(CRLF);↵ | |
17 | output.write(CRLF);↵ | 17 | output.write(CRLF);↵ | |
18 | output.write(fileContent);↵ | 18 | output.write(fileContent);↵ | |
19 | output.write(CRLF);↵ | 19 | output.write(CRLF);↵ | |
20 | output.write(DASH_DASH);↵ | 20 | output.write(DASH_DASH);↵ | |
21 | output.write(boundaryString.getBytes(httpEncoding));↵ | 21 | output.write(boundaryString.getBytes(ISO_8859_1));↵ | |
22 | if(lastMultipart) {↵ | 22 | if(lastMultipart) {↵ | |
23 | output.write(DASH_DASH);↵ | 23 | output.write(DASH_DASH);↵ | |
24 | }↵ | 24 | }↵ | |
25 | output.write(CRLF);↵ | 25 | output.write(CRLF);↵ | |
26 | ↵ | 26 | ↵ | |
27 | output.flush();↵ | 27 | output.flush();↵ | |
28 | output.close();↵ | 28 | output.close();↵ | |
29 | return output.toByteArray(); | 29 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 247 |
Number of mapped statements | 25 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 39.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | if (firstMultipart) | 3 | if (firstMultipart) | |||||||||||
5 | output.write(DASH_DASH); | 4 | output.write(DASH_DASH); | |||||||||||
6 | output.write(boundaryString.getBytes(httpEncoding)); |
| 5 | output.write(boundaryString.getBytes(ISO_8859_1)); | ||||||||||
7 | output.write(CRLF); | 6 | output.write(CRLF); | |||||||||||
8 | String filename = file.getName(); | 7 | String filename = file.getName(); | |||||||||||
9 | output.write("Content-Disposition: form-data; name=\"".getBytes(httpEncoding)); |
| 8 | output.write("Content-Disposition: form-data; name=\"".getBytes(ISO_8859_1)); | ||||||||||
10 | output.write(fileField.getBytes(httpEncoding)); |
| 9 | output.write(fileField.getBytes(ISO_8859_1)); | ||||||||||
11 | output.write(("\"; filename=\"" + filename + "\"").getBytes(httpEncoding)); |
| 10 | output.write(("\"; filename=\"" + filename + "\"").getBytes(ISO_8859_1)); | ||||||||||
12 | output.write(CRLF); | 11 | output.write(CRLF); | |||||||||||
13 | output.write("Content-Type: ".getBytes(httpEncoding)); |
| 12 | output.write("Content-Type: ".getBytes(ISO_8859_1)); | ||||||||||
14 | output.write(mimeType.getBytes(httpEncoding)); |
| 13 | output.write(mimeType.getBytes(ISO_8859_1)); | ||||||||||
15 | output.write(CRLF); | 14 | output.write(CRLF); | |||||||||||
16 | output.write("Content-Transfer-Encoding: binary".getBytes(httpEncoding)); |
| 15 | output.write("Content-Transfer-Encoding: binary".getBytes(ISO_8859_1)); | ||||||||||
|
| 16 | output.write(CRLF); | |||||||||||
17 | output.write(CRLF); | 17 | output.write(CRLF); | |||||||||||
18 | output.write(CRLF); | 17 | output.write(CRLF); | |||||||||||
19 | output.write(fileContent); | 18 | output.write(fileContent); | |||||||||||
20 | output.write(CRLF); | 19 | output.write(CRLF); | |||||||||||
21 | output.write(DASH_DASH); | 20 | output.write(DASH_DASH); | |||||||||||
22 | output.write(boundaryString.getBytes(httpEncoding)); |
| 21 | output.write(boundaryString.getBytes(ISO_8859_1)); | ||||||||||
23 | if (lastMultipart) | 22 | if (lastMultipart) | |||||||||||
24 | output.write(DASH_DASH); | 23 | output.write(DASH_DASH); | |||||||||||
25 | output.write(CRLF); | 24 | output.write(CRLF); | |||||||||||
26 | output.flush(); | 25 | output.flush(); | |||||||||||
27 | output.close(); | 26 | output.close(); | |||||||||||
28 | return output.toByteArray(); | 27 | return output.toByteArray(); |
Row | Violation |
---|---|
1 | Unmatched statement output.write(CRLF); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |