SSLSocketFactory sslfac = getSSLSocketFactory(); Socket sock = sslfac.createSocket( socket, host, port, autoClose ); setSocket(sock); return wrapSocket(sock);
SSLSocketFactory sslfac = getSSLSocketFactory(); Socket sock=sslfac.createSocket(address, port, localAddress, localPort); 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(InetAddress, 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,
4
            host,
5
            port,
6
            autoClose
7
        );
3
address, port, localAddress, localPort);
8
        setSocket(sock);
4
        setSocket(sock);
9
    	return wrapSocket(sock);
5
		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(address, port, localAddress, localPort);
    Differences
    Expression1Expression2Difference
    socketaddressVARIABLE_NAME_MISMATCH
    java.net.Socketjava.net.InetAddressVARIABLE_TYPE_MISMATCH
    hostportVARIABLE_NAME_MISMATCH
    java.lang.StringintVARIABLE_TYPE_MISMATCH
    portlocalAddressVARIABLE_NAME_MISMATCH
    intjava.net.InetAddressVARIABLE_TYPE_MISMATCH
    autoCloselocalPortVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.net.Socket of variable socket does not match with type java.net.InetAddress of variable address
    • Make classes java.net.Socket and java.net.InetAddress 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 localAddress
    Type boolean of variable autoClose does not match with type int of variable localPort
    2
    Socket sock = sslfac.createSocket(address, port, localAddress, localPort);
    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.net.InetAddress of variable address
    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 localAddress
    4Type boolean of variable autoClose does not match with type int of variable localPort