requestinfo = factory.createRequestInfo(); if (stacktree.peek() instanceof Connector) { stacktree.push(requestinfo); connector.setRequestInfo(requestinfo); 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))); } } } }
threadinfo = factory.createThreadInfo(); 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))); } } } }
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: 19 Number of AST nodes: 17
1
requestinfo = factory.createRequestInfo();
1
threadinfo = factory.createThreadInfo();
2
			if (stacktree.peek() instanceof Connector) {
2
			if (stacktree.peek() instanceof Connector) {
3
				stacktree.push(requestinfo);
3
				stacktree.push(threadinfo);
4
				connector.setRequestInfo(requestinfo);
4
				connector.setThreadInfo(threadinfo);
5
				if (attributes != null) {
5
				if (attributes != null) {
6
					for (int idx = 0; idx < attributes.getLength(); idx++) {
6
					for (int idx = 0; idx < attributes.getLength(); idx++) {
7
						String attr = attributes.getQName(idx);
7
						String attr = attributes.getQName(idx);
8
						if (attr.equals(Constants.MAXTIME)) {
8
						if (attr.equals(Constants.MAXTHREADS)) {
9
							requestinfo.setMaxTime(parseInt(attributes.getValue(idx)));
9
							threadinfo.setMaxThreads(parseInt(attributes.getValue(idx)));
10
						} else if (attr.equals(Constants.PROCESSINGTIME)) {
10
						} else if (attr.equals(Constants.MINSPARETHREADS)) {
11
							requestinfo.setProcessingTime(parseInt(attributes.getValue(idx)));
11
							threadinfo.setMinSpareThreads(parseInt(attributes.getValue(idx)));
12
						} else if (attr.equals(Constants.REQUESTCOUNT)) {
12
						} else if (attr.equals(Constants.MAXSPARETHREADS)) {
13
							requestinfo.setRequestCount(parseInt(attributes.getValue(idx)));
13
							threadinfo.setMaxSpareThreads(parseInt(attributes.getValue(idx)));
14
						} else if (attr.equals(Constants.ERRORCOUNT)) {
14
						} else if (attr.equals(Constants.CURRENTTHREADCOUNT)) {
15
							requestinfo.setErrorCount(parseInt(attributes.getValue(idx)));
15
							threadinfo.setCurrentThreadCount(parseInt(attributes.getValue(idx)));
16
						} else if (attr.equals(Constants.BYTESRECEIVED)) {
16
						} else if (attr.equals(Constants.CURRENTBUSYTHREADS)) {
17
							requestinfo.setBytesReceived(parseLong(attributes.getValue(idx)));
17
							threadinfo.set
18
						} else if (attr.equals(Constants.BYTESSENT)) {
19
							requestinfo.setBytesSent(parseLong(attributes.getValue(idx)));
18
CurrentThreadsBusy(parseInt(attributes.getValue(idx)));
20
						}
19
						}
21
					}
20
					}
22
				}
21
				}
23
			}
22
			}
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)3.1
Clones locationClones are in the same method
Number of node comparisons30