toCheck = response.getSamplerData(); // TODO - is this where the URL is stored?
if (toCheck == null) {
toCheck = "";
}
if (remoteStart != null) {
remote_hosts_string = remoteStart.getArgument();
if (remote_hosts_string == null) {
remote_hosts_string = JMeterUtils.getPropDefault(
"remote_hosts", //$NON-NLS-1$
"127.0.0.1");//$NON-NLS-1$
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/ResponseAssertion.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/JMeter.java
|
Method name: AssertionResult evaluateResponse(SampleResult)
|
|
Method name: void startNonGui(String, String, CLOption)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | toCheck = response.getSamplerData(); // TODO - is this where the URL is stored?↵ | | |
|
2 | if (toCheck == null) {↵ | | |
|
3 | toCheck = "";↵ | | 1 | if (remoteStart != null) {↵
|
| | | 2 | remote_hosts_string = remoteStart.getArgument();↵
|
| | | 3 | if (remote_hosts_string == null) {↵
|
| | | 4 | remote_hosts_string = JMeterUtils.getPropDefault(↵
|
| | | 5 | "remote_hosts", //$NON-NLS-1$ ↵
|
| | | 6 | "127.0.0.1");//$NON-NLS-1$ ↵
|
4 | } | | 7 | }↵
|
| | | 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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 18.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 9 | remote_hosts_string = remoteStart.getArgument(); |
15 | toCheck = response.getSamplerData(); | | | |
16 | if (toCheck == null) | | 10 | if (remote_hosts_string == null) |
17 | | | 11 | remote_hosts_string = JMeterUtils.getPropDefault("remote_hosts", "127.0.0.1"); |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.apache.jmeter.assertions.ResponseAssertion and org.apache.jmeter.JMeter do not have a common superclass |