SSLSocketFactory sslfac = getSSLSocketFactory(); Socket sock = sslfac.createSocket( socket, host, port, autoClose ); setSocket(sock); return wrapSocket(sock);
SSLSocketFactory sslfac = getSSLSocketFactory(); Socket sock = sslfac.createSocket( host, port, clientHost, clientPort ); setSocket(sock); return wrapSocket(sock);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/HttpSSLProtocolSocketFactory.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/HttpSSLProtocolSocketFactory.java
Method name: Socket createSocket(Socket, String, int, boolean) Method name: Socket createSocket(String, int, InetAddress, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
SSLSocketFactory sslfac = getSSLSocketFactory();
1
SSLSocketFactory sslfac = getSSLSocketFactory();
2
    	Socket sock = sslfac.createSocket(
2
        Socket sock = sslfac.createSocket(
3
            socket,
3
            host,
4
            host,
4
            port,
5
            port,
5
            clientHost,
6
            autoClose
6
            clientPort
7
        );
7
        );
8
        setSocket(sock);
8
        setSocket(sock);
9
    	return wrapSocket(sock);
9
        return wrapSocket(sock);
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 comparisons16
  1. {Non-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 2
    Mapped Statements
    ID Statement ID Statement
    1
    SSLSocketFactory sslfac = getSSLSocketFactory();
    1
    SSLSocketFactory sslfac = getSSLSocketFactory();
    2
    Socket sock = sslfac.createSocket(socket, host, port, autoClose);
    2
    Socket sock = sslfac.createSocket(socket, host, port, autoClose);
    2
    Socket sock = sslfac.createSocket(host, port, clientHost, clientPort);
    Differences
    Expression1Expression2Difference
    sockethostVARIABLE_NAME_MISMATCH
    java.net.Socketjava.lang.StringVARIABLE_TYPE_MISMATCH
    hostportVARIABLE_NAME_MISMATCH
    java.lang.StringintVARIABLE_TYPE_MISMATCH
    portclientHostVARIABLE_NAME_MISMATCH
    intjava.net.InetAddressVARIABLE_TYPE_MISMATCH
    autoCloseclientPortVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.net.Socket of variable socket does not match with type java.lang.String of variable host
    • Make classes java.net.Socket and java.lang.String extend a common superclass
    Type java.lang.String of variable host does not match with type int of variable port
    Type int of variable port does not match with type java.net.InetAddress of variable clientHost
    Type boolean of variable autoClose does not match with type int of variable clientPort
    2
    Socket sock = sslfac.createSocket(host, port, clientHost, clientPort);
    3
    setSocket(sock);
    3
    setSocket(sock);
    4
    return wrapSocket(sock);
    4
    return wrapSocket(sock);
    Precondition Violations (4)
    Row Violation
    1Type java.net.Socket of variable socket does not match with type java.lang.String of variable host
    2Type java.lang.String of variable host does not match with type int of variable port
    3Type int of variable port does not match with type java.net.InetAddress of variable clientHost
    4Type boolean of variable autoClose does not match with type int of variable clientPort