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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 8.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (host == null || host.length() == 0) | | 9 | if (port == null || port.length() == 0) |
6 | host = System.getProperty("http.proxyHost"); | | 10 | port = System.getProperty("http.proxyPort"); |
7 | | | 11 | |
8 | | | 12 | |
Precondition Violations (4)
Row |
Violation |
1 | Expression this.setProxyHost(host) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.setProxyPort(port) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized |
4 | Expression this.setProxyPort(port) is a void method call, and thus it cannot be parameterized |