if (stacktree.peek() instanceof Connector) { stacktree.push(threadinfo); connector.setThreadInfo(threadinfo); if (attributes != null) { for (int idx = 0; idx < attributes.getLength(); idx++) { String attr = attributes.getQName(idx); if (attr.equals(Constants.MAXTHREADS)) { threadinfo.setMaxThreads(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.MINSPARETHREADS)) { threadinfo.setMinSpareThreads(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.MAXSPARETHREADS)) { threadinfo.setMaxSpareThreads(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.CURRENTTHREADCOUNT)) { threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.CURRENTBUSYTHREADS)) { threadinfo.setCurrentThreadsBusy(parseInt(attributes.getValue(idx))); } } } }
if (attributes != null) { for (int idx = 0; idx < attributes.getLength(); idx++) { String attr = attributes.getQName(idx); if (attr.equals(Constants.MAXTIME)) { requestinfo.setMaxTime(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.PROCESSINGTIME)) { requestinfo.setProcessingTime(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.REQUESTCOUNT)) { requestinfo.setRequestCount(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.ERRORCOUNT)) { requestinfo.setErrorCount(parseInt(attributes.getValue(idx))); } else if (attr.equals(Constants.BYTESRECEIVED)) { requestinfo.setBytesReceived(parseLong(attributes.getValue(idx))); } else if (attr.equals(Constants.BYTESSENT)) { requestinfo.setBytesSent(parseLong(attributes.getValue(idx))); } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/monitor/parser/MonitorHandler.java
Method name: void startElement(String, String, String, Attributes) Method name: void startElement(String, String, String, Attributes)
Number of AST nodes: 16 Number of AST nodes: 15
1
if (stacktree.peek() instanceof Connector) {
2
				stacktree.push(threadinfo);
3
				connector.setThreadInfo(threadinfo);
4
				if (attributes != null) {
1
if (attributes != null) {
5
					for (int idx = 0; idx < attributes.getLength(); idx++) {
2
					for (int idx = 0; idx < attributes.getLength(); idx++) {
6
						String attr = attributes.getQName(idx);
3
						String attr = attributes.getQName(idx);
7
						if (attr.equals(Constants.MAXTHREADS)) {
4
						if (attr.equals(Constants.MAXTIME)) {
8
							threadinfo.setMaxThreads(parseInt(attributes.getValue(idx)));
5
							requestinfo.setMaxTime(parseInt(attributes.getValue(idx)));
9
						} else if (attr.equals(Constants.MINSPARETHREADS)) {
6
						} else if (attr.equals(Constants.PROCESSINGTIME)) {
10
							threadinfo.setMinSpareThreads(parseInt(attributes.getValue(idx)));
7
							requestinfo.setProcessingTime(parseInt(attributes.getValue(idx)));
11
						} else if (attr.equals(Constants.MAXSPARETHREADS)) {
8
						} else if (attr.equals(Constants.REQUESTCOUNT)) {
12
							threadinfo.setMaxSpareThreads(parseInt(attributes.getValue(idx)));
9
							requestinfo.setRequestCount(parseInt(attributes.getValue(idx)));
13
						} else if (attr.equals(Constants.CURRENTTHREADCOUNT)) {
10
						} else if (attr.equals(Constants.ERRORCOUNT)) {
14
							threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx)));
11
							requestinfo.setErrorCount(parseInt(attributes.getValue(idx)));
15
						} else if (attr.equals(Constants.CURRENTBUSYTHREADS)) {
12
						} else if (attr.equals(Constants.BYTESRECEIVED)) {
16
							threadinfo.setCurrentThreadsBusy
13
							requestinfo.setBytesReceived(parseLong(attributes.getValue(idx)));
14
						} else if (attr.equals(Constants.BYTESSENT)) {
17
(parseInt(attributes.getValue(idx)));
15
							requestinfo.setBytesSent(parseLong(attributes.getValue(idx)));
18
						}
16
						}
19
					}
17
					}
20
				}
18
				}
21
			}
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)2.4
Clones locationClones are in the same method
Number of node comparisons30