for (int i = 0; i < 3; i++) {
TestElement sampler = null;
while ((sampler = controller.next()) != null) {
assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName());
counter++;
}
assertEquals(counter, 150 * order.length);
counter = 0;
}
for (int i = 0; i < 3; i++) {
TestElement sampler = null;
while ((sampler = controller.next()) != null) {
assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName());
counter++;
}
assertEquals(counter, 150 * order.length);
counter = 0;
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestThroughputController.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestThroughputController.java
|
Method name: void testByPercentZero()
|
|
Method name: void testByPercent100()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | for (int i = 0; i < 3; i++) {↵ | | 1 | for (int i = 0; i < 3; i++) {↵
|
2 | TestElement sampler = null;↵ | | 2 | TestElement sampler = null;↵
|
3 | while ((sampler = controller.next()) != null) {↵ | | 3 | while ((sampler = controller.next()) != null) {↵
|
4 | assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName());↵ | | 4 | assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName());↵
|
5 | counter++;↵ | | 5 | counter++;↵
|
6 | }↵ | | 6 | }↵
|
7 | assertEquals(counter, 150 * order.length);↵ | | 7 | assertEquals(counter, 150 * order.length);↵
|
8 | counter = 0;↵ | | 8 | counter = 0;↵
|
9 | } | | 9 | }
|
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 declared in the same class |
Number of node comparisons | 27 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | for (int i = 0; i < 3; i++) | | 18 | for (int i = 0; i < 3; i++) |
19 | TestElement sampler = null; | | 19 | TestElement sampler = null; |
20 | while ((sampler = controller.next()) != null) | | 20 | while ((sampler = controller.next()) != null) |
21 | assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName()); | | 21 | assertEquals("Counter: " + counter + ", i: " + i, order[counter % order.length], sampler.getName()); |
22 | | | 22 | |
23 | assertEquals(counter, 150 * order.length); | | 23 | assertEquals(counter, 150 * order.length); |
24 | | | 24 | |
Precondition Violations (0)
Row |
Violation |