checkContentLength(connection, expectedUrl.length); checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); assertEquals( URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding)); connection.disconnect();
checkContentLength(connection, expectedUrl.length); checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); assertEquals( URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding)); connection.disconnect();
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/PostWriterTest.java
Method name: void testSendFormData_Urlencoded() Method name: void testSendFormData_Urlencoded()
Number of AST nodes: 4 Number of AST nodes: 4
1
checkContentLength(connection, expectedUrl.length);
1
checkContentLength(connection, expectedUrl.length);
2
        checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
2
        checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
3
        assertEquals(
3
        assertEquals(
4
                URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), 
4
                URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), 
5
                URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding)); 
5
                URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding)); 
6
        connection.disconnect();
6
        connection.disconnect();
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.0
Clones locationClones are in the same method
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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 1
    Mapped Statements
    ID Statement ID Statement
    54
    checkContentLength(connection, expectedUrl.length);
    108
    checkContentLength(connection, expectedUrl.length);
    55
    checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
    109
    checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
    56
    assertEquals(URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding));
    110
    assertEquals(URLDecoder.decode(new String(expectedUrl, "US-ASCII"), contentEncoding), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), contentEncoding));
    57
    connection.disconnect();
    111
    connection.disconnect();
    Precondition Violations (0)
    Row Violation