if(!valuesAlreadyUrlEncoded) { String expectedTitle = URLEncoder.encode(titleValue, contentEncoding); String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding); expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription; } else { expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue; }
if(!valuesAlreadyUrlEncoded) { String expectedTitle = URLEncoder.encode(titleValue, contentEncoding); String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding); expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription; } else { expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
Method name: void checkPostRequestUrlEncoded(HTTPSamplerBase, HTTPSampleResult, String, String, String, String, String, String, boolean) Method name: void checkGetRequest_Parameters(HTTPSamplerBase, HTTPSampleResult, String, URL, String, String, String, String, boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
if(!valuesAlreadyUrlEncoded) {
1
if(!valuesAlreadyUrlEncoded) {
2
            String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);
2
            String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);
3
            String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);
3
            String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);
4
            expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
4
            expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
5
        }
5
        }
6
        else {
6
        else {
7
            expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
7
            expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
8
        }
8
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (!valuesAlreadyUrlEncoded)
    6
    if (!valuesAlreadyUrlEncoded)
    6
    String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);
    7
    String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);
    7
    String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);
    8
    String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);
    8
    expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
    8
    expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
    9
    expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
    Differences
    Expression1Expression2Difference
    expectedPostBodyexpectedQueryStringVARIABLE_NAME_MISMATCH
    9
    expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;
    else
    else
    9
    expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
    9
    expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
    10
    expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
    Differences
    Expression1Expression2Difference
    expectedPostBodyexpectedQueryStringVARIABLE_NAME_MISMATCH
    10
    expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
    Precondition Violations (0)
    Row Violation