String fullUrl = url.toString();
String urlWithoutQuery = fullUrl;
String query = url.getQuery();
if(query != null) {
// Get rid of the query and the ?
urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1);
}
return urlWithoutQuery;
String fullUrl = _url.toString();
String urlWithoutQuery = fullUrl;
String query = _url.getQuery();
if(query != null) {
// Get rid of the query and the ?
urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1);
}
return urlWithoutQuery;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/Proxy.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
|
Method name: String getUrlWithoutQuery(URL)
|
|
Method name: String getUrlWithoutQuery(URL)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | String fullUrl = url.toString();↵ | | 1 | String fullUrl = _url.toString();↵
|
2 | String urlWithoutQuery = fullUrl;↵ | | 2 | String urlWithoutQuery = fullUrl;↵
|
3 | String query = url.getQuery();↵ | | 3 | String query = _url.getQuery();↵
|
4 | if(query != null) {↵ | | 4 | if(query != null) {↵
|
5 | // Get rid of the query and the ?↵ | | 5 | // Get rid of the query and the ?↵
|
6 | urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1);↵ | | 6 | urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1);↵
|
7 | }↵ | | 7 | }↵
|
8 | return urlWithoutQuery; | | 8 | return urlWithoutQuery;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 2.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | String fullUrl = url.toString(); | | 1 | String fullUrl = _url.toString(); |
2 | String urlWithoutQuery = fullUrl; | | 2 | String urlWithoutQuery = fullUrl; |
3 | String query = url.getQuery(); | | 3 | String query = _url.getQuery(); |
4 | if (query != null) | | 4 | if (query != null) |
5 | urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1); | | 5 | urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1); |
6 | return urlWithoutQuery; | | 6 | return urlWithoutQuery; |
Precondition Violations (0)
Row |
Violation |