File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/ConnectionManager.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/JDBCContext.java | |||
Method name: void closeConnection()
|
Method name: void afterNontransactionalQuery(boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( !connection.isClosed() ) {↵ | |||
2 | JDBCExceptionReporter.logAndClearWarnings( conne↵ | 1 | boolean isAutocommit = connectionManager.isAutoCommit();↵ | |
3 | ction );↵ | 2 | connectionManager.afterTransaction();↵ | |
4 | }↵ | 3 | ↵ | |
5 | factory.getConnectionProvider().closeConnection( connection );↵ | 4 | ↵ | |
6 | connection = null; | 5 | if ( isAutocommit ) {↵ | |
6 | owner.afterTransactionCompletion(success, null);↵ | |||
7 |
| |||
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) | 5.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 14.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 | boolean isAutocommit = connectionManager.isAutoCommit(); | |||||||||||||
|
| 4 | connectionManager.afterTransaction(); | ||||||||||||
4 | if (!connection.isClosed()) |
| 5 | if (isAutocommit) | |||||||||||
5 | JDBCExceptionReporter.logAndClearWarnings(connection); |
| | ||||||||||||
| 6 | owner.afterTransactionCompletion(success, null); | |||||||||||||
6 | factory.getConnectionProvider().closeConnection(connection); | | |||||||||||||
7 | connection = null; |
| |
Row | Violation |
---|---|
1 | Unmatched statement connectionManager.afterTransaction(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Expression isAutocommit cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement JDBCExceptionReporter.logAndClearWarnings(connection); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement connection=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |