if (timeThreshold != -1) { SampleResult sr = e.getResult(); long timestamp = sr.getTimeStamp(); // Checking for and creating initial timestamp to cheak against if (batchSendTime == -1) { this.batchSendTime = timestamp + timeThreshold; } if (batchSendTime < timestamp) { try { log.debug("Firing time"); if (sampleStore.size() > 0) { listener.processBatch(sampleStore); sampleStore.clear(); } this.batchSendTime = timestamp + timeThreshold; } catch (RemoteException err) { log.error("sampleOccurred", err); } } }
if (timeThreshold != -1) { long now = System.currentTimeMillis(); // Checking for and creating initial timestamp to cheak against if (batchSendTime == -1) { this.batchSendTime = now + timeThreshold; } if (batchSendTime < now) { try { if (log.isDebugEnabled()) { log.debug("Firing time"); } sendBatch(); this.batchSendTime = now + timeThreshold; } catch (RemoteException err) { log.warn("sampleOccurred", err); } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/BatchSampleSender.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/StatisticalSampleSender.java
Method name: void SampleOccurred(SampleEvent) Method name: void SampleOccurred(SampleEvent)
Number of AST nodes: 12 Number of AST nodes: 10
1
if (timeThreshold != -1) {
1
if (timeThreshold != -1) {
2
				SampleResult sr = e.getResult();
2
				
3
				long timestamp = sr.getTimeStamp();
3
long now = System.currentTimeMillis();
4
				// Checking for and creating initial timestamp to cheak against
4
				// Checking for and creating initial timestamp to cheak against
5
				if (batchSendTime == -1) {
5
				if (batchSendTime == -1) {
6
					this.batchSendTime = timestamp + timeThreshold;
6
					this.batchSendTime = now + timeThreshold;
7
				}
7
				}
8
				if (batchSendTime < timestamp) {
8
				if (batchSendTime < now) {
9
					try {
9
					try {
10
						
10
						if (log.isDebugEnabled()) {
11
log.debug("Firing time");
11
							log.debug("Firing time");
12
						if (sampleStore.size() > 0) {
12
						
13
							listener.processBatch(sampleStore);
14
							sampleStore.clear();
15
						}
13
}
14
						sendBatch();
16
						this.batchSendTime = timestamp + timeThreshold;
15
						this.batchSendTime = now + timeThreshold;
17
					} catch (RemoteException err) {
16
					} catch (RemoteException err) {
18
						log.error("sampleOccurred", err);
17
						log.warn("sampleOccurred", err);
19
					}
18
					}
20
				}
19
				}
21
			}
20
			}
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.1
Clones locationClones are in different classes
Number of node comparisons1