File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/CacheManager.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/CacheManager.java | |||
Method name: void setHeaders(URL, HttpMethod)
|
Method name: void setHeaders(HttpURLConnection, URL)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | final String lastModified = entry.getLastModified();↵ | 1 | final String lastModified = entry.getLastModified();↵ | |
2 | if (lastModified != null){↵ | 2 | if (lastModified != null){↵ | |
3 | method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);↵ | 3 | conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);↵ | |
4 | }↵ | 4 | }↵ | |
5 | final String etag = entry.getEtag();↵ | 5 | final String etag = entry.getEtag();↵ | |
6 | if (etag != null){↵ | 6 | if (etag != null){↵ | |
7 | method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag);↵ | 7 | conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag);↵ | |
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 declared in the same class |
Number of node comparisons | 18 |
Number of mapped statements | 4 |
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) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
5 | final String lastModified = entry.getLastModified(); | 5 | final String lastModified = entry.getLastModified(); | ||||
6 | if (lastModified != null) | 6 | if (lastModified != null) | ||||
|
| 7 | conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified); | ||||
7 | method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified); |
| | ||||
8 | final String etag = entry.getEtag(); | 8 | final String etag = entry.getEtag(); | ||||
9 | if (etag != null) | 9 | if (etag != null) | ||||
|
| 10 | conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag); | ||||
10 | method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag); |
| |
Row | Violation |
---|---|
1 | Unmatched statement conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE,lastModified); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE,lastModified); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH,etag); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH,etag); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Clone fragment #1 returns variables lastModified, etag , while Clone fragment #2 returns variables lastModified, etag |