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(HttpURLConnection, URL)
|
Method name: void setHeaders(URL, HttpMethod)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | CacheEntry entry = (CacheEntry) getCache().get(url.toString());↵ | 1 | CacheEntry entry = (CacheEntry) getCache().get(url.toString());↵ | |
2 | if (log.isDebugEnabled()){↵ | 2 | if (log.isDebugEnabled()){↵ | |
3 | log.debug(conn.getRequestMethod()+"(Java) "+url.toString()+" "+entry);↵ | 3 | log.debug(method.getName()+"(OAHC) "+url.toString()+" "+entry);↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (entry != null){↵ | 5 | if (entry != null){↵ | |
6 | final String lastModified = entry.getLastModified();↵ | 6 | final String lastModified = entry.getLastModified();↵ | |
7 | if (lastModified != null){↵ | 7 | if (lastModified != null){↵ | |
8 | conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);↵ | 8 | method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);↵ | |
9 | }↵ | 9 | }↵ | |
10 | final String etag = entry.getEtag();↵ | 10 | final String etag = entry.getEtag();↵ | |
11 | if (etag != null){↵ | 11 | if (etag != null){↵ | |
12 | conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag);↵ | 12 | method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag);↵ | |
13 | }↵ | 13 | }↵ | |
14 | } | 14 |
| |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 4.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | CacheEntry entry = (CacheEntry)getCache().get(url.toString()); | 1 | CacheEntry entry = (CacheEntry)getCache().get(url.toString()); | ||||
2 | if (log.isDebugEnabled()) | 2 | if (log.isDebugEnabled()) | ||||
|
| 3 | log.debug(method.getName() + "(OAHC) " + url.toString() + " " + entry); | ||||
3 | log.debug(conn.getRequestMethod() + "(Java) " + url.toString() + " " + entry); |
| | ||||
4 | if (entry != null) | 4 | if (entry != null) | ||||
5 | final String lastModified = entry.getLastModified(); | 5 | final String lastModified = entry.getLastModified(); | ||||
6 | if (lastModified != null) | 6 | if (lastModified != null) | ||||
|
| 7 | method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified); | ||||
7 | conn.addRequestProperty(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 | method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag); | ||||
10 | conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag); |
| |
Row | Violation |
---|---|
1 | Unmatched statement log.debug(method.getName() + "(OAHC) " + url.toString()+ " "+ entry); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement log.debug(conn.getRequestMethod() + "(Java) " + url.toString()+ " "+ entry); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE,lastModified); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE,lastModified); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH,etag); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH,etag); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |