long delay = (startTime - System.currentTimeMillis());
if (delay > 0) {
try {
Thread.sleep(delay);
} catch (Exception e) {
}
}
if (initialDelay > 0) {
try {
Thread.sleep(initialDelay);
} catch (InterruptedException e) {
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/JMeterThread.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/JMeterThread.java
|
Method name: void startScheduler()
|
|
Method name: void rampUpDelay()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 3
|
|
1 | long delay = (startTime - System.currentTimeMillis());↵ | | |
|
2 | if (delay > 0) {↵ | | 1 | if (initialDelay > 0) {↵
|
3 | try {↵ | | 2 | try {↵
|
4 | Thread.sleep(delay);↵ | | 3 | Thread.sleep(initialDelay);↵
|
5 | } catch (Exception e) {↵ | | 4 | } catch (InterruptedException e) {↵
|
6 | }↵ | | 5 | }↵
|
7 | } | | 6 | }
|
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 declared in the same class |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | long delay = (startTime - System.currentTimeMillis()); | | | |
2 | if (delay > 0) | | 1 | if (initialDelay > 0) |
3 | | | 2 | |
4 | | | 3 | Thread.sleep(initialDelay); |
Precondition Violations (2)
Row |
Violation |
1 | Type long of variable delay does not match with type int of variable initialDelay |
2 | Type long of variable delay does not match with type int of variable initialDelay |