isTransactional = true;
Connection connection = currentTransaction.getEnlistedConnection();
if ( connection == null ) {
connection = actualConnectionProvider.getConnection();
currentTransaction.enlistConnection( connection );
}
return connection;
isTransactional = true;
Connection connection = currentTransaction.getEnlistedConnection();
if ( connection == null ) {
connection = actualConnectionProvider.getConnection();
currentTransaction.enlistConnection( connection );
}
return connection;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/test/tm/ConnectionProviderImpl.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/util/DualNodeConnectionProviderImpl.java
|
Method name: Connection getConnection()
|
|
Method name: Connection getConnection()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | isTransactional = true;↵ | | 1 | isTransactional = true;↵
|
2 | Connection connection = currentTransaction.getEnlistedConnection();↵ | | 2 | Connection connection = currentTransaction.getEnlistedConnection();↵
|
3 | if ( connection == null ) {↵ | | 3 | if ( connection == null ) {↵
|
4 | connection = actualConnectionProvider.getConnection();↵ | | 4 | connection = actualConnectionProvider.getConnection();↵
|
5 | currentTransaction.enlistConnection( connection );↵ | | 5 | currentTransaction.enlistConnection( connection );↵
|
6 | }↵ | | 6 | }↵
|
7 | return connection; | | 7 | return connection;
|
See real code fragment |
|
See real code fragment |
Summary
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 | 15 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
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; |
Precondition Violations (2)
Row |
Violation |
1 | Type org.hibernate.test.tm.SimpleJtaTransactionImpl of variable currentTransaction does not match with type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl of variable currentTransaction |
2 | Type org.hibernate.test.tm.SimpleJtaTransactionImpl of variable currentTransaction does not match with type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl of variable currentTransaction |