controller.initialize();
for (int i = 0; i < 2; i++) {
assertEquals(15, counter);
counter = 0;
TestElement sampler = null;
while ((sampler = controller.next()) != null) {
assertEquals(order[counter++], sampler.getName());
}
}
controller.initialize();
for (int i = 0; i < 2; i++) {
assertEquals(7, counter);
counter = 0;
TestElement sampler = null;
while ((sampler = controller.next()) != null) {
assertEquals(order[counter++], sampler.getName());
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestLoopController.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestGenericController.java
|
Method name: void testProcessing()
|
|
Method name: void testProcessing()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | controller.initialize();↵ | | 1 | controller.initialize();↵
|
2 | for (int i = 0; i < 2; i++) {↵ | | 2 | for (int i = 0; i < 2; i++) {↵
|
3 | assertEquals(15, counter);↵ | | 3 | assertEquals(7, counter);↵
|
4 | counter = 0;↵ | | 4 | counter = 0;↵
|
5 | TestElement sampler = null;↵ | | 5 | TestElement sampler = null;↵
|
6 | while ((sampler = controller.next()) != null) {↵ | | 6 | while ((sampler = controller.next()) != null) {↵
|
7 | assertEquals(order[counter++], sampler.getName());↵ | | 7 | assertEquals(order[counter++], sampler.getName());↵
|
8 | }↵ | | 8 | }↵
|
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 in different classes having the same super class |
Number of node comparisons | 23 |
-
{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) | 23.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | controller.initialize(); | | 18 | controller.initialize(); |
23 | for (int i = 0; i < 2; i++) | | 19 | for (int i = 0; i < 2; i++) |
24 | assertEquals(15, counter); | | 20 | assertEquals(7, counter); |
25 | | | 21 | |
26 | TestElement sampler = null; | | 22 | TestElement sampler = null; |
27 | while ((sampler = controller.next()) != null) | | 23 | while ((sampler = controller.next()) != null) |
28 | assertEquals(order[counter++], sampler.getName()); | | 24 | assertEquals(order[counter++], sampler.getName()); |
Precondition Violations (0)
Row |
Violation |