public class JOTMTransactionManagerLookup implements TransactionManagerLookup { /** * {@inheritDoc} */ public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Class clazz = Class.forName("org.objectweb.jotm.Current"); return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null); } catch (Exception e) { throw new HibernateException( "Could not obtain JOTM 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/JOTMTransactionManagerLookup.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 JOTMTransactionManagerLookup implements TransactionManagerLookup {
1
public class JOnASTransactionManagerLookup implements TransactionManagerLookup {
2
	/**
2
	/**
3
	 * {@inheritDoc}
3
	 * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties)
4
	 */
4
	 */
5
	public TransactionManager getTransactionManager(Properties props) throws HibernateException {
5
	public TransactionManager getTransactionManager(Properties props) throws HibernateException {
6
		try {
6
		try {
7
			Class clazz = Class.forName("org.objectweb.jotm.Current");
7
			Class clazz = Class.forName("org.objectweb.jonas_tm.Current");
8
			return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);
8
			return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);
9
		}
9
		}
10
		catch (Exception e) {
10
		catch (Exception e) {
11
			throw new HibernateException( "Could not obtain JOTM transaction manager instance", e );
11
			throw new HibernateException( "Could not obtain JOnAS transaction manager instance", e );
12
		}
12
		}
13
	}
13
	}
14
	/**
14
	/**
15
	 * {@inheritDoc}
15
	 * {@inheritDoc}
16
	 */
16
	 */
17
	public String getUserTransactionName() {
17
	public String getUserTransactionName() {
18
		return "java:comp/UserTransaction";
18
		return "java:comp/UserTransaction";
19
	}
19
	}
20
	/**
20
	/**
21
	 * {@inheritDoc}
21
	 * {@inheritDoc}
22
	 */
22
	 */
23
	public Object getTransactionIdentifier(Transaction transaction) {
23
	public Object getTransactionIdentifier(Transaction transaction) {
24
		return transaction
24
		return transaction
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