File path: /columba-1.4-src/core/src/test/java/org/columba/core/util/StopWatchTest.java | File path: /columba-1.4-src/core/src/test/java/org/columba/core/util/StopWatchTest.java | |||
Method name: void testStop()
|
Method name: void testStart()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | watch2.stop();↵ | 1 | watch2.start();↵ | |
2 | Thread.sleep(50);↵ | 2 | Thread.sleep(50);↵ | |
3 | long difference = watch.getTiming() - watch2.getTiming();↵ | 3 | long difference = watch.getTiming() - watch2.getTiming();↵ | |
4 | if (Math.abs(difference) < 40) {↵ | 4 | if (Math.abs(difference) < 40) {↵ | |
5 | fail("Stopwatch wasnt stopped.");↵ | 5 | fail("Stopwatch wasnt restarted correctly.");↵ | |
6 | } | 6 |
| |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | watch2.stop(); |
| | |||||||||||
|
| 5 | watch2.start(); | |||||||||||
4 | Thread.sleep(50); | 6 | Thread.sleep(50); | |||||||||||
5 | long difference = watch.getTiming() - watch2.getTiming(); | 7 | long difference = watch.getTiming() - watch2.getTiming(); | |||||||||||
6 | if (Math.abs(difference) < 40) | 8 | if (Math.abs(difference) < 40) | |||||||||||
7 | fail("Stopwatch wasnt stopped."); |
| 9 | fail("Stopwatch wasnt restarted correctly."); |
Row | Violation |
---|---|
1 | Unmatched statement watch2.stop(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement watch2.start(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |