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: 10 | Number of AST nodes: 10 | |||
1 | DualNodeJtaTransactionImpl currentTransaction = DualNodeJtaTransactionManagerImpl.getInstance(nodeId).getCurrentTransaction();↵ | 1 | SimpleJtaTransactionImpl currentTransaction = SimpleJtaTransactionManagerImpl.getInstance().getCurrentTransaction();↵ | |
2 | if ( currentTransaction == null ) {↵ | 2 | if ( currentTransaction == null ) {↵ | |
3 | isTransactional = false;↵ | 3 | isTransactional = false;↵ | |
4 | return actualConnectionProvider.getConnection();↵ | 4 | return actualConnectionProvider.getConnection();↵ | |
5 | }↵ | 5 | }↵ | |
6 | else {↵ | 6 | else {↵ | |
7 | isTransactional = true;↵ | 7 | isTransactional = true;↵ | |
8 | Connection connection = currentTransaction.getEnlistedConnection();↵ | 8 | Connection connection = currentTransaction.getEnlistedConnection();↵ | |
9 | if ( connection == null ) {↵ | 9 | if ( connection == null ) {↵ | |
10 | connection = actualConnectionProvider.getConnection();↵ | 10 | connection = actualConnectionProvider.getConnection();↵ | |
11 | currentTransaction.enlistConnection( connection );↵ | 11 | currentTransaction.enlistConnection( connection );↵ | |
12 | }↵ | 12 | }↵ | |
13 | return connection;↵ | 13 | return connection;↵ | |
14 | } | 14 |
| |
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 | 46 |
Number of mapped statements | 9 |
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.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SimpleJtaTransactionImpl currentTransaction = SimpleJtaTransactionManagerImpl.getInstance().getCurrentTransaction(); | |||||||||||||
1 | DualNodeJtaTransactionImpl currentTransaction = DualNodeJtaTransactionManagerImpl.getInstance(nodeId).getCurrentTransaction(); | | |||||||||||||
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 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl of variable currentTransaction does not match with type org.hibernate.test.tm.SimpleJtaTransactionImpl of variable currentTransaction |
2 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl of variable currentTransaction does not match with type org.hibernate.test.tm.SimpleJtaTransactionImpl of variable currentTransaction |
3 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl of variable currentTransaction does not match with type org.hibernate.test.tm.SimpleJtaTransactionImpl of variable currentTransaction |