if ( connection != null ) {
JDBCExceptionReporter.logAndClearWarnings( connection );
if ( toggleAutoCommit ) {
connection.setAutoCommit( false );
}
provider.closeConnection( connection );
connection = null;
}
JDBCExceptionReporter.logAndClearWarnings( connection );
if ( toggleAutoCommit ) {
connection.setAutoCommit( false );
}
connection = null;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SuppliedConnectionProviderConnectionHelper.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SuppliedConnectionHelper.java
|
Method name: void release()
|
|
Method name: void release()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 4
|
|
1 | if ( connection != null ) {↵ | | |
|
2 | JDBCExceptionReporter.logAndClearWarnings( connection );↵ | | 1 | JDBCExceptionReporter.logAndClearWarnings( connection );↵
|
3 | if ( toggleAutoCommit ) {↵ | | 2 | if ( toggleAutoCommit ) {↵
|
4 | connection.setAutoCommit( false );↵ | | 3 | connection.setAutoCommit( false );↵
|
5 | }↵ | | 4 | }↵
|
6 | provider.closeConnection( connection );↵ | | 5 | ↵
|
7 | connection = null;↵ | | 6 | connection = null;
|
8 | } | | | |
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | JDBCExceptionReporter.logAndClearWarnings(connection); | | 1 | JDBCExceptionReporter.logAndClearWarnings(connection); |
3 | if (toggleAutoCommit) | | 2 | if (toggleAutoCommit) |
4 | connection.setAutoCommit(false); | | 3 | connection.setAutoCommit(false); |
5 | provider.closeConnection(connection); | | | |
6 | connection = null; | | 4 | connection = null; |
Precondition Violations (0)
Row |
Violation |