File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java | |||
Method name: int getHeaderSize(String, URL)
|
Method name: void setConnectionAuthorization(HttpURLConnection, URL, AuthManager)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if(auth != null) {↵ | 1 | if (authManager != null) {↵ | |
2 | String authHeader = auth.getAuthHeaderForURL(url);↵ | 2 | Authorization auth = authManager.getAuthForURL(u);↵ | |
3 | if(authHeader != null) {↵ | 3 | if (auth != null) {↵ | |
4 | ++hsz;↵ | |||
5 | }↵ | |||
6 | ↵ | 4 | conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader());↵ | |
5 | }↵ | |||
7 | } | 6 | } | |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 8 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | if (auth != null) |
| 1 | if (authManager != null) | ||||||||||||||
|
| 2 | Authorization auth = authManager.getAuthForURL(u); | |||||||||||||||
15 | String authHeader = auth.getAuthHeaderForURL(url); |
| | |||||||||||||||
16 | if (authHeader != null) |
| 3 | if (auth != null) | ||||||||||||||
|
| 4 | conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader()); | |||||||||||||||
17 | ++hsz; | |
Row | Violation |
---|---|
1 | Unmatched statement Authorization auth=authManager.getAuthForURL(u); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement String authHeader=auth.getAuthHeaderForURL(url); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Type java.lang.String of variable authHeader does not match with type org.apache.jmeter.protocol.http.control.Authorization of variable auth |
4 | Unmatched statement conn.setRequestProperty(HEADER_AUTHORIZATION,auth.toBasicHeader()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |