public void setHeaders(URL url, HttpMethod method) { CacheEntry entry = (CacheEntry) getCache().get(url.toString()); if (log.isDebugEnabled()){ log.debug(method.getName()+"(OAHC) "+url.toString()+" "+entry); } if (entry != null){ final String lastModified = entry.getLastModified(); if (lastModified != null){ method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified); } final String etag = entry.getEtag(); if (etag != null){ method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag);
public void setHeaders(HttpURLConnection conn, URL url) { CacheEntry entry = (CacheEntry) getCache().get(url.toString()); if (log.isDebugEnabled()){ log.debug(conn.getRequestMethod()+"(Java) "+url.toString()+" "+entry); } if (entry != null){ final String lastModified = entry.getLastModified(); if (lastModified != null){ conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified); } final String etag = entry.getEtag(); if (etag != null){ conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag);
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void setHeaders(URL url, HttpMethod method) {
1
public void setHeaders(HttpURLConnection conn, URL url) {
2
        CacheEntry entry = (CacheEntry) getCache().get(url.toString());
2
        CacheEntry entry = (CacheEntry) getCache().get(url.toString());
3
        if (log.isDebugEnabled()){
3
        if (log.isDebugEnabled()){
4
            log.debug(method.getName()+"(OAHC) "+url.toString()+" "+entry);
4
            log.debug(conn.getRequestMethod()+"(Java) "+url.toString()+" "+entry);
5
        }
5
        }
6
        if (entry != null){
6
        if (entry != null){
7
            final String lastModified = entry.getLastModified();
7
            final String lastModified = entry.getLastModified();
8
            if (lastModified != null){
8
            if (lastModified != null){
9
                method.setRequestHeader(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);
9
                conn.addRequestProperty(HTTPConstantsInterface.IF_MODIFIED_SINCE, lastModified);
10
            }
10
            }
11
            final String etag = entry.getEtag();
11
            final String etag = entry.getEtag();
12
            if (etag != null){
12
            if (etag != null){
13
                method.setRequestHeader(HTTPConstantsInterface.IF_NONE_MATCH, etag);
13
                conn.addRequestProperty(HTTPConstantsInterface.IF_NONE_MATCH, etag);
14
            
14
            
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0