if ( connection != null ) {
if ( transacted && wasAutoCommit ) {
try {
connection.setAutoCommit( true );
}
catch( Throwable ignore ) {
log.trace( "was unable to reset connection back to auto-commit" );
}
}
session.getBatcher().closeConnection( connection );
}
try {
if ( statement != null ) {
statement.close();
}
if ( connection != null ) {
connectionHelper.release();
}
}
catch ( Exception e ) {
exceptions.add( e );
log.error( "Could not close connection", e );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/transaction/Isolater.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java
|
Method name: void delegateWork(IsolatedWork, boolean)
|
|
Method name: void execute(boolean, boolean, boolean, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( connection != null ) {↵ | | |
|
2 | if ( transacted && wasAutoCommit ) {↵ | | |
|
3 | try↵ | | 1 | try {↵
|
| | | 2 | if ( statement != null ) {↵
|
| | | 3 | statement.close();↵
|
| | | 4 | }↵
|
4 | {↵ | | 5 | if ( connection != null ) {↵
|
5 | connection.setAutoCommit( true );↵ | | 6 | connectionHelper.release();↵
|
6 | }↵ | | 7 | }↵
|
7 | ↵ | | 8 | }↵
|
8 | catch( Throwable ignore ) {↵ | | 9 | catch ( ↵
|
9 | log.trace( "was unable to reset connection back to auto-commit" );↵ | | |
|
10 | }↵ | | |
|
11 | }↵ | | |
|
12 | session.getBatcher().closeConnection(↵ | | 10 | Exception e ) {↵
|
| | | 11 | exceptions.add( e );↵
|
13 | connection );↵ | | 12 | log.error( "Could not close connection", e );↵
|
14 | } | | 13 | }
|
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 0 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 0 |
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.0 |
Clone type | Unknown type |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
Precondition Violations (0)
Row |
Violation |