File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/util/DualNodeConnectionProviderImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/test/tm/ConnectionProviderImpl.java | |||
Method name: Connection getConnection()
|
Method name: Connection getConnection()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if ( currentTransaction == null ) {↵ | 1 | if ( currentTransaction == null ) {↵ | |
2 | isTransactional = false;↵ | 2 | isTransactional = false;↵ | |
3 | return actualConnectionProvider.getConnection();↵ | 3 | return actualConnectionProvider.getConnection();↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | isTransactional = true;↵ | 6 | isTransactional = true;↵ | |
7 | Connection connection = currentTransaction.getEnlistedConnection();↵ | 7 | Connection connection = currentTransaction.getEnlistedConnection();↵ | |
8 | if ( connection == null ) {↵ | 8 | if ( connection == null ) {↵ | |
9 | connection = actualConnectionProvider.getConnection();↵ | 9 | connection = actualConnectionProvider.getConnection();↵ | |
10 | currentTransaction.enlistConnection( connection );↵ | 10 | currentTransaction.enlistConnection( connection );↵ | |
11 | }↵ | 11 | }↵ | |
12 | return connection;↵ | 12 | return connection;↵ | |
13 | } | 13 |
| |
See real code fragment | See real code fragment |
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 in different classes |
Number of node comparisons | 45 |
Number of mapped statements | 9 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (currentTransaction == null) |
| 2 | if (currentTransaction == null) | |||||||||||
3 | isTransactional = false; | 3 | isTransactional = false; | ||||||||||||
4 | return actualConnectionProvider.getConnection(); | 4 | return actualConnectionProvider.getConnection(); | ||||||||||||
else | else | ||||||||||||||
5 | isTransactional = true; | 5 | isTransactional = true; | ||||||||||||
6 | Connection connection = currentTransaction.getEnlistedConnection(); |
| 6 | Connection connection = currentTransaction.getEnlistedConnection(); | |||||||||||
7 | if (connection == null) | 7 | if (connection == null) | ||||||||||||
8 | connection = actualConnectionProvider.getConnection(); | 8 | connection = actualConnectionProvider.getConnection(); | ||||||||||||
9 | currentTransaction.enlistConnection(connection); |
| 9 | currentTransaction.enlistConnection(connection); | |||||||||||
10 | return connection; | 10 | return connection; |
Row | Violation |
---|---|
1 | Expression currentTransaction cannot be unified with expression currentTransaction , because common superclass javax.transaction.Transaction does not declare member(s) public java.sql.Connection getEnlistedConnection() |
2 | Expression currentTransaction cannot be unified with expression currentTransaction , because common superclass javax.transaction.Transaction does not declare member(s) public void enlistConnection(java.sql.Connection) |
3 | Not all possible execution flows end in a return statement |