File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/util/DualNodeJtaTransactionImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/test/tm/SimpleJtaTransactionImpl.java | |||
Method name: void commit()
|
Method name: void commit()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | status = Status.STATUS_PREPARING;↵ | 1 | status = Status.STATUS_PREPARING;↵ | |
2 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | 2 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | |
3 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | 3 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | |
4 | s.beforeCompletion();↵ | 4 | s.beforeCompletion();↵ | |
5 | }↵ | 5 | }↵ | |
6 | status = Status.STATUS_COMMITTING;↵ | 6 | status = Status.STATUS_COMMITTING;↵ | |
7 | if ( connection != null ) {↵ | 7 | if ( connection != null ) {↵ | |
8 | try {↵ | 8 | try {↵ | |
9 | connection.commit();↵ | 9 | connection.commit();↵ | |
10 | connection.close();↵ | 10 | connection.close();↵ | |
11 | }↵ | 11 | }↵ | |
12 | catch ( SQLException sqle ) {↵ | 12 | catch ( SQLException sqle ) {↵ | |
13 | status = Status.STATUS_UNKNOWN;↵ | 13 | status = Status.STATUS_UNKNOWN;↵ | |
14 | throw new SystemException();↵ | 14 | throw new SystemException();↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | status = Status.STATUS_COMMITTED;↵ | 17 | status = Status.STATUS_COMMITTED;↵ | |
18 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | 18 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | |
19 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | 19 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | |
20 | s.afterCompletion( status );↵ | 20 | s.afterCompletion( status );↵ | |
21 | }↵ | 21 | }↵ | |
22 | //status = Status.STATUS_NO_TRANSACTION;↵ | 22 | //status = Status.STATUS_NO_TRANSACTION;↵ | |
23 | jtaTransactionManager.endCurrent( this ); | 23 |
| |
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) | 1.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 49 |
Number of mapped statements | 14 |
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) | 5.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | status = Status.STATUS_PREPARING; | 4 | status = Status.STATUS_PREPARING; | ||||||||||||
5 | for (int i = 0; i < synchronizations.size(); i++) | 5 | for (int i = 0; i < synchronizations.size(); i++) | ||||||||||||
6 | Synchronization s = (Synchronization)synchronizations.get(i); | 6 | Synchronization s = (Synchronization)synchronizations.get(i); | ||||||||||||
7 | s.beforeCompletion(); | 7 | s.beforeCompletion(); | ||||||||||||
8 | status = Status.STATUS_COMMITTING; | 8 | status = Status.STATUS_COMMITTING; | ||||||||||||
9 | if (connection != null) | 9 | if (connection != null) | ||||||||||||
10 | try | 10 | try | ||||||||||||
11 | connection.commit(); | 11 | connection.commit(); | ||||||||||||
12 | connection.close(); | 12 | connection.close(); | ||||||||||||
13 | status = Status.STATUS_COMMITTED; | 13 | status = Status.STATUS_COMMITTED; | ||||||||||||
14 | for (int i = 0; i < synchronizations.size(); i++) | 14 | for (int i = 0; i < synchronizations.size(); i++) | ||||||||||||
15 | Synchronization s = (Synchronization)synchronizations.get(i); | 15 | Synchronization s = (Synchronization)synchronizations.get(i); | ||||||||||||
16 | s.afterCompletion(status); | 16 | s.afterCompletion(status); | ||||||||||||
17 | jtaTransactionManager.endCurrent(this); |
| 17 | jtaTransactionManager.endCurrent(this); |
Row | Violation |
---|---|
1 | Expression jtaTransactionManager cannot be unified with expression jtaTransactionManager , because common superclass javax.transaction.TransactionManager does not declare member(s) void endCurrent(org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionImpl) |