if (headerManager != null) { CollectionProperty headers = headerManager.getHeaders(); if (headers != null) { PropertyIterator i = headers.iterator(); while (i.hasNext()) { org.apache.jmeter.protocol.http.control.Header header = (org.apache.jmeter.protocol.http.control.Header) i.next().getObjectValue(); String n = header.getName(); // Don't allow override of Content-Length // This helps with SoapSampler hack too // TODO - what other headers are not allowed? if (! HEADER_CONTENT_LENGTH.equalsIgnoreCase(n)){ String v = header.getValue(); method.addRequestHeader(n, v); } } } } if (cacheManager != null){ cacheManager.setHeaders(u, method); }
if (headerManager != null) { CollectionProperty headers = headerManager.getHeaders(); if (headers != null) { PropertyIterator i = headers.iterator(); while (i.hasNext()) { Header header = (Header) i.next().getObjectValue(); String n = header.getName(); String v = header.getValue(); conn.addRequestProperty(n, v); } } } if (cacheManager != null){ cacheManager.setHeaders(conn, u); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Method name: void setConnectionHeaders(HttpMethod, URL, HeaderManager, CacheManager) Method name: void setConnectionHeaders(HttpURLConnection, URL, HeaderManager, CacheManager)
Number of AST nodes: 12 Number of AST nodes: 11
1
if (headerManager != null) {
1
if (headerManager != null) {
2
			CollectionProperty headers = headerManager.getHeaders();
2
			CollectionProperty headers = headerManager.getHeaders();
3
			if (headers != null) {
3
			if (headers != null) {
4
				PropertyIterator i = headers.iterator();
4
				PropertyIterator i = headers.iterator();
5
				while (i.hasNext()) {
5
				while (i.hasNext()) {
6
					org.apache.jmeter.protocol.http.control.Header header 
6
					
7
                    = (org.apache.jmeter.protocol.http.control.Header) 
8
                       i.next().getObjectValue();
9
					String n = header.getName();
10
					// Don't allow override of Content-Length
11
					// This helps with SoapSampler hack too
12
					// TODO - what other headers are not allowed?
13
					if (! HEADER_CONTENT_LENGTH.equalsIgnoreCase(n)){
14
	
7
Header header = (Header) i.next().getObjectValue();
8
					String n = header.getName();
15
					String v = header.getValue();
9
					String v = header.getValue();
16
						method.addRequestHeader(n, v);
10
					conn.addRequestProperty(n, v);
17
					}
11
				}
18
				}
12
			}
19
			}
13
		}
20
		}
21
		if (cacheManager != null){
14
        if (cacheManager != null){
22
		    cacheManager.setHeaders(u, method);
15
            cacheManager.setHeaders(
23
		
16
conn, u);
24
}
17
        }
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 locationClones are in different classes having the same super class
Number of node comparisons1