if (wait > 0) {
try {
Thread.sleep(wait);
} catch (InterruptedException e1) {
// ignore
}
}
samples++;
return null;
if (initialDelay > 0) {
try {
Thread.sleep(initialDelay);
} catch (InterruptedException e) {
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/stubs/TestSampler.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/JMeterThread.java
|
Method name: SampleResult sample(Entry)
|
|
Method name: void rampUpDelay()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 3
|
|
1 | if (wait > 0) {↵ | | 1 | if (initialDelay > 0) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | Thread.sleep(wait);↵ | | 3 | Thread.sleep(initialDelay);↵
|
4 | } catch (InterruptedException e1) {↵ | | 4 | } catch (InterruptedException e) {↵
|
5 | // ignore↵ | | 5 | ↵
|
6 | }↵ | | |
|
7 | }↵ | | |
|
8 | samples++;↵ | | |
|
9 | return null; | | 6 | }↵
|
| | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (wait > 0) | | 1 | if (initialDelay > 0) |
2 | | | 2 | |
3 | | | 3 | Thread.sleep(initialDelay); |
4 | samples++; | | | |
5 | return null; | | | |
Precondition Violations (4)
Row |
Violation |
1 | Type long of variable wait does not match with type int of variable initialDelay |
2 | Type long of variable wait does not match with type int of variable initialDelay |
3 | Unmatched statement samples++; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return null; |