if (host == null || host.length() == 0) { // it's not set, lets check if the user passed // proxy host and port from command line host = System.getProperty("http.proxyHost"); if (host != null) { this.setProxyHost(host); } }
if (port == null || port.length() == 0) { // it's not set, lets check if the user passed // proxy host and port from command line port = System.getProperty("http.proxyPort"); if (port != null) { this.setProxyPort(port); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Method name: void checkProxy() Method name: void checkProxy()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (host == null || host.length() == 0) {
1
if (port == null || port.length() == 0) {
2
				// it's not set, lets check if the user passed
2
				// it's not set, lets check if the user passed
3
				// proxy host and port from command line
3
				// proxy host and port from command line
4
                host = System.getProperty("http.proxyHost");
4
                port = System.getProperty("http.proxyPort");
5
				if (host != null) {
5
				if (port != null) {
6
					this.setProxyHost(host);
6
					this.setProxyPort(port);
7
				}
7
				}
8
			}
8
			}
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.8
Clones locationClones are in the same method
Number of node comparisons9
  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)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (host == null || host.length() == 0)
    5
    if (host == null || host.length() == 0)
    9
    if (port == null || port.length() == 0)
    Differences
    Expression1Expression2Difference
    hostportVARIABLE_NAME_MISMATCH
    hostportVARIABLE_NAME_MISMATCH
    9
    if (port == null || port.length() == 0)
    6
    host = System.getProperty("http.proxyHost");
    6
    host = System.getProperty("http.proxyHost");
    10
    port = System.getProperty("http.proxyPort");
    Differences
    Expression1Expression2Difference
    hostportVARIABLE_NAME_MISMATCH
    "http.proxyHost""http.proxyPort"LITERAL_VALUE_MISMATCH
    10
    port = System.getProperty("http.proxyPort");
    7
    if (host != null)
    7
    if (host != null)
    11
    if (port != null)
    Differences
    Expression1Expression2Difference
    hostportVARIABLE_NAME_MISMATCH
    11
    if (port != null)
    8
    this.setProxyHost(host);
    8
    this.setProxyHost(host);
    12
    this.setProxyPort(port);
    Differences
    Expression1Expression2Difference
    hostportVARIABLE_NAME_MISMATCH
    setProxyHostsetProxyPortMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.setProxyHost(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.setProxyPort(port) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    Expression this.setProxyPort(port) is a void method call, and thus it cannot be parameterized
    12
    this.setProxyPort(port);
    Precondition Violations (4)
    Row Violation
    1Expression this.setProxyHost(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.setProxyPort(port) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    4Expression this.setProxyPort(port) is a void method call, and thus it cannot be parameterized