public class BTMTransactionManagerLookup implements TransactionManagerLookup { /** * {@inheritDoc} */ public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Class clazz = Class.forName("bitronix.tm.TransactionManagerServices"); return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null); } catch (Exception e) { throw new HibernateException( "Could not obtain BTM transaction manager instance", e ); } } /** * {@inheritDoc} */ public String getUserTransactionName() { return "java:comp/UserTransaction"; } /** * {@inheritDoc} */ public Object getTransactionIdentifier(Transaction transaction) { return transaction;
public class JOnASTransactionManagerLookup implements TransactionManagerLookup { /** * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties) */ public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Class clazz = Class.forName("org.objectweb.jonas_tm.Current"); return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null); } catch (Exception e) { throw new HibernateException( "Could not obtain JOnAS transaction manager instance", e ); } } /** * {@inheritDoc} */ public String getUserTransactionName() { return "java:comp/UserTransaction"; } /** * {@inheritDoc} */ public Object getTransactionIdentifier(Transaction transaction) { return transaction;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/BTMTransactionManagerLookup.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/JOnASTransactionManagerLookup.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class BTMTransactionManagerLookup implements TransactionManagerLookup {
1
public class JOnASTransactionManagerLookup implements TransactionManagerLookup {
2

3
	/**
2
	/**
4
	 * {@inheritDoc}
3
	 * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties)
5
	 */
4
	 */
6
	public TransactionManager getTransactionManager(Properties props) throws HibernateException {
5
	public TransactionManager getTransactionManager(Properties props) throws HibernateException {
7
		try {
6
		try {
8
			Class clazz = Class.forName("bitronix.tm.TransactionManagerServices");
7
			Class clazz = Class.forName("org.objectweb.jonas_tm.Current");
9
			return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);
8
			return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);
10
		}
9
		}
11
		catch (Exception e) {
10
		catch (Exception e) {
12
			throw new HibernateException( "Could not obtain BTM transaction manager instance", e );
11
			throw new HibernateException( "Could not obtain JOnAS transaction manager instance", e );
13
		}
12
		}
14
	}
13
	}
15

16
	/**
14
	/**
17
	 * {@inheritDoc}
15
	 * {@inheritDoc}
18
	 */
16
	 */
19
	public String getUserTransactionName() {
17
	public String getUserTransactionName() {
20
		return "java:comp/UserTransaction";
18
		return "java:comp/UserTransaction";
21
	}
19
	}
22

23
	/**
20
	/**
24
	 * {@inheritDoc}
21
	 * {@inheritDoc}
25
	 */
22
	 */
26
	public Object getTransactionIdentifier(Transaction transaction) {
23
	public Object getTransactionIdentifier(Transaction transaction) {
27
		return transaction;
24
		return transaction;
28
	
25
	
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