if (batchSendTime < now) {
try {
if (log.isDebugEnabled()) {
log.debug("Firing time");
}
sendBatch();
this.batchSendTime = now + timeThreshold;
} catch (RemoteException err) {
log.warn("sampleOccurred", err);
}
}
if (sampleCount >= numSamplesThreshold) {
try {
if (log.isDebugEnabled()) {
log.debug("Firing sample");
}
sendBatch();
} 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/StatisticalSampleSender.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: 6
|
|
Number of AST nodes: 5
|
|
1 | if (batchSendTime < now) {↵ | | 1 | if (sampleCount >= numSamplesThreshold) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | if (log.isDebugEnabled()) {↵ | | 3 | if (log.isDebugEnabled()) {↵
|
4 | log.debug("Firing time");↵ | | 4 | log.debug("Firing sample");↵
|
5 | }↵ | | 5 | }↵
|
6 | sendBatch();↵ | | 6 | sendBatch();↵
|
7 | this.batchSendTime = now + timeThreshold;↵ | | 7 | ↵
|
8 | } catch (RemoteException err) {↵ | | 8 | } catch (RemoteException err) {↵
|
9 | log.warn("sampleOccurred", err);↵ | | 9 | log.warn("sampleOccurred", err);↵
|
10 | }↵ | | 10 | }↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 11 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 60.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
21 | try | | 12 | try |
22 | if (log.isDebugEnabled()) | | 13 | if (log.isDebugEnabled()) |
23 | log.debug("Firing time"); | | 14 | log.debug("Firing sample"); |
24 | | | 15 | |
25 | this.batchSendTime = now + timeThreshold; | | | |
Precondition Violations (0)
Row |
Violation |