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: 17 | Number of AST nodes: 17 | |||
1 | if ( status == Status.STATUS_MARKED_ROLLBACK ) {↵ | 1 | if ( status == Status.STATUS_MARKED_ROLLBACK ) {↵ | |
2 | log.trace( "on commit, status was marked for rollback-only" );↵ | 2 | log.trace( "on commit, status was marked for rollback-only" );↵ | |
3 | rollback();↵ | 3 | rollback();↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | status = Status.STATUS_PREPARING;↵ | 6 | status = Status.STATUS_PREPARING;↵ | |
7 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | 7 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | |
8 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | 8 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | |
9 | s.beforeCompletion();↵ | 9 | s.beforeCompletion();↵ | |
10 | }↵ | 10 | }↵ | |
11 | status = Status.STATUS_COMMITTING;↵ | 11 | status = Status.STATUS_COMMITTING;↵ | |
12 | if ( connection != null ) {↵ | 12 | if ( connection != null ) {↵ | |
13 | try {↵ | 13 | try {↵ | |
14 | connection.commit();↵ | 14 | connection.commit();↵ | |
15 | connection.close();↵ | 15 | connection.close();↵ | |
16 | }↵ | 16 | }↵ | |
17 | catch ( SQLException sqle ) {↵ | 17 | catch ( SQLException sqle ) {↵ | |
18 | status = Status.STATUS_UNKNOWN;↵ | 18 | status = Status.STATUS_UNKNOWN;↵ | |
19 | throw new SystemException();↵ | 19 | throw new SystemException();↵ | |
20 | }↵ | 20 | }↵ | |
21 | }↵ | 21 | }↵ | |
22 | status = Status.STATUS_COMMITTED;↵ | 22 | status = Status.STATUS_COMMITTED;↵ | |
23 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | 23 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | |
24 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | 24 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | |
25 | s.afterCompletion( status );↵ | 25 | s.afterCompletion( status );↵ | |
26 | }↵ | 26 | }↵ | |
27 | //status = Status.STATUS_NO_TRANSACTION;↵ | 27 | //status = Status.STATUS_NO_TRANSACTION;↵ | |
28 | jtaTransactionManager.endCurrent( this );↵ | 28 | jtaTransactionManager.endCurrent( this );↵ | |
29 | } | 29 |
| |
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) | 0.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 87 |
Number of mapped statements | 17 |
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) | 4.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (status == Status.STATUS_MARKED_ROLLBACK) | 1 | if (status == Status.STATUS_MARKED_ROLLBACK) | ||||||||||||
2 | log.trace("on commit, status was marked for rollback-only"); | 2 | log.trace("on commit, status was marked for rollback-only"); | ||||||||||||
3 | rollback(); | 3 | rollback(); | ||||||||||||
else | else | ||||||||||||||
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 | Type org.hibernate.test.cache.jbc2.functional.util.DualNodeJtaTransactionManagerImpl of variable jtaTransactionManager does not match with type org.hibernate.test.tm.SimpleJtaTransactionManagerImpl of variable jtaTransactionManager |