checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false); checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false); checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false); // A HTTP POST request contentEncoding = "UTF-8"; String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d="; String testPostRequest = "POST " + url + " HTTP/1.0\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true); checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true); checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true); // A HTTP POST request, with unknown encoding contentEncoding = ""; String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F"; String testPostRequest = "POST " + url + " HTTP/1.1\r\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
Method name: void testRepeatedArguments() Method name: void testEncodedArguments()
Number of AST nodes: 6 Number of AST nodes: 6
1
checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false);
1
checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true);
2
        checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false);
2
        checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true);
3
        checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false);
3
        checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true);
4
        
4
        // A HTTP POST request
5
        // A HTTP POST request, with unknown encoding
5
        contentEncoding = "UTF-8";
6
        contentEncoding = "";
6
        String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d=";
7
        String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F";
7
        String testPostRequest = "POST " + url + " HTTP/1.0\n"
8
        String testPostRequest = "POST " + url + " HTTP/1.1\r\n"
8
                + "Content-type: "
9
            + "Content-type: "
9
                + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n"
10
            + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n"
10
                + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n"
11
            + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n"
11
                + "\r\n"
12
            + "\r\n"
12
                + postBody;
13
            + postBody;
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.0
Clones locationClones are declared in the same class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false);
    19
    checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false);
    26
    checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true);
    Differences
    Expression1Expression2Difference
    102LITERAL_VALUE_MISMATCH
    "d""query"LITERAL_VALUE_MISMATCH
    "1""What?"LITERAL_VALUE_MISMATCH
    "1""What%3F"LITERAL_VALUE_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    26
    checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true);
    20
    checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false);
    20
    checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false);
    25
    checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true);
    Differences
    Expression1Expression2Difference
    111LITERAL_VALUE_MISMATCH
    "d""space"LITERAL_VALUE_MISMATCH
    """a b"LITERAL_VALUE_MISMATCH
    """a+b"LITERAL_VALUE_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    25
    checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true);
    21
    checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false);
    21
    checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false);
    24
    checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true);
    Differences
    Expression1Expression2Difference
    120LITERAL_VALUE_MISMATCH
    "d""abc?SPACE"LITERAL_VALUE_MISMATCH
    """a b"LITERAL_VALUE_MISMATCH
    """a+b"LITERAL_VALUE_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    24
    checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true);
    22
    contentEncoding = "UTF-8";
    22
    contentEncoding = "UTF-8";
    27
    contentEncoding = "";
    Differences
    Expression1Expression2Difference
    "UTF-8"""LITERAL_VALUE_MISMATCH
    27
    contentEncoding = "";
    23
    String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d=";
    23
    String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d=";
    28
    String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F";
    Differences
    Expression1Expression2Difference
    "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d=""abc%3FSPACE=a+b&space=a%20b&query=What%3F"LITERAL_VALUE_MISMATCH
    28
    String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F";
    24
    String testPostRequest = "POST " + url + " HTTP/1.0\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
    24
    String testPostRequest = "POST " + url + " HTTP/1.0\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
    29
    String testPostRequest = "POST " + url + " HTTP/1.1\r\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
    Differences
    Expression1Expression2Difference
    " HTTP/1.0\n"" HTTP/1.1\r\n"LITERAL_VALUE_MISMATCH
    29
    String testPostRequest = "POST " + url + " HTTP/1.1\r\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables contentEncoding, testPostRequest, postBody , while Clone fragment #2 returns variables testPostRequest, contentEncoding, postBody