public boolean wasRolledBack() throws TransactionException { final int status; try { status = userTransaction.getStatus(); } catch ( SystemException se ) { log.error( "Could not determine transaction status", se ); throw new TransactionException( "Could not determine transaction status", se ); } if ( status == Status.STATUS_UNKNOWN ) { throw new TransactionException( "Could not determine transaction status" ); } else { return JTAHelper.isRollback( status );
public boolean wasCommitted() throws TransactionException { final int status; try { status = userTransaction.getStatus(); } catch ( SystemException se ) { log.error( "Could not determine transaction status", se ); throw new TransactionException( "Could not determine transaction status: ", se ); } if ( status == Status.STATUS_UNKNOWN ) { throw new TransactionException( "Could not determine transaction status" ); } else { return status == Status.STATUS_COMMITTED;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/JTATransaction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/JTATransaction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public boolean wasRolledBack() throws TransactionException {
1
public boolean wasCommitted() throws TransactionException {
2
		final int status;
2
		final int status;
3
		try {
3
		try {
4
			status = userTransaction.getStatus();
4
			status = userTransaction.getStatus();
5
		}
5
		}
6
		catch ( SystemException se ) {
6
		catch ( SystemException se ) {
7
			log.error( "Could not determine transaction status", se );
7
			log.error( "Could not determine transaction status", se );
8
			throw new TransactionException( "Could not determine transaction status", se );
8
			throw new TransactionException( "Could not determine transaction status: ", se );
9
		}
9
		}
10
		if ( status == Status.STATUS_UNKNOWN ) {
10
		if ( status == Status.STATUS_UNKNOWN ) {
11
			throw new TransactionException( "Could not determine transaction status" );
11
			throw new TransactionException( "Could not determine transaction status" );
12
		}
12
		}
13
		else {
13
		else {
14
			return JTAHelper.isRollback( status );
14
			return status == Status.STATUS_COMMITTED;
15
		
15
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0