File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ModuleController.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java | |||
Method name: void setNodePath()
|
Method name: void saveConnectionCookies(HttpMethod, URL, CookieManager)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if (selectedNode != null) {↵ | 1 | if (↵ | |
2 | TreeNode[] path = selectedN↵ | 2 | cookieManager != null) {↵ | |
3 | ode.getPath();↵ | 3 | Header hdr[] = method.getResponseHeaders(HEADER_SET_COOKIE); ↵ | |
4 | for (int i = 0; i < path.length; i++) {↵ | 4 | for (int i = 0; i < hdr.length; i++) {↵ | |
5 | nodePath.add(((JMeterTreeNode) path[i]).getName());↵ | 5 | cookieManager.addCookieFromHeader(hdr[i].getValue(),u);↵ | |
6 | }↵ | 6 | }↵ | |
7 | // nodePath.add(selectedNode.getName());↵ | 7 | ↵ | |
8 | } | 8 |
| |
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.3 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (selectedNode != null) |
| 1 | if (cookieManager != null) | ||||||||||||||
| 2 | Header hdr[] = method.getResponseHeaders(HEADER_SET_COOKIE); | ||||||||||||||||
3 | TreeNode[] path = selectedNode.getPath(); | | ||||||||||||||||
4 | for (int i = 0; i < path.length; i++) |
| 3 | for (int i = 0; i < hdr.length; i++) | ||||||||||||||
|
| 4 | cookieManager.addCookieFromHeader(hdr[i].getValue(), u); | |||||||||||||||
5 | nodePath.add(((JMeterTreeNode)path[i]).getName()); |
| |
Row | Violation |
---|---|
1 | Type org.apache.jmeter.gui.tree.JMeterTreeNode of variable selectedNode does not match with type org.apache.jmeter.protocol.http.control.CookieManager of variable cookieManager |
2 | Type javax.swing.tree.TreeNode[] of variable path does not match with type org.apache.commons.httpclient.Header[] of variable hdr |
3 | Unmatched statement cookieManager.addCookieFromHeader(hdr[i].getValue(),u); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement nodePath.add(((JMeterTreeNode)path[i]).getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |