output.write(CRLF); output.write("Content-Transfer-Encoding: 8bit".getBytes(HTTP_ENCODING)); output.write(CRLF); output.write(CRLF); if(contentEncoding != null) { output.write(descriptionValue.getBytes(contentEncoding)); } else { output.write(descriptionValue.getBytes()); } output.write(CRLF); output.write(DASH_DASH); output.write(boundaryString.getBytes(HTTP_ENCODING)); if(lastMultipart) { output.write(DASH_DASH); } output.write(CRLF); output.flush(); output.close(); return output.toByteArray();
output.write(CRLF); output.write("Content-Transfer-Encoding: 8bit".getBytes(ISO_8859_1)); output.write(CRLF); output.write(CRLF); if(contentEncoding != null) { output.write(descriptionValue.getBytes(contentEncoding)); } else { output.write(descriptionValue.getBytes()); } output.write(CRLF); output.write(DASH_DASH); output.write(boundaryString.getBytes(ISO_8859_1)); if(lastMultipart) { output.write(DASH_DASH); } output.write(CRLF); output.flush(); output.close(); return output.toByteArray();
Clone fragments detected by clone detection tool
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[] createExpectedFormdataOutput(String, String, String, String, String, String, boolean, boolean) Method name: byte[] createExpectedFormdataOutput(String, String, String, String, String, String, boolean, boolean)
Number of AST nodes: 16 Number of AST nodes: 16
1
output.write(CRLF);
1
output.write(CRLF);
2
        output.write("Content-Transfer-Encoding: 8bit".getBytes(HTTP_ENCODING));
2
        output.write("Content-Transfer-Encoding: 8bit".getBytes(ISO_8859_1));
3
        output.write(CRLF);
3
        output.write(CRLF);
4
        output.write(CRLF);
4
        output.write(CRLF);
5
        if(contentEncoding != null) {
5
        if(contentEncoding != null) {
6
            output.write(descriptionValue.getBytes(contentEncoding));
6
            output.write(descriptionValue.getBytes(contentEncoding));
7
        }
7
        }
8
        else {
8
        else {
9
            output.write(descriptionValue.getBytes());
9
            output.write(descriptionValue.getBytes());
10
        }
10
        }
11
        output.write(CRLF);
11
        output.write(CRLF);
12
        output.write(DASH_DASH);
12
        output.write(DASH_DASH);
13
        output.write(boundaryString.getBytes(HTTP_ENCODING));
13
        output.write(boundaryString.getBytes(ISO_8859_1));
14
        if(lastMultipart) {
14
        if(lastMultipart) {
15
            output.write(DASH_DASH);
15
            output.write(DASH_DASH);
16
        }
16
        }
17
        output.write(CRLF);
17
        output.write(CRLF);
18
                
18
                
19
        output.flush();
19
        output.flush();
20
        output.close();
20
        output.close();
21
        return output.toByteArray();
21
        return output.toByteArray();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons87
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)9.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    35
    output.write(CRLF);
    34
    output.write(CRLF);
    36
    output.write("Content-Transfer-Encoding: 8bit".getBytes(HTTP_ENCODING));
    36
    output.write("Content-Transfer-Encoding: 8bit".getBytes(HTTP_ENCODING));
    35
    output.write("Content-Transfer-Encoding: 8bit".getBytes(ISO_8859_1));
    Differences
    Expression1Expression2Difference
    HTTP_ENCODINGISO_8859_1VARIABLE_NAME_MISMATCH
    35
    output.write("Content-Transfer-Encoding: 8bit".getBytes(ISO_8859_1));
                                                  
    36
    output.write(CRLF);
    Preondition Violations
    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
    36
    output.write(CRLF);
    37
    output.write(CRLF);
    37
    output.write(CRLF);
    38
    output.write(CRLF);
    37
    output.write(CRLF);
    39
    if (contentEncoding != null)
    38
    if (contentEncoding != null)
    40
    output.write(descriptionValue.getBytes(contentEncoding));
    39
    output.write(descriptionValue.getBytes(contentEncoding));
    else
    else
    41
    output.write(descriptionValue.getBytes());
    40
    output.write(descriptionValue.getBytes());
    42
    output.write(CRLF);
    41
    output.write(CRLF);
    43
    output.write(DASH_DASH);
    42
    output.write(DASH_DASH);
    44
    output.write(boundaryString.getBytes(HTTP_ENCODING));
    44
    output.write(boundaryString.getBytes(HTTP_ENCODING));
    43
    output.write(boundaryString.getBytes(ISO_8859_1));
    Differences
    Expression1Expression2Difference
    HTTP_ENCODINGISO_8859_1VARIABLE_NAME_MISMATCH
    43
    output.write(boundaryString.getBytes(ISO_8859_1));
    45
    if (lastMultipart)
    44
    if (lastMultipart)
    46
    output.write(DASH_DASH);
    45
    output.write(DASH_DASH);
    47
    output.write(CRLF);
    46
    output.write(CRLF);
    48
    output.flush();
    47
    output.flush();
    49
    output.close();
    48
    output.close();
    50
    return output.toByteArray();
    49
    return output.toByteArray();
    Precondition Violations (1)
    Row Violation
    1Unmatched statement output.write(CRLF); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted