File path: /sql12/test/adhoc/test/DBMetaDataConcurrencyTester.java | File path: /sql12/test/adhoc/test/DBMetaDataConcurrencyTester.java | |||
Method name: void run()
|
Method name: void run()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 8 | |||
1 | int count = 0;↵ | 1 | int count = 0;↵ | |
2 | while (getProductVersion && count++ < iterations) {↵ | 2 | while (getJDBCVersion && count++ < iterations) {↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | System.out.println("Thread "+Thread.currentThread().getName());↵ | 4 | System.out.println("Thread "+Thread.currentThread().getName());↵ | |
5 | md.getDatabaseProduct↵ | 5 | md.getJDBCMajorVersion();↵ | |
6 | Version();↵ | 6 | md.getJDBCMinorVersion();↵ | |
7 | if (sleepTime > 0) {↵ | 7 | if (sleepTime > 0) {↵ | |
8 | Thread.sleep(sleepTime);↵ | 8 | Thread.sleep(sleepTime);↵ | |
9 | }↵ | 9 | }↵ | |
10 | } catch (Exception e) {↵ | 10 | } catch (Exception e) {↵ | |
11 | handleException(e);↵ | 11 | handleException(e);↵ | |
12 | } ↵ | 12 | } ↵ | |
13 | } | 13 |
| |
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.3 |
Clones location | Clones are in the same java file |
Number of node comparisons | 18 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int count = 0; | 1 | int count = 0; | |||||||||||
2 | while (getProductVersion && count++ < iterations) |
| 2 | while (getJDBCVersion && count++ < iterations) | ||||||||||
3 | try | 3 | try | |||||||||||
4 | System.out.println("Thread " + Thread.currentThread().getName()); | 4 | System.out.println("Thread " + Thread.currentThread().getName()); | |||||||||||
|
| 5 | md.getJDBCMajorVersion(); | |||||||||||
5 | md.getDatabaseProductVersion(); |
| | |||||||||||
|
| 6 | md.getJDBCMinorVersion(); | |||||||||||
6 | if (sleepTime > 0) | 7 | if (sleepTime > 0) | |||||||||||
7 | Thread.sleep(sleepTime); | 8 | Thread.sleep(sleepTime); |
Row | Violation |
---|---|
1 | Unmatched statement md.getJDBCMajorVersion(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement md.getDatabaseProductVersion(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement md.getJDBCMinorVersion(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |